construction.ConstructionPrimitive
construction.ConstructionPrimitive(
kind,
position=(0.0, 0.0, 0.0),
rotation=(0.0, 0.0, 0.0),
material=None,
name=None,
**dimensions,
)
A primitive with an editable placement, mirroring the SDF it generates.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| kind | str | One of box, sphere, cylinder. |
required |
| position | World position of the primitive’s centre. | (0.0, 0.0, 0.0) |
|
| rotation | Intrinsic X, Y, Z angles in radians — numbers, or Scalar parameters (a pinned Scalar(..., free=False) keeps an inclined tool from becoming three optimisation variables). |
(0.0, 0.0, 0.0) |
|
| material | Optional render material for the generated SDF. | None |
|
| name | str | None | Prefix for the generated parameter names. | None |
| **dimensions | The kind’s size arguments — size for a box (half extents), radius for a sphere, radius and height (half height) for a cylinder. |
{} |
Attributes
| Name | Description |
|---|---|
| faces | The primitive’s analytic faces, in its own rotated frame. |
Methods
| Name | Description |
|---|---|
| face | The face with this key — "+x", "cap-". |
| local_edges | Wireframe edges in the primitive’s own frame. |
| sdf | Build the placed SDF, sharing this mirror’s parameter objects. |
| world_edges | Wireframe edges in world space, as [[ax, ay, az], [bx, by, bz]]. |
face
construction.ConstructionPrimitive.face(key)
The face with this key — "+x", "cap-".
local_edges
construction.ConstructionPrimitive.local_edges()
Wireframe edges in the primitive’s own frame.
sdf
construction.ConstructionPrimitive.sdf()
Build the placed SDF, sharing this mirror’s parameter objects.
world_edges
construction.ConstructionPrimitive.world_edges()
Wireframe edges in world space, as [[ax, ay, az], [bx, by, bz]].