construction.loft

construction.loft

Loft between two 2D profiles into a solid SDF.

Functions

Name Description
loft Loft between two polygon profiles with equal vertex counts.

loft

construction.loft.loft(profile_a, profile_b, height, material=None)

Loft between two polygon profiles with equal vertex counts.

Generates a :class:~cadjoint.sdf.primitives.loft.LoftedPolygon that shares both profiles’ vertex parameters and is placed on profile_a’s sketch plane. In the placed frame, profile A sits at -height/2 and profile B at +height/2 along the plane normal; vertex i of A connects to vertex i of B. profile_b’s own plane is ignored — only its 2D vertex coordinates are used.

Parameters

Name Type Description Default
profile_a PolygonProfile Bottom profile; its plane places the solid. required
profile_b PolygonProfile Top profile; must have the same vertex count as profile_a. required
height float | Scalar Total loft height along profile_a’s plane normal. required
material Optional render material. None

Returns

Name Type Description
SDF solid sharing parameter references with both profiles, with its two planar ends bound on as solid.cap("-") (profile A) and solid.cap("+") (profile B). The ruled side walls are planar only by accident, so they are not declared.

Raises

Name Type Description
ValueError If the two profiles have different vertex counts.

Example

bottom = PolygonProfile([[-1, -1], [1, -1], [1, 1], [-1, 1]], name="a")
top = PolygonProfile([[-0.5, -0.5], [0.5, -0.5], [0.5, 0.5], [-0.5, 0.5]], name="b")
solid = loft(bottom, top, height=2.0)