Skip to main content Module sort Copy item path Source compact_props Removes unreferenced property vertices and reindexes propVerts. gather_faces Reorders halfedges (and related arrays) according to face_new2old permutation. get_face_box_morton Computes per-face bounding boxes and Morton codes.
Faces with removed halfedges (pairedHalfedge < 0) get K_NO_CODE. morton_code Compute a 30-bit Morton code for a position within the given bounding box.
Returns K_NO_CODE for NaN positions (unreferenced vertices). reindex_verts Updates halfedge start/end vert indices from old→new index mapping.
vert_new2old[new] = old — we invert to get vert_old2new[old] = new. sort_faces Sorts faces by Morton code, removing faces flagged for removal (K_NO_CODE).
Updates face_box and face_morton in-place. sort_geometry Sorts vertices and faces by Morton code, removes flagged-for-deletion
elements, and compacts property arrays. Should be called after
create_halfedges() to finalize the mesh topology. sort_verts Sorts vertices by their Morton code and removes NaN-flagged vertices.
Updates all halfedge vertex references accordingly.