@woosh/meep-engine 2.131.48 → 2.132.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/core/bvh2/bvh3/ebvh_optimize_treelet.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +4 -3
- package/src/core/codegen/LineBuilder.js +3 -3
- package/src/core/collection/heap/Uint32Heap.d.ts +14 -0
- package/src/core/collection/heap/Uint32Heap.d.ts.map +1 -1
- package/src/core/collection/heap/Uint32Heap.js +18 -0
- package/src/core/collection/map/HashMap.d.ts.map +1 -1
- package/src/core/collection/map/HashMap.js +4 -22
- package/src/core/collection/map/generate_next_linear_congruential_index.d.ts +15 -0
- package/src/core/collection/map/generate_next_linear_congruential_index.d.ts.map +1 -0
- package/src/core/collection/map/generate_next_linear_congruential_index.js +18 -0
- package/src/core/geom/3d/aabb/AABB3.js +1 -1
- package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.js +10 -26
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_point_t.d.ts +19 -0
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_point_t.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_point_t.js +48 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance.d.ts +15 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance.js +24 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts +17 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.js +95 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_sqr.d.ts +16 -0
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_sqr.d.ts.map +1 -0
- package/src/core/geom/3d/line/{line3_computeSegmentPointDistance_sqr.js → line3_compute_segment_point_distance_sqr.js} +16 -3
- package/src/core/geom/3d/topology/struct/TopoMesh.d.ts +4 -0
- package/src/core/geom/3d/topology/struct/TopoMesh.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoMesh.js +4 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +18 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +56 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +46 -16
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +85 -15
- package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_add.d.ts +9 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_add.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_add.js +43 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.d.ts +4 -3
- package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.js +38 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_loop_kill.d.ts +8 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_loop_kill.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_loop_kill.js +36 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_cleanup_faceless_references.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_cleanup_faceless_references.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_cleanup_faceless_references.js +62 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +145 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple_islands.d.ts +12 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple_islands.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple_islands.js +111 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_island_erode.d.ts +15 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_island_erode.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_island_erode.js +290 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_from_indexed_geometry.d.ts +11 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_from_indexed_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{bt_index_geometry_to_topology.js → bt_mesh_from_indexed_geometry.js} +6 -7
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_from_unindexed_geometry.d.ts +8 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_from_unindexed_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_from_unindexed_geometry.js +31 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_triangulate.d.ts +7 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_triangulate.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_triangulate.js +22 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_radial_loop_add.d.ts +8 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_radial_loop_add.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_radial_loop_add.js +32 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_radial_loop_remove.d.ts +8 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_radial_loop_remove.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_radial_loop_remove.js +26 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{OrderedEdge.js → edge/OrderedEdge.js} +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{bt_edge_create.js → edge/bt_edge_create.js} +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{bt_edge_get_or_create.js → edge/bt_edge_get_or_create.js} +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{bt_edge_kill.js → edge/bt_edge_kill.js} +6 -3
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_split.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_split.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_split.js +180 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_kill_only_edge.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{bt_mesh_calc_edges.js → edge/bt_mesh_calc_edges.js} +10 -7
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_kill.d.ts +8 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_kill.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_kill.js +26 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_poke.d.ts +15 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_poke.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_poke.js +152 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.js +124 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_kill_only_face.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_kill_only_vert.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_verts_by_distance.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_verts_by_distance.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_verts_by_distance.js +165 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_kill.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/{bt_vert_kill.js → vertex/bt_vert_kill.js} +5 -2
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +125 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_has_vertex.d.ts +9 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_has_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/{bt_mesh_edge_has_vertex.js → bt_edge_has_vertex.js} +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/{bt_mesh_edge_other_vertex.d.ts → bt_edge_other_vertex.d.ts} +2 -2
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_other_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/{bt_mesh_edge_other_vertex.js → bt_edge_other_vertex.js} +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.d.ts +12 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.js +96 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_centroid.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_centroid.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_centroid.js +75 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_incenter.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_incenter.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_incenter.js +85 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.d.ts +12 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.js +74 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_is_degenerate.d.ts +9 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_is_degenerate.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_is_degenerate.js +78 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.d.ts +15 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.js +151 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_compute_edge_distance_eikonal.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_compute_edge_distance_eikonal.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_compute_edge_distance_eikonal.js +46 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_compute_face_islands.d.ts +9 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_compute_face_islands.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_compute_face_islands.js +78 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_vertex_distance_to_edge.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_vertex_distance_to_edge.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_vertex_distance_to_edge.js +48 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_vertex_distance_to_vertex.d.ts +9 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_vertex_distance_to_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_vertex_distance_to_vertex.js +31 -0
- package/src/core/geom/3d/topology/struct/prototypeBinaryTopology.js +2 -2
- package/src/core/geom/3d/triangle/triangle3_incenter.d.ts +19 -0
- package/src/core/geom/3d/triangle/triangle3_incenter.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/triangle3_incenter.js +60 -0
- package/src/core/math/hash/lowbias32.d.ts +9 -0
- package/src/core/math/hash/lowbias32.d.ts.map +1 -0
- package/src/core/math/hash/lowbias32.js +20 -0
- package/src/core/process/task/util/iteratorTask.d.ts +2 -2
- package/src/core/process/task/util/iteratorTask.d.ts.map +1 -1
- package/src/core/process/task/util/iteratorTask.js +3 -3
- package/src/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.js +4 -4
- package/src/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.js +4 -4
- package/src/engine/navigation/ecs/components/Path.js +3 -3
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts +4 -4
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +5 -4
- package/src/engine/navigation/mesh/NavigationMesh.d.ts +32 -0
- package/src/engine/navigation/mesh/NavigationMesh.d.ts.map +1 -0
- package/src/engine/navigation/mesh/NavigationMesh.js +190 -0
- package/src/engine/navigation/mesh/NavigationMeshAgent.d.ts +9 -0
- package/src/engine/navigation/mesh/NavigationMeshAgent.d.ts.map +1 -0
- package/src/engine/navigation/mesh/NavigationMeshAgent.js +11 -0
- package/src/engine/navigation/mesh/README.md +3 -0
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts +14 -0
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -0
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +203 -0
- package/src/engine/navigation/mesh/build/bvh_build_from_unindexed_triangles.d.ts +8 -0
- package/src/engine/navigation/mesh/build/bvh_build_from_unindexed_triangles.d.ts.map +1 -0
- package/src/engine/navigation/mesh/build/bvh_build_from_unindexed_triangles.js +46 -0
- package/src/engine/navigation/mesh/build/enforce_agent_height_clearance.d.ts +12 -0
- package/src/engine/navigation/mesh/build/enforce_agent_height_clearance.d.ts.map +1 -0
- package/src/engine/navigation/mesh/build/enforce_agent_height_clearance.js +204 -0
- package/src/engine/navigation/mesh/build/navmesh_build_topology.d.ts +14 -0
- package/src/engine/navigation/mesh/build/navmesh_build_topology.d.ts.map +1 -0
- package/src/engine/navigation/mesh/build/navmesh_build_topology.js +183 -0
- package/src/engine/navigation/mesh/bvh_build_from_bt_mesh.d.ts +7 -0
- package/src/engine/navigation/mesh/bvh_build_from_bt_mesh.d.ts.map +1 -0
- package/src/engine/navigation/mesh/bvh_build_from_bt_mesh.js +64 -0
- package/src/engine/navigation/mesh/funnel_string_pull.d.ts +15 -0
- package/src/engine/navigation/mesh/funnel_string_pull.d.ts.map +1 -0
- package/src/engine/navigation/mesh/funnel_string_pull.js +225 -0
- package/src/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.d.ts +0 -14
- package/src/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/OrderedEdge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_edge_create.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_edge_get_or_create.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_edge_kill.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_face_kill.d.ts +0 -7
- package/src/core/geom/3d/topology/struct/binary/io/bt_face_kill.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_face_kill.js +0 -8
- package/src/core/geom/3d/topology/struct/binary/io/bt_index_geometry_to_topology.d.ts +0 -11
- package/src/core/geom/3d/topology/struct/binary/io/bt_index_geometry_to_topology.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_edge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_face.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_vert.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.d.ts +0 -18
- package/src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.js +0 -83
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_calc_edges.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_vert_kill.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/get_or_create_edge_map.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_edge_has_vertex.d.ts +0 -9
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_edge_has_vertex.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_edge_other_vertex.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.d.ts +0 -10
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.js +0 -44
- package/src/engine/navigation/__module.d.ts +0 -2
- package/src/engine/navigation/__module.d.ts.map +0 -1
- package/src/engine/navigation/__module.js +0 -1
- /package/src/core/geom/3d/topology/struct/binary/io/{OrderedEdge.d.ts → edge/OrderedEdge.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_edge_create.d.ts → edge/bt_edge_create.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_edge_get_or_create.d.ts → edge/bt_edge_get_or_create.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_edge_kill.d.ts → edge/bt_edge_kill.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_kill_only_edge.d.ts → edge/bt_kill_only_edge.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_kill_only_edge.js → edge/bt_kill_only_edge.js} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_mesh_calc_edges.d.ts → edge/bt_mesh_calc_edges.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{get_or_create_edge_map.d.ts → edge/get_or_create_edge_map.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{get_or_create_edge_map.js → edge/get_or_create_edge_map.js} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_kill_only_face.d.ts → face/bt_kill_only_face.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_kill_only_face.js → face/bt_kill_only_face.js} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_kill_only_vert.d.ts → vertex/bt_kill_only_vert.d.ts} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_kill_only_vert.js → vertex/bt_kill_only_vert.js} +0 -0
- /package/src/core/geom/3d/topology/struct/binary/io/{bt_vert_kill.d.ts → vertex/bt_vert_kill.d.ts} +0 -0
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @param {number} vertex_id
|
|
8
8
|
* @returns {number}
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
11
|
-
//# sourceMappingURL=
|
|
10
|
+
export function bt_edge_other_vertex(mesh: BinaryTopology, edge_id: number, vertex_id: number): number;
|
|
11
|
+
//# sourceMappingURL=bt_edge_other_vertex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_edge_other_vertex.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_edge_other_vertex.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,oEAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAalB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param {number} vertex_id
|
|
8
8
|
* @returns {number}
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
10
|
+
export function bt_edge_other_vertex(mesh, edge_id, vertex_id) {
|
|
11
11
|
|
|
12
12
|
const v1 = mesh.edge_read_vertex1(edge_id);
|
|
13
13
|
const v2 = mesh.edge_read_vertex2(edge_id);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a face, get a list of its attached faces.
|
|
3
|
+
* Two faces are attached if they share a vertex.
|
|
4
|
+
* @param {number[]|Uint32Array} output
|
|
5
|
+
* @param {number} output_offset
|
|
6
|
+
* @param {BinaryTopology} mesh
|
|
7
|
+
* @param {number} face_id
|
|
8
|
+
* @returns {number} number of faces written to output
|
|
9
|
+
* @see bt_face_get_neighbour_faces
|
|
10
|
+
*/
|
|
11
|
+
export function bt_face_get_attached_faces(output: number[] | Uint32Array, output_offset: number, mesh: BinaryTopology, face_id: number): number;
|
|
12
|
+
//# sourceMappingURL=bt_face_get_attached_faces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_face_get_attached_faces.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,mDAPW,MAAM,EAAE,GAAC,WAAW,iBACpB,MAAM,iCAEN,MAAM,GACJ,MAAM,CAqFlB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { assert } from "../../../../../../assert.js";
|
|
2
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Given a face, get a list of its attached faces.
|
|
6
|
+
* Two faces are attached if they share a vertex.
|
|
7
|
+
* @param {number[]|Uint32Array} output
|
|
8
|
+
* @param {number} output_offset
|
|
9
|
+
* @param {BinaryTopology} mesh
|
|
10
|
+
* @param {number} face_id
|
|
11
|
+
* @returns {number} number of faces written to output
|
|
12
|
+
* @see bt_face_get_neighbour_faces
|
|
13
|
+
*/
|
|
14
|
+
export function bt_face_get_attached_faces(
|
|
15
|
+
output,
|
|
16
|
+
output_offset,
|
|
17
|
+
mesh,
|
|
18
|
+
face_id
|
|
19
|
+
) {
|
|
20
|
+
|
|
21
|
+
assert.isArrayLike(output, "output");
|
|
22
|
+
assert.isNonNegativeInteger(output_offset, "output_offset");
|
|
23
|
+
assert.isNonNegativeInteger(face_id, "face_id");
|
|
24
|
+
assert.defined(mesh, "mesh");
|
|
25
|
+
assert.notNull(mesh, "mesh");
|
|
26
|
+
assert.isObject(mesh, "mesh");
|
|
27
|
+
assert.equal(mesh.isBinaryTopology, true, "mesh.isBinaryTopology !== true");
|
|
28
|
+
|
|
29
|
+
let count = 0;
|
|
30
|
+
const first_loop = mesh.face_read_loop(face_id);
|
|
31
|
+
|
|
32
|
+
// Safety check for malformed faces
|
|
33
|
+
if (first_loop === NULL_POINTER) {
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let curr_loop = first_loop;
|
|
38
|
+
|
|
39
|
+
// 1. Iterate through every loop (vertex) of the given face
|
|
40
|
+
do {
|
|
41
|
+
const v = mesh.loop_read_vertex(curr_loop);
|
|
42
|
+
const first_edge = mesh.vertex_read_edge(v);
|
|
43
|
+
|
|
44
|
+
if (first_edge !== NULL_POINTER) {
|
|
45
|
+
let curr_edge = first_edge;
|
|
46
|
+
|
|
47
|
+
// 2. Iterate through the disk cycle (all edges connected to this vertex)
|
|
48
|
+
do {
|
|
49
|
+
const first_radial_loop = mesh.edge_read_loop(curr_edge);
|
|
50
|
+
|
|
51
|
+
if (first_radial_loop !== NULL_POINTER) {
|
|
52
|
+
let curr_radial_loop = first_radial_loop;
|
|
53
|
+
|
|
54
|
+
// 3. Iterate through the radial cycle (all faces sharing this edge)
|
|
55
|
+
do {
|
|
56
|
+
const adj_face = mesh.loop_read_face(curr_radial_loop);
|
|
57
|
+
|
|
58
|
+
// Ignore the original face and null pointers
|
|
59
|
+
if (adj_face !== face_id && adj_face !== NULL_POINTER) {
|
|
60
|
+
|
|
61
|
+
// Check for duplicates (linear scan is fastest for small n)
|
|
62
|
+
let is_duplicate = false;
|
|
63
|
+
for (let i = 0; i < count; i++) {
|
|
64
|
+
if (output[output_offset + i] === adj_face) {
|
|
65
|
+
is_duplicate = true;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Write to output if it's uniquely discovered
|
|
71
|
+
if (!is_duplicate) {
|
|
72
|
+
output[output_offset + count] = adj_face;
|
|
73
|
+
count++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
curr_radial_loop = mesh.loop_read_radial_next(curr_radial_loop);
|
|
78
|
+
} while (curr_radial_loop !== first_radial_loop && curr_radial_loop !== NULL_POINTER);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Move to the next edge in the vertex's disk cycle
|
|
82
|
+
if (mesh.edge_read_vertex1(curr_edge) === v) {
|
|
83
|
+
curr_edge = mesh.edge_read_v1_disk_next(curr_edge);
|
|
84
|
+
} else {
|
|
85
|
+
curr_edge = mesh.edge_read_v2_disk_next(curr_edge);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
} while (curr_edge !== first_edge && curr_edge !== NULL_POINTER);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Move to the next loop in the face
|
|
92
|
+
curr_loop = mesh.loop_read_next(curr_loop);
|
|
93
|
+
} while (curr_loop !== first_loop && curr_loop !== NULL_POINTER);
|
|
94
|
+
|
|
95
|
+
return count;
|
|
96
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a face, get the coordinates of its center.
|
|
3
|
+
* @param {number[]|Float32Array} output 3d vector
|
|
4
|
+
* @param {number} output_offset where to write
|
|
5
|
+
* @param {BinaryTopology} mesh
|
|
6
|
+
* @param {number} face_id
|
|
7
|
+
* @returns {boolean} true if centroid computed, false if something went wrong and no result could be produced
|
|
8
|
+
*/
|
|
9
|
+
export function bt_face_get_centroid(output: number[] | Float32Array, output_offset: number, mesh: BinaryTopology, face_id: number): boolean;
|
|
10
|
+
//# sourceMappingURL=bt_face_get_centroid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_face_get_centroid.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_face_get_centroid.js"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,6CANW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,iCAEN,MAAM,GACJ,OAAO,CA4DnB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { assert } from "../../../../../../assert.js";
|
|
2
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Temporary array to hold the coordinate data read from the vertex
|
|
6
|
+
*/
|
|
7
|
+
const scratch_coord = [0, 0, 0];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Given a face, get the coordinates of its center.
|
|
11
|
+
* @param {number[]|Float32Array} output 3d vector
|
|
12
|
+
* @param {number} output_offset where to write
|
|
13
|
+
* @param {BinaryTopology} mesh
|
|
14
|
+
* @param {number} face_id
|
|
15
|
+
* @returns {boolean} true if centroid computed, false if something went wrong and no result could be produced
|
|
16
|
+
*/
|
|
17
|
+
export function bt_face_get_centroid(
|
|
18
|
+
output,
|
|
19
|
+
output_offset,
|
|
20
|
+
mesh,
|
|
21
|
+
face_id
|
|
22
|
+
) {
|
|
23
|
+
assert.isNonNegativeInteger(output_offset, "output_offset");
|
|
24
|
+
assert.isNonNegativeInteger(face_id, "face_id");
|
|
25
|
+
|
|
26
|
+
// 1. Get the starting loop for the face
|
|
27
|
+
const first_loop_id = mesh.face_read_loop(face_id);
|
|
28
|
+
|
|
29
|
+
// Fallback/safety check in case the face is uninitialized or has no loops
|
|
30
|
+
if (first_loop_id === NULL_POINTER) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let current_loop_id = first_loop_id;
|
|
35
|
+
let vertex_count = 0;
|
|
36
|
+
|
|
37
|
+
let sum_x = 0;
|
|
38
|
+
let sum_y = 0;
|
|
39
|
+
let sum_z = 0;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// 2. Circulate through all loops making up the face
|
|
43
|
+
do {
|
|
44
|
+
// Read the vertex ID associated with this loop
|
|
45
|
+
const vertex_id = mesh.loop_read_vertex(current_loop_id);
|
|
46
|
+
|
|
47
|
+
// Read the actual 3D coordinates of that vertex into our temp array
|
|
48
|
+
mesh.vertex_read_coordinate(scratch_coord, 0, vertex_id);
|
|
49
|
+
|
|
50
|
+
// Accumulate the positions
|
|
51
|
+
sum_x += scratch_coord[0];
|
|
52
|
+
sum_y += scratch_coord[1];
|
|
53
|
+
sum_z += scratch_coord[2];
|
|
54
|
+
|
|
55
|
+
vertex_count++;
|
|
56
|
+
|
|
57
|
+
// Step to the next loop around the face boundary
|
|
58
|
+
current_loop_id = mesh.loop_read_next(current_loop_id);
|
|
59
|
+
|
|
60
|
+
} while (current_loop_id !== first_loop_id); // Stop when we complete the cycle
|
|
61
|
+
|
|
62
|
+
// 3. Divide by the number of vertices to get the average (centroid)
|
|
63
|
+
if (vertex_count > 0) {
|
|
64
|
+
|
|
65
|
+
output[output_offset] = sum_x / vertex_count;
|
|
66
|
+
output[output_offset + 1] = sum_y / vertex_count;
|
|
67
|
+
output[output_offset + 2] = sum_z / vertex_count;
|
|
68
|
+
|
|
69
|
+
return true;
|
|
70
|
+
} else {
|
|
71
|
+
// no vertices
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a face, gets the coordinates of its incenter (if a triangle) or centroid (if N-gon).
|
|
3
|
+
* @param {number[]|Float32Array} output 3d vector
|
|
4
|
+
* @param {number} output_offset where to write
|
|
5
|
+
* @param {BinaryTopology} mesh
|
|
6
|
+
* @param {number} face_id
|
|
7
|
+
* @returns {boolean} true if computed, false if something went wrong
|
|
8
|
+
*/
|
|
9
|
+
export function bt_face_get_incenter(output: number[] | Float32Array, output_offset: number, mesh: BinaryTopology, face_id: number): boolean;
|
|
10
|
+
//# sourceMappingURL=bt_face_get_incenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_face_get_incenter.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_face_get_incenter.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,6CANW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,iCAEN,MAAM,GACJ,OAAO,CAwEnB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { assert } from "../../../../../../assert.js";
|
|
2
|
+
import { triangle3_incenter } from "../../../../triangle/triangle3_incenter.js";
|
|
3
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
4
|
+
|
|
5
|
+
const scratch_coords = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Given a face, gets the coordinates of its incenter (if a triangle) or centroid (if N-gon).
|
|
9
|
+
* @param {number[]|Float32Array} output 3d vector
|
|
10
|
+
* @param {number} output_offset where to write
|
|
11
|
+
* @param {BinaryTopology} mesh
|
|
12
|
+
* @param {number} face_id
|
|
13
|
+
* @returns {boolean} true if computed, false if something went wrong
|
|
14
|
+
*/
|
|
15
|
+
export function bt_face_get_incenter(
|
|
16
|
+
output,
|
|
17
|
+
output_offset,
|
|
18
|
+
mesh,
|
|
19
|
+
face_id
|
|
20
|
+
) {
|
|
21
|
+
assert.isNonNegativeInteger(output_offset, "output_offset");
|
|
22
|
+
assert.isNonNegativeInteger(face_id, "face_id");
|
|
23
|
+
|
|
24
|
+
const first_loop_id = mesh.face_read_loop(face_id);
|
|
25
|
+
|
|
26
|
+
if (first_loop_id === NULL_POINTER) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let current_loop_id = first_loop_id;
|
|
31
|
+
let vertex_count = 0;
|
|
32
|
+
|
|
33
|
+
// 1. Traverse loops, attempting to collect exactly 3 vertices for a triangle
|
|
34
|
+
do {
|
|
35
|
+
if (vertex_count < 3) {
|
|
36
|
+
const vertex_id = mesh.loop_read_vertex(current_loop_id);
|
|
37
|
+
mesh.vertex_read_coordinate(scratch_coords, vertex_count * 3, vertex_id);
|
|
38
|
+
}
|
|
39
|
+
vertex_count++;
|
|
40
|
+
current_loop_id = mesh.loop_read_next(current_loop_id);
|
|
41
|
+
} while (current_loop_id !== first_loop_id);
|
|
42
|
+
|
|
43
|
+
// 2. Triangle Fast-Path: Compute exact Incenter
|
|
44
|
+
if (vertex_count === 3) {
|
|
45
|
+
const v0x = scratch_coords[0], v0y = scratch_coords[1], v0z = scratch_coords[2];
|
|
46
|
+
const v1x = scratch_coords[3], v1y = scratch_coords[4], v1z = scratch_coords[5];
|
|
47
|
+
const v2x = scratch_coords[6], v2y = scratch_coords[7], v2z = scratch_coords[8];
|
|
48
|
+
|
|
49
|
+
return triangle3_incenter(
|
|
50
|
+
output, output_offset,
|
|
51
|
+
v0x, v0y, v0z,
|
|
52
|
+
v1x, v1y, v1z,
|
|
53
|
+
v2x, v2y, v2z
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 3. Fallback Path: If N-gon (or degenerate), compute standard Centroid
|
|
58
|
+
let sum_x = 0;
|
|
59
|
+
let sum_y = 0;
|
|
60
|
+
let sum_z = 0;
|
|
61
|
+
|
|
62
|
+
current_loop_id = first_loop_id;
|
|
63
|
+
vertex_count = 0;
|
|
64
|
+
|
|
65
|
+
do {
|
|
66
|
+
const vertex_id = mesh.loop_read_vertex(current_loop_id);
|
|
67
|
+
mesh.vertex_read_coordinate(scratch_coord, 0, vertex_id);
|
|
68
|
+
|
|
69
|
+
sum_x += scratch_coord[0];
|
|
70
|
+
sum_y += scratch_coord[1];
|
|
71
|
+
sum_z += scratch_coord[2];
|
|
72
|
+
|
|
73
|
+
vertex_count++;
|
|
74
|
+
current_loop_id = mesh.loop_read_next(current_loop_id);
|
|
75
|
+
} while (current_loop_id !== first_loop_id);
|
|
76
|
+
|
|
77
|
+
if (vertex_count > 0) {
|
|
78
|
+
output[output_offset] = sum_x / vertex_count;
|
|
79
|
+
output[output_offset + 1] = sum_y / vertex_count;
|
|
80
|
+
output[output_offset + 2] = sum_z / vertex_count;
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a face, get a list of its neighbors.
|
|
3
|
+
* Two faces are neighbours if they share an edge.
|
|
4
|
+
* @param {number[]|Uint32Array} output
|
|
5
|
+
* @param {number} output_offset
|
|
6
|
+
* @param {BinaryTopology} mesh
|
|
7
|
+
* @param {number} face_id
|
|
8
|
+
* @returns {number} number of faces written to output
|
|
9
|
+
* @see bt_face_get_attached_faces
|
|
10
|
+
*/
|
|
11
|
+
export function bt_face_get_neighbour_faces(output: number[] | Uint32Array, output_offset: number, mesh: BinaryTopology, face_id: number): number;
|
|
12
|
+
//# sourceMappingURL=bt_face_get_neighbour_faces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_face_get_neighbour_faces.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,oDAPW,MAAM,EAAE,GAAC,WAAW,iBACpB,MAAM,iCAEN,MAAM,GACJ,MAAM,CA+DlB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { assert } from "../../../../../../assert.js";
|
|
2
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Given a face, get a list of its neighbors.
|
|
6
|
+
* Two faces are neighbours if they share an edge.
|
|
7
|
+
* @param {number[]|Uint32Array} output
|
|
8
|
+
* @param {number} output_offset
|
|
9
|
+
* @param {BinaryTopology} mesh
|
|
10
|
+
* @param {number} face_id
|
|
11
|
+
* @returns {number} number of faces written to output
|
|
12
|
+
* @see bt_face_get_attached_faces
|
|
13
|
+
*/
|
|
14
|
+
export function bt_face_get_neighbour_faces(
|
|
15
|
+
output,
|
|
16
|
+
output_offset,
|
|
17
|
+
mesh,
|
|
18
|
+
face_id
|
|
19
|
+
) {
|
|
20
|
+
assert.isArrayLike(output, "output");
|
|
21
|
+
assert.isNonNegativeInteger(output_offset, "output_offset");
|
|
22
|
+
assert.isNonNegativeInteger(face_id, "face_id");
|
|
23
|
+
assert.defined(mesh, "mesh");
|
|
24
|
+
assert.notNull(mesh, "mesh");
|
|
25
|
+
assert.isObject(mesh, "mesh");
|
|
26
|
+
assert.equal(mesh.isBinaryTopology, true, "mesh.isBinaryTopology !== true");
|
|
27
|
+
|
|
28
|
+
let count = 0;
|
|
29
|
+
const start_loop = mesh.face_read_loop(face_id);
|
|
30
|
+
|
|
31
|
+
// If the face has no loops (e.g., NULL_POINTER: 0xFFFFFFFF), it has no neighbors
|
|
32
|
+
if (start_loop === NULL_POINTER) {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let current_loop = start_loop;
|
|
37
|
+
|
|
38
|
+
do {
|
|
39
|
+
// Traverse the radial cycle around the edge to find adjacent faces
|
|
40
|
+
let radial_loop = mesh.loop_read_radial_next(current_loop);
|
|
41
|
+
|
|
42
|
+
while (radial_loop !== current_loop) {
|
|
43
|
+
const neighbor_face = mesh.loop_read_face(radial_loop);
|
|
44
|
+
|
|
45
|
+
// Ensure we aren't adding the original face itself
|
|
46
|
+
if (neighbor_face !== face_id) {
|
|
47
|
+
|
|
48
|
+
// Check if we've already added this face (prevents duplicates
|
|
49
|
+
// if two faces share more than one edge)
|
|
50
|
+
let is_duplicate = false;
|
|
51
|
+
|
|
52
|
+
for (let i = 0; i < count; i++) {
|
|
53
|
+
if (output[output_offset + i] === neighbor_face) {
|
|
54
|
+
is_duplicate = true;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!is_duplicate) {
|
|
60
|
+
output[output_offset + count] = neighbor_face;
|
|
61
|
+
count++;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
radial_loop = mesh.loop_read_radial_next(radial_loop);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Move to the next boundary loop of the original face
|
|
69
|
+
current_loop = mesh.loop_read_next(current_loop);
|
|
70
|
+
|
|
71
|
+
} while (current_loop !== start_loop);
|
|
72
|
+
|
|
73
|
+
return count;
|
|
74
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A degenerate face is one that has zero area.
|
|
3
|
+
*
|
|
4
|
+
* @param {BinaryTopology} mesh
|
|
5
|
+
* @param {number} face
|
|
6
|
+
* @returns {boolean}
|
|
7
|
+
*/
|
|
8
|
+
export function bt_face_is_degenerate(mesh: BinaryTopology, face: number): boolean;
|
|
9
|
+
//# sourceMappingURL=bt_face_is_degenerate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_face_is_degenerate.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_face_is_degenerate.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,kEAHW,MAAM,GACJ,OAAO,CAmEnB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
2
|
+
|
|
3
|
+
const scratch_coord = [0, 0, 0];
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A degenerate face is one that has zero area.
|
|
8
|
+
*
|
|
9
|
+
* @param {BinaryTopology} mesh
|
|
10
|
+
* @param {number} face
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
export function bt_face_is_degenerate(mesh, face) {
|
|
14
|
+
const first_loop = mesh.face_read_loop(face);
|
|
15
|
+
|
|
16
|
+
// A face with no loops is topologically degenerate
|
|
17
|
+
if (first_loop === NULL_POINTER) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let current_loop = first_loop;
|
|
22
|
+
let loop_count = 0;
|
|
23
|
+
|
|
24
|
+
// Components for the Newell's method normal vector
|
|
25
|
+
let nx = 0.0;
|
|
26
|
+
let ny = 0.0;
|
|
27
|
+
let nz = 0.0;
|
|
28
|
+
|
|
29
|
+
// Read the starting vertex
|
|
30
|
+
const first_vertex = mesh.loop_read_vertex(current_loop);
|
|
31
|
+
mesh.vertex_read_coordinate(scratch_coord, 0, first_vertex);
|
|
32
|
+
|
|
33
|
+
// to avoid magnitude issue issues in Newell's method, we shift all vertices to a common local reference
|
|
34
|
+
|
|
35
|
+
const reference_x = scratch_coord[0];
|
|
36
|
+
const reference_y = scratch_coord[1];
|
|
37
|
+
const reference_z = scratch_coord[2];
|
|
38
|
+
|
|
39
|
+
let current_x = 0;
|
|
40
|
+
let current_y = 0;
|
|
41
|
+
let current_z = 0;
|
|
42
|
+
|
|
43
|
+
do {
|
|
44
|
+
const next_loop = mesh.loop_read_next(current_loop);
|
|
45
|
+
const next_vertex = mesh.loop_read_vertex(next_loop);
|
|
46
|
+
|
|
47
|
+
// Read the next vertex in the cycle
|
|
48
|
+
mesh.vertex_read_coordinate(scratch_coord, 0, next_vertex);
|
|
49
|
+
|
|
50
|
+
const next_x = scratch_coord[0] - reference_x;
|
|
51
|
+
const next_y = scratch_coord[1] - reference_y;
|
|
52
|
+
const next_z = scratch_coord[2] - reference_z;
|
|
53
|
+
|
|
54
|
+
// Newell's method cross-product accumulations
|
|
55
|
+
nx += (current_y - next_y) * (current_z + next_z);
|
|
56
|
+
ny += (current_z - next_z) * (current_x + next_x);
|
|
57
|
+
nz += (current_x - next_x) * (current_y + next_y);
|
|
58
|
+
|
|
59
|
+
// Shift next to current for the next iteration
|
|
60
|
+
current_x = next_x;
|
|
61
|
+
current_y = next_y;
|
|
62
|
+
current_z = next_z;
|
|
63
|
+
|
|
64
|
+
current_loop = next_loop;
|
|
65
|
+
loop_count++;
|
|
66
|
+
} while (current_loop !== first_loop);
|
|
67
|
+
|
|
68
|
+
// A face with fewer than 3 vertices cannot have an area
|
|
69
|
+
if (loop_count < 3) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// The length of the Newell vector is twice the area of the polygon.
|
|
74
|
+
// We can just check the squared length against a small epsilon.
|
|
75
|
+
const area_squared = (nx * nx) + (ny * ny) + (nz * nz);
|
|
76
|
+
|
|
77
|
+
return area_squared <= 1e-17;
|
|
78
|
+
}
|
package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build distance field for a given island (group of faces).
|
|
3
|
+
* Distances are calculated as shortest from the boundary.
|
|
4
|
+
*
|
|
5
|
+
* Distances are the shortest distances from the boundary along the mesh.
|
|
6
|
+
* Only the island vertices are considered.
|
|
7
|
+
*
|
|
8
|
+
* Unreachable vertices are marked with Infinity distance.
|
|
9
|
+
* @param {Map<number, number>} vertex_boundary_distances Mapping from vertex ID to distance from boundary. The result is stored here.
|
|
10
|
+
* @param {BinaryTopology} mesh
|
|
11
|
+
* @param {Set<number>} island_vertices
|
|
12
|
+
* @param {Set<number>} boundary_vertices Subset of island_vertices that are on the boundary.
|
|
13
|
+
*/
|
|
14
|
+
export function bt_mesh_build_boundary_distance_field(vertex_boundary_distances: Map<number, number>, mesh: BinaryTopology, island_vertices: Set<number>, boundary_vertices: Set<number>): void;
|
|
15
|
+
//# sourceMappingURL=bt_mesh_build_boundary_distance_field.d.ts.map
|
package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_mesh_build_boundary_distance_field.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_distance_field.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,iFALW,IAAI,MAAM,EAAE,MAAM,CAAC,yCAEnB,IAAI,MAAM,CAAC,qBACX,IAAI,MAAM,CAAC,QAuIrB"}
|