sdf.Intersection

sdf.Intersection(*sdfs, smoothness=0.1)

Intersection of two or more SDFs (only overlapping region).

Uses smooth maximum for differentiable blending.

Parameters

Name Type Description Default
sdfs Tuple of SDFs to intersect ()
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 Intersection(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
material_at Blended across every operand, not just the first two.
patch_fields Every operand’s patches, operand-major, for a sharp intersection only.
sdf Pure function for intersection operation.

material_at

sdf.Intersection.material_at(p)

Blended across every operand, not just the first two.

patch_fields

sdf.Intersection.patch_fields()

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

max over the operands, so the intersection’s surface is made of pieces of theirs and the decomposition is their fields concatenated in operand order. No sign change is needed: each operand already reads positive outside itself, and outside the intersection is outside at least one of them. See :func:~cadjoint.sdf.boolean.base._operand_patch_fields for the order’s guarantees and the smoothness > 0 refusal.

Most operands contribute patches that bound nothing here — an intersection keeps only the overlap, so the rest of each operand’s surface is interior. That is the consumer’s business rather than this method’s: it drops a patch that bounds nothing with its own boundary probe, and a missing patch it could not recover.

sdf

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

Pure function for intersection 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 Intersection SDF value