- Implement robust surface area and volume computation for polymesh_t
- Support arbitrary polygonal faces (triangles, quads, etc.) via fan triangulation
- Add vector math utilities: cross, dot, norm, and signed volume
- Validate algorithm correctness using unit cube test case
- Ensure right-hand rule compliance for accurate volume sign
Test: Added test case with unit cube (8 vertices, 6 quads)
Expected: area = 6.0, volume = 1.0 → actual results match
- Simplified and unified constructors for `integrator_t` to improve usability and maintainability.
- Enhanced `find_v_intersections_at_u` with robust handling of vertical edges and improved numerical stability.
- Refactored `is_point_inside_domain` to reuse existing intersection logic, eliminating code duplication.
- Adjusted interface to align with revised expectations around `parametric_plane_t`, which previously caused inconsistencies.
- Extended design to support multi-face integration (previously limited to single face); volume-related logic temporarily commented out for clarity.
This version is compilable, but not yet runnable due to nullptr issues in primitive_process during object creation. Integration framework is now structurally ready for multi-surface extension once initialization is fixed.
Instead of relying on object identity or raw transform parameters, the hasher
now uses intrinsic geometric properties to determine cylinder equivalence.
The hash is computed from:
- G = R^T * R : encodes the cylinder's cross-sectional metric and axis direction
- v = R * d : encodes the axial offset in the radial plane
where R is the top-left 2x3 submatrix of the world_to_local linear part,
and d is its translation vector. This ensures that two cylinder faces
with the same shape, orientation, and central axis (even if parameterized
differently) produce the same hash.
Note: Cylinder's side surface defines its AABB, and z-axis scaling does not affect its radius.
Degeneracy checks only consider x/y directions (first two rows of the transform matrix), since z scaling does not change the essential geometry.
TODO: Consider redefining cylinder so the identity transform is always the first subface.