@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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @see https://github.com/blender/blender/blob/master/source/blender/blenlib/intern/BLI_mempool.c
|
|
3
|
+
* @implements {Iterable<number>}
|
|
3
4
|
*/
|
|
4
|
-
export class BinaryElementPool {
|
|
5
|
+
export class BinaryElementPool implements Iterable<number> {
|
|
5
6
|
/**
|
|
6
7
|
*
|
|
7
8
|
* @param {number} item_size in bytes
|
|
@@ -165,5 +166,21 @@ export class BinaryElementPool {
|
|
|
165
166
|
* Note that initial allocation pointer is set to 0
|
|
166
167
|
*/
|
|
167
168
|
clear(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Copy data from another pool
|
|
171
|
+
* @param {BinaryElementPool} other
|
|
172
|
+
*/
|
|
173
|
+
copy(other: BinaryElementPool): void;
|
|
174
|
+
/**
|
|
175
|
+
* Used for type checking
|
|
176
|
+
* @readonly
|
|
177
|
+
* @type {boolean}
|
|
178
|
+
*/
|
|
179
|
+
readonly isBinaryElementPool: boolean;
|
|
180
|
+
/**
|
|
181
|
+
*
|
|
182
|
+
* @return {Generator<number>}
|
|
183
|
+
*/
|
|
184
|
+
[Symbol.iterator](): Generator<number>;
|
|
168
185
|
}
|
|
169
186
|
//# sourceMappingURL=BinaryElementPool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryElementPool.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryElementPool.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BinaryElementPool.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryElementPool.js"],"names":[],"mappings":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
|
|
2
2
|
import { align_4 } from "../../../../../binary/align_4.js";
|
|
3
3
|
import { makeArrayBuffer } from "../../../../../binary/makeArrayBuffer.js";
|
|
4
|
+
import { array_buffer_copy } from "../../../../../collection/array/typed/array_buffer_copy.js";
|
|
4
5
|
import { typed_array_copy } from "../../../../../collection/array/typed/typed_array_copy.js";
|
|
5
6
|
import { max3 } from "../../../../../math/max3.js";
|
|
6
7
|
|
|
@@ -25,6 +26,7 @@ const CAPACITY_GROW_MIN_STEP = 32;
|
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* @see https://github.com/blender/blender/blob/master/source/blender/blenlib/intern/BLI_mempool.c
|
|
29
|
+
* @implements {Iterable<number>}
|
|
28
30
|
*/
|
|
29
31
|
export class BinaryElementPool {
|
|
30
32
|
|
|
@@ -368,4 +370,58 @@ export class BinaryElementPool {
|
|
|
368
370
|
this.__size = 0;
|
|
369
371
|
this.__free_pointer = 0;
|
|
370
372
|
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Copy data from another pool
|
|
376
|
+
* @param {BinaryElementPool} other
|
|
377
|
+
*/
|
|
378
|
+
copy(other) {
|
|
379
|
+
assert.defined(other, 'other');
|
|
380
|
+
assert.notNull(other, 'other');
|
|
381
|
+
assert.isObject(other, 'other');
|
|
382
|
+
assert.equal(other.isBinaryElementPool, true, 'other.isBinaryElementPool !== true');
|
|
383
|
+
|
|
384
|
+
this.__size = other.size;
|
|
385
|
+
this.__item_size = other.item_size;
|
|
386
|
+
|
|
387
|
+
const other_data_size = other.size * this.item_size;
|
|
388
|
+
|
|
389
|
+
const this_data = this.__data_buffer;
|
|
390
|
+
const other_data = other.__data_buffer;
|
|
391
|
+
|
|
392
|
+
if (this_data.byteLength < other_data_size) {
|
|
393
|
+
// pool is too small, re-allocate with a fast copy
|
|
394
|
+
this.fromArrayBuffer(other_data.slice(0), this.__size);
|
|
395
|
+
} else {
|
|
396
|
+
// pool is big enough, copy the data
|
|
397
|
+
array_buffer_copy(other_data, 0, this_data, 0, other_data_size);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
this.__free_pointer = other.__free_pointer;
|
|
401
|
+
this.__free = other.__free.slice();
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
*
|
|
406
|
+
* @return {Generator<number>}
|
|
407
|
+
*/
|
|
408
|
+
* [Symbol.iterator]() {
|
|
409
|
+
|
|
410
|
+
for (let i = 0; i < this.__size; i++) {
|
|
411
|
+
|
|
412
|
+
if (this.is_allocated(i) === false) {
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
yield i;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
}
|
|
371
420
|
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Used for type checking
|
|
424
|
+
* @readonly
|
|
425
|
+
* @type {boolean}
|
|
426
|
+
*/
|
|
427
|
+
BinaryElementPool.prototype.isBinaryElementPool = true;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export const NULL_POINTER: number;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* A high-performance memory-efficient, binary-backed topological data structure for representing 3D meshes.
|
|
8
|
+
* Manages interconnected vertices, edges, loops, and faces using contiguous memory pools.
|
|
9
9
|
*/
|
|
10
10
|
export class BinaryTopology {
|
|
11
11
|
/**
|
|
@@ -56,6 +56,10 @@ export class BinaryTopology {
|
|
|
56
56
|
* @return {number}
|
|
57
57
|
*/
|
|
58
58
|
get byteSize(): number;
|
|
59
|
+
/**
|
|
60
|
+
* Releases excess memory held by internal pools.
|
|
61
|
+
* Useful for serialization use cases.
|
|
62
|
+
*/
|
|
59
63
|
trim(): void;
|
|
60
64
|
/**
|
|
61
65
|
*
|
|
@@ -72,6 +76,10 @@ export class BinaryTopology {
|
|
|
72
76
|
* @return {BinaryElementPool}
|
|
73
77
|
*/
|
|
74
78
|
get loops(): BinaryElementPool;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @returns {BinaryElementPool}
|
|
82
|
+
*/
|
|
75
83
|
get faces(): BinaryElementPool;
|
|
76
84
|
/**
|
|
77
85
|
* Clear the topology, removed all data
|
|
@@ -87,10 +95,10 @@ export class BinaryTopology {
|
|
|
87
95
|
/**
|
|
88
96
|
*
|
|
89
97
|
* @param {number} id
|
|
90
|
-
* @param {number[]} value
|
|
98
|
+
* @param {number[]|Float32Array} value
|
|
91
99
|
* @param {number} value_offset
|
|
92
100
|
*/
|
|
93
|
-
vertex_write_coordinate(id: number, value: number[], value_offset: number): void;
|
|
101
|
+
vertex_write_coordinate(id: number, value: number[] | Float32Array, value_offset: number): void;
|
|
94
102
|
/**
|
|
95
103
|
*
|
|
96
104
|
* @param {number[]|ArrayLike<number>|Float32Array} result
|
|
@@ -101,10 +109,10 @@ export class BinaryTopology {
|
|
|
101
109
|
/**
|
|
102
110
|
*
|
|
103
111
|
* @param {number} id
|
|
104
|
-
* @param {number[]} value
|
|
112
|
+
* @param {number[]|Float32Array} value
|
|
105
113
|
* @param {number} value_offset
|
|
106
114
|
*/
|
|
107
|
-
vertex_write_normal(id: number, value: number[], value_offset: number): void;
|
|
115
|
+
vertex_write_normal(id: number, value: number[] | Float32Array, value_offset: number): void;
|
|
108
116
|
/**
|
|
109
117
|
* @param {number} id
|
|
110
118
|
* @returns {number}
|
|
@@ -145,51 +153,51 @@ export class BinaryTopology {
|
|
|
145
153
|
edge_read_loop(id: number): number;
|
|
146
154
|
/**
|
|
147
155
|
*
|
|
148
|
-
* @param {number}
|
|
156
|
+
* @param {number} loop_id loop ID
|
|
149
157
|
* @param {number} id edge ID
|
|
150
158
|
*/
|
|
151
|
-
edge_write_loop(id: number,
|
|
159
|
+
edge_write_loop(id: number, loop_id: number): void;
|
|
152
160
|
/**
|
|
153
161
|
* @param {number} id edge ID
|
|
154
|
-
* @returns {number}
|
|
162
|
+
* @returns {number} edge ID
|
|
155
163
|
*/
|
|
156
164
|
edge_read_v1_disk_next(id: number): number;
|
|
157
165
|
/**
|
|
158
166
|
*
|
|
159
|
-
* @param {number} value
|
|
167
|
+
* @param {number} value edge ID
|
|
160
168
|
* @param {number} id edge ID
|
|
161
169
|
*/
|
|
162
170
|
edge_write_v1_disk_next(id: number, value: number): void;
|
|
163
171
|
/**
|
|
164
172
|
* @param {number} id edge ID
|
|
165
|
-
* @returns {number}
|
|
173
|
+
* @returns {number} edge ID
|
|
166
174
|
*/
|
|
167
175
|
edge_read_v1_disk_prev(id: number): number;
|
|
168
176
|
/**
|
|
169
177
|
*
|
|
170
|
-
* @param {number} value
|
|
178
|
+
* @param {number} value edge ID
|
|
171
179
|
* @param {number} id edge ID
|
|
172
180
|
*/
|
|
173
181
|
edge_write_v1_disk_prev(id: number, value: number): void;
|
|
174
182
|
/**
|
|
175
183
|
* @param {number} id edge ID
|
|
176
|
-
* @returns {number}
|
|
184
|
+
* @returns {number} edge ID
|
|
177
185
|
*/
|
|
178
186
|
edge_read_v2_disk_next(id: number): number;
|
|
179
187
|
/**
|
|
180
188
|
*
|
|
181
|
-
* @param {number} value
|
|
189
|
+
* @param {number} value edge ID
|
|
182
190
|
* @param {number} id edge ID
|
|
183
191
|
*/
|
|
184
192
|
edge_write_v2_disk_next(id: number, value: number): void;
|
|
185
193
|
/**
|
|
186
194
|
* @param {number} id edge ID
|
|
187
|
-
* @returns {number}
|
|
195
|
+
* @returns {number} edge ID
|
|
188
196
|
*/
|
|
189
197
|
edge_read_v2_disk_prev(id: number): number;
|
|
190
198
|
/**
|
|
191
199
|
*
|
|
192
|
-
* @param {number} value
|
|
200
|
+
* @param {number} value edge ID
|
|
193
201
|
* @param {number} id edge ID
|
|
194
202
|
*/
|
|
195
203
|
edge_write_v2_disk_prev(id: number, value: number): void;
|
|
@@ -294,6 +302,28 @@ export class BinaryTopology {
|
|
|
294
302
|
* @param {number} id face ID
|
|
295
303
|
*/
|
|
296
304
|
face_write_loop(id: number, value: number): void;
|
|
305
|
+
/**
|
|
306
|
+
* @param {number[]|ArrayLike<number>|Float32Array} result
|
|
307
|
+
* @param {number} result_offset
|
|
308
|
+
* @param {number} id face ID
|
|
309
|
+
*/
|
|
310
|
+
face_read_normal(result: number[] | ArrayLike<number> | Float32Array, result_offset: number, id: number): void;
|
|
311
|
+
/**
|
|
312
|
+
* @param {number} id face ID
|
|
313
|
+
* @param {number[]|Float32Array} value
|
|
314
|
+
* @param {number} value_offset
|
|
315
|
+
*/
|
|
316
|
+
face_write_normal(id: number, value: number[] | Float32Array, value_offset: number): void;
|
|
317
|
+
/**
|
|
318
|
+
* Copy data from another mesh.
|
|
319
|
+
* @param {BinaryTopology} other
|
|
320
|
+
*/
|
|
321
|
+
copy(other: BinaryTopology): void;
|
|
322
|
+
/**
|
|
323
|
+
*
|
|
324
|
+
* @returns {BinaryTopology}
|
|
325
|
+
*/
|
|
326
|
+
clone(): BinaryTopology;
|
|
297
327
|
/**
|
|
298
328
|
* Useful for type checking
|
|
299
329
|
* @readonly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryTopology.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryTopology.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,2BAFU,MAAM,CAEuB;
|
|
1
|
+
{"version":3,"file":"BinaryTopology.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryTopology.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,2BAFU,MAAM,CAEuB;AAQvC;;;GAGG;AACH;IACI;;;;;;;;OAQG;IACH,sBAA4F;IAE5F;;;;;;;;;OASG;IACH,oBAAsD;IAEtD;;;;;;;;;;;;OAYG;IACH,oBAAsD;IAEtD;;;;;;OAMG;IACH,oBAAsE;IAGtE;;;OAGG;IACH,uBAMC;IAED;;;OAGG;IACH,aAKC;IAED;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IAC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,15 @@ const UINT_32_SIZE = 4;
|
|
|
22
22
|
*/
|
|
23
23
|
export const NULL_POINTER = 0xFFFFFFFF;
|
|
24
24
|
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
Heavily influenced by blender's internal mesh structure.
|
|
28
|
+
@see https://github.com/blender/blender/blob/master/source/blender/bmesh/bmesh_class.h
|
|
29
|
+
*/
|
|
30
|
+
|
|
25
31
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
32
|
+
* A high-performance memory-efficient, binary-backed topological data structure for representing 3D meshes.
|
|
33
|
+
* Manages interconnected vertices, edges, loops, and faces using contiguous memory pools.
|
|
28
34
|
*/
|
|
29
35
|
export class BinaryTopology {
|
|
30
36
|
/**
|
|
@@ -87,6 +93,10 @@ export class BinaryTopology {
|
|
|
87
93
|
;
|
|
88
94
|
}
|
|
89
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Releases excess memory held by internal pools.
|
|
98
|
+
* Useful for serialization use cases.
|
|
99
|
+
*/
|
|
90
100
|
trim() {
|
|
91
101
|
this.__loop_pool.trim();
|
|
92
102
|
this.__vertex_pool.trim();
|
|
@@ -118,6 +128,10 @@ export class BinaryTopology {
|
|
|
118
128
|
return this.__loop_pool;
|
|
119
129
|
}
|
|
120
130
|
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @returns {BinaryElementPool}
|
|
134
|
+
*/
|
|
121
135
|
get faces() {
|
|
122
136
|
return this.__face_pool;
|
|
123
137
|
}
|
|
@@ -150,7 +164,7 @@ export class BinaryTopology {
|
|
|
150
164
|
/**
|
|
151
165
|
*
|
|
152
166
|
* @param {number} id
|
|
153
|
-
* @param {number[]} value
|
|
167
|
+
* @param {number[]|Float32Array} value
|
|
154
168
|
* @param {number} value_offset
|
|
155
169
|
*/
|
|
156
170
|
vertex_write_coordinate(id, value, value_offset) {
|
|
@@ -178,7 +192,7 @@ export class BinaryTopology {
|
|
|
178
192
|
/**
|
|
179
193
|
*
|
|
180
194
|
* @param {number} id
|
|
181
|
-
* @param {number[]} value
|
|
195
|
+
* @param {number[]|Float32Array} value
|
|
182
196
|
* @param {number} value_offset
|
|
183
197
|
*/
|
|
184
198
|
vertex_write_normal(id, value, value_offset) {
|
|
@@ -279,19 +293,19 @@ export class BinaryTopology {
|
|
|
279
293
|
|
|
280
294
|
/**
|
|
281
295
|
*
|
|
282
|
-
* @param {number}
|
|
296
|
+
* @param {number} loop_id loop ID
|
|
283
297
|
* @param {number} id edge ID
|
|
284
298
|
*/
|
|
285
|
-
edge_write_loop(id,
|
|
299
|
+
edge_write_loop(id, loop_id) {
|
|
286
300
|
const pool = this.__edge_pool;
|
|
287
301
|
|
|
288
302
|
const address = pool.element_address(id);
|
|
289
|
-
pool.data_view.setUint32(address + 2 * UINT_32_SIZE,
|
|
303
|
+
pool.data_view.setUint32(address + 2 * UINT_32_SIZE, loop_id);
|
|
290
304
|
}
|
|
291
305
|
|
|
292
306
|
/**
|
|
293
307
|
* @param {number} id edge ID
|
|
294
|
-
* @returns {number}
|
|
308
|
+
* @returns {number} edge ID
|
|
295
309
|
*/
|
|
296
310
|
edge_read_v1_disk_next(id) {
|
|
297
311
|
assert.isNonNegativeInteger(id, 'id');
|
|
@@ -306,7 +320,7 @@ export class BinaryTopology {
|
|
|
306
320
|
|
|
307
321
|
/**
|
|
308
322
|
*
|
|
309
|
-
* @param {number} value
|
|
323
|
+
* @param {number} value edge ID
|
|
310
324
|
* @param {number} id edge ID
|
|
311
325
|
*/
|
|
312
326
|
edge_write_v1_disk_next(id, value) {
|
|
@@ -320,7 +334,7 @@ export class BinaryTopology {
|
|
|
320
334
|
|
|
321
335
|
/**
|
|
322
336
|
* @param {number} id edge ID
|
|
323
|
-
* @returns {number}
|
|
337
|
+
* @returns {number} edge ID
|
|
324
338
|
*/
|
|
325
339
|
edge_read_v1_disk_prev(id) {
|
|
326
340
|
assert.isNonNegativeInteger(id, 'id');
|
|
@@ -335,7 +349,7 @@ export class BinaryTopology {
|
|
|
335
349
|
|
|
336
350
|
/**
|
|
337
351
|
*
|
|
338
|
-
* @param {number} value
|
|
352
|
+
* @param {number} value edge ID
|
|
339
353
|
* @param {number} id edge ID
|
|
340
354
|
*/
|
|
341
355
|
edge_write_v1_disk_prev(id, value) {
|
|
@@ -349,7 +363,7 @@ export class BinaryTopology {
|
|
|
349
363
|
|
|
350
364
|
/**
|
|
351
365
|
* @param {number} id edge ID
|
|
352
|
-
* @returns {number}
|
|
366
|
+
* @returns {number} edge ID
|
|
353
367
|
*/
|
|
354
368
|
edge_read_v2_disk_next(id) {
|
|
355
369
|
assert.isNonNegativeInteger(id, 'id');
|
|
@@ -364,7 +378,7 @@ export class BinaryTopology {
|
|
|
364
378
|
|
|
365
379
|
/**
|
|
366
380
|
*
|
|
367
|
-
* @param {number} value
|
|
381
|
+
* @param {number} value edge ID
|
|
368
382
|
* @param {number} id edge ID
|
|
369
383
|
*/
|
|
370
384
|
edge_write_v2_disk_next(id, value) {
|
|
@@ -378,7 +392,7 @@ export class BinaryTopology {
|
|
|
378
392
|
|
|
379
393
|
/**
|
|
380
394
|
* @param {number} id edge ID
|
|
381
|
-
* @returns {number}
|
|
395
|
+
* @returns {number} edge ID
|
|
382
396
|
*/
|
|
383
397
|
edge_read_v2_disk_prev(id) {
|
|
384
398
|
assert.isNonNegativeInteger(id, 'id');
|
|
@@ -393,7 +407,7 @@ export class BinaryTopology {
|
|
|
393
407
|
|
|
394
408
|
/**
|
|
395
409
|
*
|
|
396
|
-
* @param {number} value
|
|
410
|
+
* @param {number} value edge ID
|
|
397
411
|
* @param {number} id edge ID
|
|
398
412
|
*/
|
|
399
413
|
edge_write_v2_disk_prev(id, value) {
|
|
@@ -621,6 +635,62 @@ export class BinaryTopology {
|
|
|
621
635
|
const address = pool.element_address(id);
|
|
622
636
|
pool.data_view.setUint32(address, value);
|
|
623
637
|
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* @param {number[]|ArrayLike<number>|Float32Array} result
|
|
641
|
+
* @param {number} result_offset
|
|
642
|
+
* @param {number} id face ID
|
|
643
|
+
*/
|
|
644
|
+
face_read_normal(result, result_offset, id) {
|
|
645
|
+
const pool = this.__face_pool;
|
|
646
|
+
// Offset by the first loop pointer (UINT_32_SIZE)
|
|
647
|
+
const f_address = pool.element_address(id) + UINT_32_SIZE;
|
|
648
|
+
const f_offset = f_address >> 2;
|
|
649
|
+
array_copy(pool.data_float32, f_offset, result, result_offset, 3);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @param {number} id face ID
|
|
654
|
+
* @param {number[]|Float32Array} value
|
|
655
|
+
* @param {number} value_offset
|
|
656
|
+
*/
|
|
657
|
+
face_write_normal(id, value, value_offset) {
|
|
658
|
+
const pool = this.__face_pool;
|
|
659
|
+
const f_address = pool.element_address(id) + UINT_32_SIZE;
|
|
660
|
+
const f_offset = f_address >> 2;
|
|
661
|
+
array_copy(value, value_offset, pool.data_float32, f_offset, 3);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Copy data from another mesh.
|
|
666
|
+
* @param {BinaryTopology} other
|
|
667
|
+
*/
|
|
668
|
+
copy(other) {
|
|
669
|
+
assert.defined(other, 'other');
|
|
670
|
+
assert.notNull(other, 'other');
|
|
671
|
+
assert.isObject(other, 'other');
|
|
672
|
+
assert.equal(other.isBinaryTopology, true, 'other is not a BinaryTopology');
|
|
673
|
+
|
|
674
|
+
if (this === other) {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
this.__vertex_pool.copy(other.vertices);
|
|
679
|
+
this.__edge_pool.copy(other.edges);
|
|
680
|
+
this.__loop_pool.copy(other.loops);
|
|
681
|
+
this.__face_pool.copy(other.faces);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
*
|
|
686
|
+
* @returns {BinaryTopology}
|
|
687
|
+
*/
|
|
688
|
+
clone() {
|
|
689
|
+
const clone = new BinaryTopology();
|
|
690
|
+
clone.copy(this);
|
|
691
|
+
return clone;
|
|
692
|
+
}
|
|
693
|
+
|
|
624
694
|
}
|
|
625
695
|
|
|
626
696
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Adds an edge to a vertex's disk cycle.
|
|
4
|
+
* @param {BinaryTopology} mesh
|
|
5
|
+
* @param {number} e Edge ID
|
|
6
|
+
* @param {number} v Vertex ID
|
|
7
|
+
*/
|
|
8
|
+
export function bt_disk_edge_add(mesh: BinaryTopology, e: number, v: number): void;
|
|
9
|
+
//# sourceMappingURL=bt_disk_edge_add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_disk_edge_add.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_add.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,0DAHW,MAAM,KACN,MAAM,QAmChB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* Adds an edge to a vertex's disk cycle.
|
|
6
|
+
* @param {BinaryTopology} mesh
|
|
7
|
+
* @param {number} e Edge ID
|
|
8
|
+
* @param {number} v Vertex ID
|
|
9
|
+
*/
|
|
10
|
+
export function bt_disk_edge_add(mesh, e, v) {
|
|
11
|
+
const is_v1 = mesh.edge_read_vertex1(e) === v;
|
|
12
|
+
const first_edge = mesh.vertex_read_edge(v);
|
|
13
|
+
|
|
14
|
+
if (first_edge === NULL_POINTER) {
|
|
15
|
+
if (is_v1) {
|
|
16
|
+
mesh.edge_write_v1_disk_prev(e, e);
|
|
17
|
+
mesh.edge_write_v1_disk_next(e, e);
|
|
18
|
+
} else {
|
|
19
|
+
mesh.edge_write_v2_disk_prev(e, e);
|
|
20
|
+
mesh.edge_write_v2_disk_next(e, e);
|
|
21
|
+
}
|
|
22
|
+
mesh.vertex_write_edge(v, e);
|
|
23
|
+
} else {
|
|
24
|
+
const first_is_v1 = mesh.edge_read_vertex1(first_edge) === v;
|
|
25
|
+
const prev = first_is_v1 ? mesh.edge_read_v1_disk_prev(first_edge) : mesh.edge_read_v2_disk_prev(first_edge);
|
|
26
|
+
|
|
27
|
+
// Insert `e` between `prev` and `first_edge`
|
|
28
|
+
if (is_v1) {
|
|
29
|
+
mesh.edge_write_v1_disk_prev(e, prev);
|
|
30
|
+
mesh.edge_write_v1_disk_next(e, first_edge);
|
|
31
|
+
} else {
|
|
32
|
+
mesh.edge_write_v2_disk_prev(e, prev);
|
|
33
|
+
mesh.edge_write_v2_disk_next(e, first_edge);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const prev_is_v1 = mesh.edge_read_vertex1(prev) === v;
|
|
37
|
+
if (prev_is_v1) mesh.edge_write_v1_disk_next(prev, e);
|
|
38
|
+
else mesh.edge_write_v2_disk_next(prev, e);
|
|
39
|
+
|
|
40
|
+
if (first_is_v1) mesh.edge_write_v1_disk_prev(first_edge, e);
|
|
41
|
+
else mesh.edge_write_v2_disk_prev(first_edge, e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Removes an edge from a vertex's disk cycle.
|
|
2
3
|
* @see https://github.com/blender/blender/blob/afb0d411072db51b871607034befe3677f9fd82d/source/blender/bmesh/intern/bmesh_structure.cc#L162
|
|
3
4
|
* @param {BinaryTopology} mesh
|
|
4
|
-
* @param {number}
|
|
5
|
-
* @param {number}
|
|
5
|
+
* @param {number} e Edge ID
|
|
6
|
+
* @param {number} v Vertex ID
|
|
6
7
|
*/
|
|
7
|
-
export function bt_disk_edge_remove(mesh: BinaryTopology,
|
|
8
|
+
export function bt_disk_edge_remove(mesh: BinaryTopology, e: number, v: number): void;
|
|
8
9
|
//# sourceMappingURL=bt_disk_edge_remove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt_disk_edge_remove.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bt_disk_edge_remove.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,6DAHW,MAAM,KACN,MAAM,QAmChB"}
|
|
@@ -1,9 +1,43 @@
|
|
|
1
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
4
|
+
* Removes an edge from a vertex's disk cycle.
|
|
2
5
|
* @see https://github.com/blender/blender/blob/afb0d411072db51b871607034befe3677f9fd82d/source/blender/bmesh/intern/bmesh_structure.cc#L162
|
|
3
6
|
* @param {BinaryTopology} mesh
|
|
4
|
-
* @param {number}
|
|
5
|
-
* @param {number}
|
|
7
|
+
* @param {number} e Edge ID
|
|
8
|
+
* @param {number} v Vertex ID
|
|
6
9
|
*/
|
|
7
|
-
export function bt_disk_edge_remove(mesh,
|
|
8
|
-
|
|
10
|
+
export function bt_disk_edge_remove(mesh, e, v) {
|
|
11
|
+
const is_v1 = mesh.edge_read_vertex1(e) === v;
|
|
12
|
+
|
|
13
|
+
const prev = is_v1 ? mesh.edge_read_v1_disk_prev(e) : mesh.edge_read_v2_disk_prev(e);
|
|
14
|
+
const next = is_v1 ? mesh.edge_read_v1_disk_next(e) : mesh.edge_read_v2_disk_next(e);
|
|
15
|
+
|
|
16
|
+
if (prev === e) {
|
|
17
|
+
// This is the only edge in the cycle
|
|
18
|
+
mesh.vertex_write_edge(v, NULL_POINTER);
|
|
19
|
+
} else {
|
|
20
|
+
|
|
21
|
+
const prev_is_v1 = mesh.edge_read_vertex1(prev) === v;
|
|
22
|
+
|
|
23
|
+
if (prev_is_v1) {
|
|
24
|
+
mesh.edge_write_v1_disk_next(prev, next);
|
|
25
|
+
} else {
|
|
26
|
+
mesh.edge_write_v2_disk_next(prev, next);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const next_is_v1 = mesh.edge_read_vertex1(next) === v;
|
|
30
|
+
|
|
31
|
+
if (next_is_v1) {
|
|
32
|
+
mesh.edge_write_v1_disk_prev(next, prev);
|
|
33
|
+
} else {
|
|
34
|
+
mesh.edge_write_v2_disk_prev(next, prev);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// If the vertex's entry pointer was looking at this edge, shift it
|
|
38
|
+
if (mesh.vertex_read_edge(v) === e) {
|
|
39
|
+
mesh.vertex_write_edge(v, next);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
9
43
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely untangles and removes a loop from the topology.
|
|
3
|
+
* Removes it from the edge's radial cycle, unlinks it from the face cycle, and frees the memory.
|
|
4
|
+
* @param {BinaryTopology} mesh
|
|
5
|
+
* @param {number} loop Loop ID
|
|
6
|
+
*/
|
|
7
|
+
export function bt_loop_kill(mesh: BinaryTopology, loop: number): void;
|
|
8
|
+
//# sourceMappingURL=bt_loop_kill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_loop_kill.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_loop_kill.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,yDAFW,MAAM,QA4BhB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NULL_POINTER } from "../BinaryTopology.js";
|
|
2
|
+
import { bt_radial_loop_remove } from "./bt_radial_loop_remove.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Safely untangles and removes a loop from the topology.
|
|
6
|
+
* Removes it from the edge's radial cycle, unlinks it from the face cycle, and frees the memory.
|
|
7
|
+
* @param {BinaryTopology} mesh
|
|
8
|
+
* @param {number} loop Loop ID
|
|
9
|
+
*/
|
|
10
|
+
export function bt_loop_kill(mesh, loop) {
|
|
11
|
+
// 1. Untangle from the edge's radial cycle
|
|
12
|
+
const edge = mesh.loop_read_edge(loop);
|
|
13
|
+
if (edge !== NULL_POINTER) {
|
|
14
|
+
bt_radial_loop_remove(mesh, loop, edge);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 2. Untangle from the face's loop cycle (doubly linked list)
|
|
18
|
+
const next = mesh.loop_read_next(loop);
|
|
19
|
+
const prev = mesh.loop_read_prev(loop);
|
|
20
|
+
|
|
21
|
+
if (next !== NULL_POINTER && prev !== NULL_POINTER) {
|
|
22
|
+
mesh.loop_write_next(prev, next);
|
|
23
|
+
mesh.loop_write_prev(next, prev);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 3. Update the face's base loop pointer if it was looking at this loop
|
|
27
|
+
const face = mesh.loop_read_face(loop);
|
|
28
|
+
if (face !== NULL_POINTER) {
|
|
29
|
+
if (mesh.face_read_loop(face) === loop) {
|
|
30
|
+
// If it was the only loop left, the face now has no loops
|
|
31
|
+
mesh.face_write_loop(face, next === loop ? NULL_POINTER : next);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
mesh.loops.release(loop);
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove vertices/edges/loops/disks etc. that are not referenced by any faces.
|
|
3
|
+
* Useful when running topology modifying algorithms such as erosion or simplification.
|
|
4
|
+
* Performs in-place modification of the mesh.
|
|
5
|
+
*
|
|
6
|
+
* If a valid mesh is passed in, after calling this - the mesh is guaranteed to be in a valid state.
|
|
7
|
+
* @param {BinaryTopology} mesh
|
|
8
|
+
*/
|
|
9
|
+
export function bt_mesh_cleanup_faceless_references(mesh: BinaryTopology): void;
|
|
10
|
+
//# sourceMappingURL=bt_mesh_cleanup_faceless_references.d.ts.map
|
package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_cleanup_faceless_references.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_mesh_cleanup_faceless_references.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_mesh_cleanup_faceless_references.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,gFAgDC"}
|