feat: 测试覆盖扩展 + 文档更新
This commit is contained in:
@@ -8,7 +8,40 @@ using core::Point2D;
|
||||
using core::Polygon2D;
|
||||
using mesh::HalfedgeMesh;
|
||||
|
||||
/// ── Core 3D mesh boolean operations ──────────────────────
|
||||
|
||||
/// Union: A ∪ B — keep faces of each mesh whose centroids lie outside the other
|
||||
HalfedgeMesh mesh_union(const HalfedgeMesh& a, const HalfedgeMesh& b);
|
||||
|
||||
/// Intersection: A ∩ B — keep faces whose centroids lie inside the other
|
||||
HalfedgeMesh mesh_intersection(const HalfedgeMesh& a, const HalfedgeMesh& b);
|
||||
|
||||
/// Difference: A − B — keep A-faces outside B
|
||||
HalfedgeMesh mesh_difference(const HalfedgeMesh& a, const HalfedgeMesh& b);
|
||||
|
||||
/// Symmetric difference: (A − B) ∪ (B − A)
|
||||
HalfedgeMesh mesh_sym_diff(const HalfedgeMesh& a, const HalfedgeMesh& b);
|
||||
|
||||
/// ── Helpers ──────────────────────────────────────────────
|
||||
|
||||
/// Crop mesh `a` by mesh `b`'s boundary: keep faces of `a` whose
|
||||
/// centroids lie OUTSIDE the volume of `b`.
|
||||
/// If `invert_b` is true, test against the flipped-volume (inside↔outside) of `b`.
|
||||
HalfedgeMesh clip_mesh(const HalfedgeMesh& a, const HalfedgeMesh& b,
|
||||
bool invert_b = false);
|
||||
|
||||
/// Invert all face orientations in the mesh
|
||||
HalfedgeMesh invert_mesh(const HalfedgeMesh& m);
|
||||
|
||||
/// Merge two meshes into one (concatenate vertices and faces)
|
||||
HalfedgeMesh merge_meshes(const HalfedgeMesh& a, const HalfedgeMesh& b);
|
||||
|
||||
/// Convenience dispatcher — route by BooleanOp enum
|
||||
HalfedgeMesh mesh_boolean(const HalfedgeMesh& a, const HalfedgeMesh& b, BooleanOp op);
|
||||
|
||||
/// ── Point classification ─────────────────────────────────
|
||||
|
||||
/// Test whether point `p` is inside `mesh` using ray-casting
|
||||
bool is_point_inside_mesh(const core::Point3D& p, const HalfedgeMesh& mesh);
|
||||
|
||||
} // namespace vde::boolean
|
||||
|
||||
Reference in New Issue
Block a user