安装:
www.openscad.org/
参考资料:
https://www.openscad.org/documentation.html
https://www.openscad.org/cheatsheet/index.html官网
//长方体:
cube(size = [x,y,z], center = true/false); //false default
//球体:
sphere(10,$fn=100); //default半径,碎片的分辨率; $fn越大结果表面越光滑生成的STL文件越大
sphere(10,$fa=0.05,$fs=1); //半径 碎片的角度(°)片段大小(mm)生成文件可能小一点
//柱体
cylinder(h = height, r1 = BottomRadius, r2 = TopRadius, center = true/false);
//多面体
polyhedron( points = [ [X0, Y0, Z0], [X1, Y1, Z1], ... ], faces = [ [P0, P1, P2, P3, ...], ... ], convexity = N);
points
Vector of 3d points or vertices. Each point is in turn a vector, [x,y,z], of its coordinates.Points may be defined in any order. N points are referenced, in the order defined, as 0 to N-1.
faces [Note: Requires version 2014.03]
Vector of faces that collectively enclose the solid. Each face is a vector containing the indices (0 based) of 3 or more points from the points vector.
Faces may be defined in any order. Define enough faces to fully enclose the solid, with no overlap.
If points that describe a single face are not on the same plane, the face is automatically split into triangles as needed.
convexity
Integer. The convexity parameter specifies the maximum number of faces a ray intersecting the object might penetrate. This parameter is needed only for correct display of the object in OpenCSG preview mode. It has no effect on the polyhedron rendering. For display problems, setting it to 10 should work fine for most cases.
default values: polyhedron();
yields: polyhedron(points = undef, faces = undef, convexity = 1);