| Primitives | Additive | Subtractive |
|---|---|---|
|
Workplane.box (length, width, height) |
Workplane.extrude (until) |
Workplane.cut (toCut) |
|
Workplane.sphere (radius) |
Workplane.sweep (path) |
Workplane.cutThruAll () |
|
Workplane.cylinder (height, radius) |
Workplane.loft (ruled, combine, clean) |
Workplane.cutBlind (until) |
|
Workplane.text (txt, fontsize, distance) |
Workplane.revolve (angleDegrees) |
Workplane.hole (diameter, depth) |
|
Workplane.union (angleDegrees) |
Workplane.intersect (toIntersect) |
|
Workplane.rect (xLen, yLen) |
Workplane.circle (radius) |
Workplane.ellipse (x_radius, y_radius) |
|
Workplane.center (x, y) |
Workplane.moveTo (x, y) |
Workplane.move (xDist, yDist) |
|
Workplane.lineTo (x, y) |
Workplane.line (xDist, yDist) |
Workplane.polarLine (distance, angle) |
|
Workplane.vLine (distance) |
Workplane.hLine (distance) |
Workplane.polyline (listOfXYTuple) |
|
Sketch.rect (w, h) |
Sketch.circle (r) |
Sketch.ellipse (a1, a2) |
|
Sketch.trapezoid (w, h, a1) |
Sketch.regularPolygon (r, n) |
Sketch.polygon (pts) |
|
Sketch.fillet (d) |
Sketch.chamfer (d) |
Sketch.finalize () |
|
importers.importDXF (path, tol) |
importers.importStep ("path") |
|
exporters.export (solid, "path/solid.***") |
Where *** can be: svg, step, stl, amf, vrml, json |
|
Assembly( (obj) |
Assembly.add (obj) |
|
Assembly.constrain (***) |
Assembly.solve () |
|
Assembly.save ("path/assembly.***") |
Where *** can be: step, xml, gltf, vtkjs, vrml |
| vertex | A single point in space |
| edge | A connection between two or more vertices along a particular path (called a curve) |
| wire | A collection of edges that are connected together |
| face | A set of edges or wires that enclose a surface |
| shell | A collection of faces that are connected together along some of their edges |
| solid | A shell that has a closed interior |
| compound | A collection of solids |
| Modifier | Description |
|---|---|
| | | Parallel to = ParallelDirSelector |
| # | Perpendicular to = PerpendicularDirSelector |
| + | Positive direction = DirectionSelector |
| - | Negative direction = DirectionSelector |
| > | Max = DirectionMinMaxSelector(directionMax=True) |
| < | Min = DirectionMinMaxSelector(directionMax=False) |
| % | Curve/surface type = TypeSelector |
| Selector Methods | Selector Classes |
|---|---|
| CQ.faces(selector) | NearestToPointSelector(pnt) |
| CQ.edges(selector) | ParallelDirSelector(vector) |
| CQ.vertices(selector) | DirectionSelector(vector) |
| CQ.solids(selector) | DirectionMinMaxSelector(vector) |
| CQ.shells(selector) | TypeSelector(typeString) |
| Name | xDir | yDir | zDir |
|---|---|---|---|
| XY | +x | +y | +z |
| YZ | +y | +z | +x |
| XZ | +x | +z | -y |
| front | +x | +y | +z |
| back | -x | +y | -z |
| left | +z | +y | -x |
| right | -z | +y | +x |
| top | +x | -z | +y |
| bottom | +x | +z | -y |
| Class | Description |
|---|---|
| CQ(obj) | Provides enhanced functionality for a wrapped CAD primitive. |
| Plane(origin, xDir, normal) | A 2d coordinate system in space, with the x-y axes on the a plane, and a particular point as the origin. |
| Workplane(inPlane[origin, obj]) | Defines a coordinate system in space, in which 2D coordinates can be used. |
| Selector | Selector Class | Selects | # Objects Returned |
|---|---|---|---|
| +Z | DirectionSelector | Faces with normal in +z direction | 0 or 1 |
| |Z | ParallelDirSelector | Faces parallel to xy plane | 0..many |
| -X | DirectionSelector | Faces with normal in neg x direction | 0..many |
| #Z | PerpendicularDirSelector | Faces perpendicular to z direction | 0..many |
| %Plane | TypeSelector | Faces of type plane | 0..many |
| >Y | DirectionMinMaxSelector | Face farthest in the positive y dir | 0 or 1 |
| <Y | DirectionMinMaxSelector | Face farthest in the negative y dir | 0 or 1 |
| Selector | Selector Class | Selects | # Objects Returned |
|---|---|---|---|
| +Z | DirectionSelector | Edges aligned in the Z direction | 0..many |
| |Z | ParallelDirSelector | Edges parallel to z direction | 0..many |
| -X | DirectionSelector | Edges aligned in neg x direction | 0..many |
| #Z | PerpendicularDirSelector | Edges perpendicular to z direction | 0..many |
| %Plane | TypeSelector | Edges type line | 0..many |
| >Y | DirectionMinMaxSelector | Edges farthest in the positive y dir | 0 or 1 |
| <Y | DirectionMinMaxSelector | Edges farthest in the negative y dir | 0 or 1 |
| Selector | Selector Class | Selects |
|---|---|---|
| >Y | DirectionMinMaxSelector | Vertices farthest in the +Y dir |
| <Y | DirectionMinMaxSelector | Vertices farthest in the -Y dir |
| >>Y[-2] | CenterNthSelector | 2nd farthest vertex in the +Y dir |
| <<Y[0] | CenterNthSelector | 1st closest vertex in the Y dir |