Skip to main content

Module zone_split

Module zone_split 

Source
Expand description

Cut one element into one closed solid per location zone (#2508 item 2), on top of the exact kernel rather than beside it. Cut one element into one solid per location zone (issue #2508 item 2).

#2515 answers “how much of this wall is in Takt A” with a number, by integrating the zone’s indicator function over the element’s own boundary. That is the right tool for a quantity and it produces no geometry at all: there is nothing to look at, select, or export as a per-section model. This module produces the geometry, on the explicit request of a user who asked for it.

§Why this is a kernel call and not new geometry code

Clipping a solid to a convex box is an INTERSECTION against a convex operand, which is strictly easier than the general difference the exact kernel already runs on every opening void of every model. So each piece is one boolean(host, box, Intersection), and the remainder is one difference_all against every box at once. Nothing here re-derives cutting, capping or classification.

§Two decisions worth stating

  • One arrangement per piece, N+1 in total, not N composed operations. Composing (cut by A, then cut the rest by B, …) feeds each step the PREVIOUS step’s output, so every cut re-snaps and re-jitters seams the last one made. Each piece instead arranges the ORIGINAL host against one box, and the remainder arranges the original host against all the boxes together.
  • f64 from end to end. Operands stay Tri (f64) for the whole split and only reach Mesh (f32) at the caller’s boundary. A per-piece f64 -> f32 -> f64 round trip is what turns a shared zone boundary into a crack.

Structs§

ZoneBox
A zone as the viewer authors it: an oriented box that rotates about the VERTICAL axis only. Coordinates are the caller’s frame; the viewer passes its Y-up render frame, and nothing here assumes which axis is up except rotation_axis.
ZonePiece
One solid produced by the split.
ZoneSplit
The whole split of one element.

Enums§

ZoneShape
What a zone actually is: v1’s oriented box, or the convex prism #2508 item 4 adds. Both are convex, which is what keeps each piece one intersection.

Constants§

NEGLIGIBLE_PIECE_REL
A piece whose volume is below this fraction of the whole is dropped.

Functions§

split_mesh_by_zones
Split host into one solid per zone it reaches, plus the remainder.