Skip to main content

Module brep

Module brep 

Source
Expand description

Faceted B-rep lowering into exact topology.

§Why topology and not a mesh

An IfcFacetedBrep is a solid with planar faces, not a render mesh. It carries face adjacency, bound nesting (holes), and void shells. Flattening it to triangles at read time destroys exactly the information a boolean or a volume query needs, and triangulation is a kernel decision. So this builds BRep<NodeId> and leaves tessellation to the axiolid-tessellation-contract operation boundary.

§Sharing is the whole problem

In shared_point_faceted_brep.ifc, 12 solids and 2028 faces are built from ONE pool of 196 IfcCartesianPoint records. Every point is reused by several faces, and every interior edge is shared by exactly two. Emitting one vertex per polygon slot would produce 8112 vertices where 196 exist, and no edge would ever be shared – which silently turns a closed solid into a pile of disconnected facets. Interning by EntityId (vertices) and by unordered endpoint pair (edges) is what preserves the manifold.

Functions§

lower_face_surface_node
Lower one IfcFaceSurface or IfcAdvancedFace as a single-face open BRep.
lower_faceted_brep_node
Lower one IfcFacetedBrep (or WithVoids) into a BRep node.
lower_shell_node
Lower one shell or connected face set as a standalone BRep node.