Skip to main content

Primitives

segments controls tessellation where a backend uses it. It does not turn an exact OCCT circle into a polygon; exact kernels can preserve analytic surfaces while using the value for mesh extraction where applicable. All size, height, and radius expressions must resolve to finite valid geometry. Before asking a kernel to construct the shape, the evaluator rejects with FEATURE_INVALID any box size, cylinder height, cylinder radius (stored as radiusBottom), or sphere radius that is zero or negative. A cylinder’s radiusTop is the one exception: it may be zero, which builds a cone that comes to a point at the top, and only a negative value is rejected. Because the bottom radius must stay positive, author a downward-pointing cone apex-up and then rotate or mirror it.

One transform

Convenience methods are available for translation, Euler rotation, nonuniform scale, and mirror.

Ordered transform chain

Use cad.transform when operation order must be explicit:
Operations execute in authored order. Reordering scale, rotation, and translation generally changes the result and therefore changes effective feature hashes.

Mirror

The vector is the normal of the mirror plane through the origin. Only its direction matters: the evaluator normalizes every finite, non-zero normal before calling the kernel, so scalarVec3(2, 0, 0), scalarVec3(1e-200, 0, 0), and scalarVec3(1e200, 0, 0) all mirror across the same plane. A normal whose components all resolve to zero, for example through a parameter override, fails with FEATURE_INVALID at /nodes/<id>/operations/<index>/normal before the kernel is asked to transform anything. The same rule applies to a tf.mirror assembly placement, whose diagnostic path ends in /instances/<index>/placement/<index>/normal.

Topology through transforms

Transforms create a new feature node, but semantic topology can retain origin and modification lineage when the selected backend provides it. Query for modifiedBy(transform) and combine it with the original feature source rather than using a post-transform coordinate alone. Nonuniform scale changes metric geometry and may change analytic surface kinds. Persistent matching therefore depends on compatible evidence and the declared topology protocol, not merely on the fact that a transform node exists.