I keep seeing reference to use of Mathematica as a CAD tool (for instance, this). I'd like to use it as such if feasible, but I'm having trouble locating equivalents of the functionality I use in my current design tool, OpenSCAD.
I know how to create simple shapes (Graphics3D[]
, Cylinder[]
, etc.) and I'm aware that Mathematica can export to STL format. But does Mathematica have equivalents of the following OpenSCAD functions, or is it the wrong tool for the kind of thing I'm trying to do?
- linear_extrude()
- union()
- intersection()
- difference()
- translate()
- rotate()
Answer
UPDATE
With release of Mathematica 10 built-in functionality we have new things and continue to add - please see:
Geometric Computation examples
Especially: Derived Geometric Regions
OLDER
Quick answers to some points:
My guess is you are interested in the operations related to 3D printing. Mathematica provides computational approach - which is very general and allows to compute a lot of things. To see possibilities I would really recommend to watch Yu-Sung Chang recent talk "Scan, Convert, and Print: Playing with 3D Objects in Mathematica":
In the notebook on slide 12 you find how to define Union, Difference, Intersection. Quick sample from that slide for Difference between a cube and a sphere:
sphereQ[{x_, y_, z_}, r_, center_: {0, 0, 0}] := Norm[{x, y, z} - center] < r;
cubeQ[{x_, y_, z_}, r_] := (Abs[x] < r && Abs[y] < r && Abs[z] < r);
RegionPlot3D[
cubeQ[{x, y, z}, 1] && \[Not]
sphereQ[{x, y, z}, 1, {1, 1, 1}], {x, -1, 2}, {y, -1, 2}, {z, -1,
2}, PlotRangePadding -> .5, Mesh -> None, PlotPoints -> 50]
You can do other neat things like computing and thickening thin surfaces - all this is in the video:
ParametricPlot3D[{1.16^v Cos[v] (1 + Cos[u]), -1.16^v Sin[
v] (1 + Cos[u]), -2 1.16^v (1 + Sin[u])}, {u, 0, 2 Pi}, {v, -15,
6}, Mesh -> False, PlotRange -> All, PlotStyle -> Thickness[.5],
PlotPoints -> 35]
Comments
Post a Comment