sdf.Union

sdf.Union(*sdfs, smoothness=0.1)

Union of two or more SDFs (combines all shapes).

Uses smooth minimum for differentiable blending at the intersection.

Parameters

Name Type Description Default
sdfs Tuple of SDFs to union ()
smoothness float Blend half-width in model units, not a fillet radius. 0 is a sharp boolean; the default of 0.1 blends, so a plain Union(a, b) is a blended one and a caller who wants the sharp operation has to ask for smoothness=0. The value does not scale with the part: 0.1 is a tenth of a unit whatever the unit stands for, enough on a large part to erase a thin internal feature. See :mod:cadjoint.sdf.boolean.smooth for what the blend costs — it moves the field by up to smoothness per operation, and by the full amount wherever the operands agree. 0.1

Methods

Name Description
patch_fields Every operand’s patches, operand-major, for a sharp union only.
sdf Pure function for union operation.

patch_fields

sdf.Union.patch_fields()

Every operand’s patches, operand-major, for a sharp union only.

min over the operands means the union’s surface is made of pieces of theirs, so the decomposition is their fields concatenated in operand order. See :func:~cadjoint.sdf.boolean.base._operand_patch_fields for what the order guarantees and why a smoothness > 0 union — whose blended fillet lies on no operand’s zero set — declares nothing instead.

Note that :func:~cadjoint.meshing.patch_fields.world_frame_leaves splits a scene at its booleans, so a top-level union never reaches this method; it earns its keep for a boolean nested under something else, such as a pattern of a two-cylinder tool.

sdf

sdf.Union.sdf(child_sdfs, p, smoothness)

Pure function for union operation.

Parameters

Name Type Description Default
child_sdfs Tuple of SDF functions required
p Array Query point(s) required
smoothness float Blend radius required

Returns

Name Type Description
Array Union SDF value