API Reference
igniscad
AlignmentMixin
A mixin of class Entity, specified to calculate alignment, bounding box and position.
Source code in src/igniscad/mixins.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
bbox
property
Grabbing the bounding box of the entity.
radius
property
Estimate the radius of the entity(only for spheres and/or cylinders).
right
property
Grabbing the maximum X pos.
top
property
Grabbing the Z pos of the center point of the top surface of the entity.
add_joint(name, position=(0, 0, 0), rotation=(0, 0, 0))
Define a named joint on the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Joint name. |
required |
position
|
Local position relative to the entity origin. Accepts a
tuple/list, build123d.Vector, build123d.Location, or any object
exposing |
(0, 0, 0)
|
|
rotation
|
Optional local rotation in degrees as |
(0, 0, 0)
|
Returns:
| Name | Type | Description |
|---|---|---|
Joint |
Joint
|
The created joint instance. |
Source code in src/igniscad/mixins.py
add_joint_on_face(name, face='top', offset=0, rotation=(0, 0, 0))
Define a named joint at the center of one bbox face.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Joint name. |
required |
face
|
str
|
|
'top'
|
offset
|
float
|
Extra distance along the face normal. |
0
|
rotation
|
Optional local rotation in degrees as |
(0, 0, 0)
|
Source code in src/igniscad/mixins.py
align(target, face='top', offset=0)
Snap the current Entity to a specified face of the target.
Calculation
Center pos of the target surface + Half of the current's thickness + Additional gap
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
Entity
|
The target Entity |
required |
face
|
str
|
"top", "bottom", "left", "right", "front", "back" |
'top'
|
offset
|
float
|
Addition gap between the current and the target. (A positive number refers to a gap and a negative number refers to an embedding.) |
0
|
Source code in src/igniscad/mixins.py
join(target, offset=(0, 0, 0))
Join the current entity to a joint-like target by pure translation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
A |
required | |
offset
|
Additional translation after the joint alignment. |
(0, 0, 0)
|
Source code in src/igniscad/mixins.py
joint(name)
Return a previously defined named joint.
Source code in src/igniscad/mixins.py
Axis
BaseContainer
Bases: Entity
The base class of all containers. Supports the context manager syntax and overrides the "<<" operator to capture models.
Source code in src/igniscad/containers.py
__init__(name)
Entity
Bases: AlignmentMixin, ModificationMixin, EntitySelectorMixin
A base class for every wrapped build123d objects. The original build123d objects can be called with entity.part .
Source code in src/igniscad/core.py
get_by_tag(tag)
move(x=0, y=0, z=0)
Move the entity to a specific position.
rotate(x=0, y=0, z=0)
Rotate the entity to a specific angle and position.
Source code in src/igniscad/core.py
wrap_result(res)
staticmethod
Inner helper function to wrap the result into a single build123d object. The show() function require a single Compound or Solid object to save the .stl file.
Source code in src/igniscad/core.py
EntitySelectorMixin
A mixin for the Entity class that provides methods to initiate selections.
This mixin adds the .faces(), .edges(), and .vertices() methods to the Entity class, which are the entry points for the fluent selection API.
Source code in src/igniscad/mixins.py
edges()
Selects all edges of the entity.
This method retrieves all edges from the underlying build123d part and wraps them in an EdgeSelector, enabling chainable filtering and modification.
Returns:
| Name | Type | Description |
|---|---|---|
EdgeSelector |
EdgeSelector
|
A selector containing all edges of the entity. |
Source code in src/igniscad/mixins.py
faces()
Selects all faces of the entity.
This method retrieves all faces from the underlying build123d part and wraps them in a FaceSelector, enabling chainable filtering and modification.
Returns:
| Name | Type | Description |
|---|---|---|
FaceSelector |
FaceSelector
|
A selector containing all faces of the entity. |
Source code in src/igniscad/mixins.py
vertices()
Selects all vertices of the entity.
This method retrieves all vertices from the underlying build123d part and wraps them in a VertexSelector, enabling chainable filtering and modification.
Returns:
| Name | Type | Description |
|---|---|---|
VertexSelector |
VertexSelector
|
A selector containing all vertices of the entity. |
Source code in src/igniscad/mixins.py
Group
Bases: BaseContainer
Combine multiple entities into a single Group Entity. Support the same context-manager syntax (as Model does). Entities within a group are automatically unioned. The Group object can be moved or aligned like a normal Entity outside the with statements.
Source code in src/igniscad/containers.py
__init__(name=None)
__lshift__(other)
Override the "<<" operator. Usage: group << Entity(...)
Every entity added is unioned automatically.
Source code in src/igniscad/containers.py
Joint
dataclass
A named alignment anchor attached to an Entity.
The location is stored relative to the owning entity so joints remain valid after the entity is moved or rotated.
Source code in src/igniscad/mixins.py
position
property
Return the joint position in world coordinates.
world_location
property
Return the joint location in world coordinates.
Model
Bases: BaseContainer
A context manager to capture generated models(Entity objects).
Source code in src/igniscad/containers.py
__init__(name)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
name of the Group in context registry. |
required |
__lshift__(other)
Override the "<<" operator. Usage: model << Entity(...)
Source code in src/igniscad/containers.py
find(name)
To find an Entity by its name in the registry. Args: name (str): Entity name
ModificationMixin
A mixin of class Entity, specified to perform modification operations.
Source code in src/igniscad/mixins.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
chamfer(distance, edges=None)
Chamfers the edges of the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distance
|
float
|
The distance of the chamfer. |
required |
edges
|
list
|
A list of edges to chamfer. If None, all edges are chamfered. Defaults to None. |
None
|
Source code in src/igniscad/mixins.py
fillet(radius, edges=None)
Fillets the edges of the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
The radius of the fillet. |
required |
edges
|
list
|
A list of edges to fillet. If None, all edges are filleted. Defaults to None. |
None
|
Source code in src/igniscad/mixins.py
offset(distance, kind=bd.Kind.ARC)
Offsets the entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distance
|
float
|
The distance to offset. |
required |
kind
|
str
|
The kind of offset to perform. Defaults to 'arc'. |
ARC
|
Source code in src/igniscad/mixins.py
shell()
Creates a shell of the entity.
Box(x, y, z, name=None)
Wrapped function for build123d.Box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
X coordinate |
required |
y
|
float
|
Y coordinate |
required |
z
|
float
|
Z coordinate |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Source code in src/igniscad/primitives.py
Circle(r, name=None)
Creates a 2D circle sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
float
|
Radius of the circle. |
required |
name
|
str
|
Name of the Entity in the context registry. |
None
|
Source code in src/igniscad/primitives_2d.py
Cone(bottom_radius, top_radius, h, name=None)
Wrapped function for build123d.Cone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bottom_radius
|
float
|
bottom radius |
required |
top_radius
|
float
|
top radius |
required |
h
|
float
|
height |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Source code in src/igniscad/primitives.py
CounterBoreHole(radius, cb_radius, cb_depth, height, name=None)
Creates a counter-bore hole shape (for boolean subtraction). AI description: A hole for a socket head cap screw.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
Through-hole radius (for the screw shaft) |
required |
cb_radius
|
float
|
Counter-bore radius (for the screw head) |
required |
cb_depth
|
float
|
Counter-bore depth |
required |
height
|
float
|
Total height of the hole |
required |
name
|
str
|
Name of the Entity in the context registry |
None
|
Source code in src/igniscad/primitives.py
CountersinkHole(radius, csk_radius, csk_angle, height, name=None)
Creates a countersink hole shape (for boolean subtraction). AI description: A hole for a countersunk screw.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
float
|
Through-hole radius |
required |
csk_radius
|
float
|
Countersink top radius |
required |
csk_angle
|
float
|
Countersink angle in degrees (e.g., 82, 90) |
required |
height
|
float
|
Total height of the hole |
required |
name
|
str
|
Name of the Entity in the context registry |
None
|
Source code in src/igniscad/primitives.py
Cylinder(r, h, name=None)
Wrapped function for build123d.Cylinder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
float
|
radius |
required |
h
|
float
|
height |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Source code in src/igniscad/primitives.py
Extrude(sketch, amount, name=None)
Extrudes a 2D sketch into a 3D part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch
|
Entity
|
The 2D sketch entity to extrude. |
required |
amount
|
float
|
The extrusion distance. |
required |
name
|
str
|
Name of the new 3D Entity. |
None
|
Source code in src/igniscad/primitives_2d.py
ISO_Hole(size, depth, fit='Normal', name=None)
Creates a standard ISO metric screw clearance hole.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
str
|
"M2", "M3", "M4", "M5", "M6", "M8", "M10", "M12" |
required |
depth
|
float
|
Depth of the hole |
required |
fit
|
str
|
"Close" (tight fit), "Normal" (standard), "Loose" (clearance) |
'Normal'
|
name
|
str
|
Name of the Entity in the context registry |
None
|
Source code in src/igniscad/primitives.py
Loft(*sketches, name=None)
Creates a 3D part by lofting through a series of 2D sketches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*sketches
|
Entity
|
A sequence of 2D sketch entities to loft through. |
()
|
name
|
str
|
Name of the new 3D Entity. |
None
|
Source code in src/igniscad/primitives_2d.py
Polygon(*points, name=None)
Creates a 2D polygon from a list of points.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*points
|
A list of (x, y) tuples representing the vertices of the polygon. |
()
|
|
name
|
str
|
Name of the Entity in the context registry. |
None
|
Source code in src/igniscad/primitives_2d.py
Rectangle(x, y, name=None)
Creates a 2D rectangle sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Width of the rectangle. |
required |
y
|
float
|
Height of the rectangle. |
required |
name
|
str
|
Name of the Entity in the context registry. |
None
|
Source code in src/igniscad/primitives_2d.py
Revolve(sketch, axis=bd.Axis.X, name=None)
Revolves a 2D sketch around an axis to create a 3D part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch
|
Entity
|
The 2D sketch entity to revolve. |
required |
axis
|
Axis
|
The axis of revolution. Defaults to X-axis. |
X
|
name
|
str
|
Name of the new 3D Entity. |
None
|
Source code in src/igniscad/primitives_2d.py
Slot(w, h, d, name=None)
Wrapped function for a 3D slot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
float
|
slot width on the 2D sketch plane |
required |
h
|
float
|
slot height on the 2D sketch plane(diameter) |
required |
d
|
float
|
slot depth (extrusion amount) |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Source code in src/igniscad/primitives.py
Sphere(r, name=None)
Wrapped function for build123d.Sphere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
float
|
radius |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Source code in src/igniscad/primitives.py
Sweep(sketch, path, name=None)
Sweeps a 2D sketch along a path to create a 3D part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sketch
|
Entity
|
The 2D profile sketch. |
required |
path
|
Entity
|
The 1D path (e.g., a Line, Spline, or Wire). |
required |
name
|
str
|
Name of the new 3D Entity. |
None
|
Source code in src/igniscad/primitives_2d.py
Text(txt, font_size, font='Arial', name=None)
Creates a 2D text sketch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
txt
|
str
|
The text to be rendered. |
required |
font_size
|
float
|
The size of the font. |
required |
font
|
str
|
The name of the font. |
'Arial'
|
name
|
str
|
Name of the Entity in the context registry. |
None
|
Source code in src/igniscad/primitives_2d.py
Torus(major, minor, name=None)
Wrapped function for build123d.Torus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
major
|
float
|
major radius |
required |
minor
|
float
|
minor radius |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Source code in src/igniscad/primitives.py
Wedge(xsize, ysize, zsize, xmax, xmin, ymax, ymin, name=None)
Wrapped function for build123d.Wedge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xsize
|
float
|
Base width (X) |
required |
ysize
|
float
|
Base depth (Y) |
required |
zsize
|
float
|
Height (Z) |
required |
xmax
|
float
|
X coordinate of the top face end (relative to origin 0) |
required |
xmin
|
float
|
X coordinate of the top face start (relative to origin 0) |
required |
ymax
|
float
|
Y coordinate of the top face end (mapped to build123d zmax) |
required |
ymin
|
float
|
Y coordinate of the top face start (mapped to build123d zmin) |
required |
name
|
str
|
name of the Entity in context registry |
None
|
Note
In build123d, the zmax and zmin params control the Y direction, which can be confusing. They are re-mapped to ymax and ymin here for clarity.
Source code in src/igniscad/primitives.py
show(model, mode='fallback')
Visualize the specified model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The model to visualize. |
required |
mode
|
Literal['fallback', 'yacv', 'export'] = "fallback"
|
The method of visualization. "Fallback": to export the file when YACV is unavailable. "yacv": to visualize the model via Yet Another CAD Viewer. "export": to export the model to a *.stl file. |
'fallback'
|
Source code in src/igniscad/visualization.py
validate_dimensions(*args_to_check)
Validate whether the specified dimensions are strictly positive (> 0). Raises InfeasibleEntityError if <= 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args_to_check
|
str
|
the arguments to validate |
()
|
Source code in src/igniscad/helpers/validator.py
validate_vertices(arg_name='points', min_points=3)
Validator for vertices / points. Validate the vertex count and the coincidence (distance between adjacent vertices).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg_name
|
str
|
the argument to check. |
'points'
|
min_points
|
int
|
the smallest count of points. |
3
|