Skip to content

aephysics.hull: quickhull and the half-edge hull - #2

Merged
nicolas-maman merged 1 commit into
mainfrom
feat/hull
Sep 19, 2026
Merged

nicolas-maman merged 1 commit into
mainfrom
feat/hull

Conversation

@nicolas-maman

Copy link
Copy Markdown
Contributor

The fourth layer: Box3D's hull.c in Aether, as aephysics.hull.

  • Quickhull with per-face conflict lists and cached farthest points, the iterative horizon walk, the cone from the apex, merging of flipped / concave / coplanar cone faces, and the packing into one block with the arrays at byte offsets. The builder's pointers are indices into its pools; the intrusive lists are chained through prev/next with their sentinels in extra slots.
  • Cylinder, cone, rock; clone and clone-and-transform (winding reversed under a mirroring scale); the analytic box hull and scale_box; support vertex/face; mass, bounds, ray cast, extent, projected area; the 2D monotone-chain hull with weld and simplification.
  • math: plane helpers, rotate_inertia, max_element_index, aabb_add_point, LINEAR_SLOP. core: lsr32.
  • test_hull.ae: the reference's test_hull.c, 438 checks at its tolerances (cube, tetrahedron, determinism, vertex cap, redundant input, clone, cylinder, sphere reduction, 512-point sphere stress at three caps, 4,096-point merge churn, degenerate input, transformed box geometry, 2D square / collinear / weld / order / simplify).
  • bench/hull.ae vs bench/hull_box3d.c: the same hulls come out (6,554 vertices, 12,106 faces on both); 1.6–2× the reference's time for the builder (doubles, indices, by-value structs), the box hull a heap block where theirs is a stack value. Load-time cost; recorded, not chased.

Differences from the reference: int half-edge indices (no byte type), no SOA mirrors (the wide support function goes native later), the box hull is destroyed like any hull, the hash is this engine's own. overlap_hull, shape_cast_hull and the mover collision wait for the distance (GJK) layer.

Box3D's hull.c in Aether: the quickhull builder with per-face conflict
lists and cached farthest points, the iterative horizon walk, the cone
from the apex, the merging of flipped, concave and coplanar cone faces,
and the packing into one block with the arrays at offsets. The builder's
pointers are indices into its pools, with the intrusive lists chained
through prev/next and their sentinels in extra slots. Half-edge indices
are ints; the SOA mirrors for the SIMD support function are not kept;
the box hull is a heap block destroyed like any hull; the hash is this
engine's own.

Also: the tessellated cylinder, cone and rock, clone and
clone-and-transform (with the winding reversed under a mirroring
scale), the analytic box hull with scale_box, support vertex and face,
mass, bounds, the ray cast against the planes, extent, projected area,
and the 2D hull (monotone chain) with weld and simplification.

math gains the plane helpers, rotate_inertia, max_element_index,
aabb_add_point and LINEAR_SLOP; core gains lsr32.

test_hull.ae carries test_hull.c: 438 checks at the reference's
tolerances, including the 512-point sphere stress at three caps and the
4,096-point merge churn. bench/hull.ae against bench/hull_box3d.c: the
same hulls (6,554 vertices, 12,106 faces) at 1.6-2x the reference's
time, recorded in bench/RESULTS.md.
@nicolas-maman
nicolas-maman merged commit 1db18d5 into main Sep 19, 2026
1 check passed
@nicolas-maman
nicolas-maman deleted the feat/hull branch September 19, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant