Builder Common API Reference
The following are common to all the builders.
Selector Methods
- Builder.vertices(select: Select = Select.ALL) ShapeList[Vertex] [source]
Return Vertices
Return either all or the vertices created during the last operation.
- Builder.faces(select: Select = Select.ALL) ShapeList[Face] [source]
Return Faces
Return either all or the faces created during the last operation.
- Builder.edges(select: Select = Select.ALL) ShapeList[Edge] [source]
Return Edges
Return either all or the edges created during the last operation.
Enums
- class GeomType(value)[source]
CAD geometry object type
- BEZIER = 6
- BSPLINE = 7
- CIRCLE = 12
- CONE = 3
- CYLINDER = 2
- ELLIPSE = 13
- EXTRUSION = 9
- HYPERBOLA = 14
- LINE = 11
- OFFSET = 10
- OTHER = 16
- PARABOLA = 15
- PLANE = 1
- REVOLUTION = 8
- SPHERE = 4
- TORUS = 5
- class Mode(value)[source]
Combination Mode
- ADD = 1
- INTERSECT = 3
- PRIVATE = 5
- REPLACE = 4
- SUBTRACT = 2
- class Select(value)[source]
Selector scope - all, last operation or new objects
- ALL = 1
- LAST = 2
- NEW = 3
- class SortBy(value)[source]
Sorting criteria
- AREA = 3
- DISTANCE = 5
- LENGTH = 1
- RADIUS = 2
- VOLUME = 4
Locations
- class Locations(*pts: Union[VectorLike, Vertex, Location, Face, Plane, Axis, Iterable[VectorLike, Vertex, Location, Face, Plane, Axis]])[source]
Location Context: Push Points
Creates a context of locations for Part or Sketch
- Parameters
pts (Union[VectorLike, Vertex, Location, Face, Plane, Axis] or iterable of same) – sequence of points to push
- Variables
local_locations (list{Location}) – locations relative to workplane
- local_locations
values independent of workplanes
- class GridLocations(x_spacing: float, y_spacing: float, x_count: int, y_count: int, align: ~typing.Union[~build123d.build_enums.Align, tuple[build123d.build_enums.Align, build123d.build_enums.Align]] = (<Align.CENTER>, <Align.CENTER>))[source]
Location Context: Rectangular Array
Creates a context of rectangular array of locations for Part or Sketch
- Parameters
- Variables
x_spacing (float) – horizontal spacing
y_spacing (float) – vertical spacing
x_count (int) – number of horizontal points
y_count (int) – number of vertical points
align (Union[Align, tuple[Align, Align]]) – align min, center, or max of object.
local_locations (list{Location}) – locations relative to workplane
- Raises
ValueError – Either x or y count must be greater than or equal to one.
- local_locations
values independent of workplanes
- max
top right corner
- min
bottom left corner
- size
size of the grid
- class HexLocations(apothem: float, x_count: int, y_count: int, align: ~typing.Union[~build123d.build_enums.Align, tuple[build123d.build_enums.Align, build123d.build_enums.Align]] = (<Align.CENTER>, <Align.CENTER>))[source]
Location Context: Hex Array
Creates a context of hexagon array of locations for Part or Sketch. When creating hex locations for an array of circles, set apothem to the radius of the circle plus one half the spacing between the circles.
- Parameters
- Variables
apothem (float) – radius of the inscribed circle
xCount (int) – number of points ( > 0 )
yCount (int) – number of points ( > 0 )
align (Union[Align, tuple[Align, Align]]) – align min, center, or max of object.
diagonal (float) – major radius
local_locations (list{Location}) – locations relative to workplane
- Raises
ValueError – Spacing and count must be > 0
- local_locations
values independent of workplanes
- class PolarLocations(radius: float, count: int, start_angle: float = 0.0, angular_range: float = 360.0, rotate: bool = True, endpoint: bool = False)[source]
Location Context: Polar Array
Creates a context of polar array of locations for Part or Sketch
- Parameters
radius (float) – array radius
count (int) – Number of points to push
start_angle (float, optional) – angle to first point from +ve X axis. Defaults to 0.0.
angular_range (float, optional) – magnitude of array from start angle. Defaults to 360.0.
rotate (bool, optional) – Align locations with arc tangents. Defaults to True.
endpoint (bool, optional) – If True, start_angle + angular_range is the last sample. Otherwise, it is not included. Defaults to False.
- Variables
local_locations (list{Location}) – locations relative to workplane
- Raises
ValueError – Count must be greater than or equal to 1
- local_locations
values independent of workplanes