Skip to main content

Module halfspace

Module halfspace 

Source
Expand description

Half-space lowering: infinite cutting tools for boolean trees.

§The polarity inversion that silently cuts the wrong half

IFC and the neutral kernel disagree about what the boundary flag means.

  • IfcHalfSpaceSolid.AgreementFlag = .T. means the material lies on the side the base surface normal points away from.
  • axiolid_primitive::HalfSpace.agreement = true selects the normal side.

They are opposites. Transcribing the flag straight through produces a clipping tool that keeps exactly the half it should have removed. Nothing errors: the boolean still evaluates, the mesh is still watertight, and the wall simply has the wrong end missing. flip below is the whole fix, and the reason it is a named constant rather than an inline !.

§Why a half space is never a root

A half space has infinite volume. It is meaningful only as a boolean operand, and the dispatcher reaches this module only through lower_boolean_result_node. Lowering one as a representation item’s root would hand a consumer a solid it cannot bound, tessellate, or measure.

§Bounded subtypes

IfcBoxedHalfSpace.Enclosure is a search box only; the IFC specification explicitly says it does not alter the Boolean result, so dropping that computational hint preserves geometry exactly. IfcPolygonalBoundedHalfSpace is different: its positioned boundary limits the cutting volume, so it lowers to a bounded node carrying Position and the boundary (see boundary), never widened to an infinite half-space.

§The prism axis (#515)

IFC bounds the half space by the boundary’s infinite prism along Position’s Z axis, in both directions, whatever the plane’s slope: a sloped roof plane over a vertical prism is the usual gable-wall clip. That is exactly Axiolid’s SolidOperation::BoundedHalfSpaceAlongZ (axiolid-model 0.3.14, axiolid/kernel#321): the kept side of the plane within the lines through the boundary’s region parallel to the placement’s Z, the boundary point (u, v) at placement * (u, v, 0) with the frame read whole (its scale, shear and handedness), only the direction of Z counting. Every IfcPolygonalBoundedHalfSpace lowers to that one node, Position carried as written, so there is one path and nothing here decides an orientation, mirrors a footprint or splits a prism. Up to ifc-geometry 0.27.2 the clip lowered to BoundedHalfSpace, whose prism runs along the plane NORMAL: a plane against Position’s Z was read from its other side, and an oblique or rescaled prism lowered to a chain of half spaces for a convex polygon and was refused otherwise.

BoundedHalfSpace is not emitted for the aligned case either, though it is the same set there and keeps such graphs on wire format 1.3: both of Axiolid’s compilers compile the new node for every frame (the exact one certifies it), so a second, frame-dependent lowering would only buy an older wire label at the cost of the case analysis this module dropped.

What the kernel refuses of the node it refuses by name when compiled, never here: a Z lying in the plane (the prism never crosses it), a degenerate placement, the node as a root or a union’s operand (it is unbounded on its kept side), and in the exact compiler an arc boundary under an uneven scale (its wall is an elliptic cylinder, which the mesh compiler cuts). An IFC Position is orthonormal, so the frame is scaled, sheared or mirrored only by a mapped item’s operator, whose scaled instance the exact compiler does not take in any case.

§The depth (#519)

The node carries no depth: it is the half space cut by an infinite prism, and the compilers bound it by the subject they cut (axiolid-mesh-compile 0.3.27, axiolid/kernel#325). Nothing in this bridge sizes the cut (ADR 0004).

Functions§

lower_half_space_node
Lower an IfcHalfSpaceSolid (or the geometry-equivalent boxed subtype).