Visual Computing Library
Loading...
Searching...
No Matches
Mesh Intersection Algorithms

List of mesh intersection algorithms. More...

Collaboration diagram for Mesh Intersection Algorithms:

Functions

template<EdgeMeshConcept EdgeMesh, FaceMeshConcept MeshType, PlaneConcept PlaneType>
EdgeMesh vcl::intersection (const MeshType &m, const PlaneType &pl)
 Takes a mesh and a plane as inputs and computes the intersection between the mesh and the plane. It creates a new EdgeMesh to represent the intersection edges.
 
template<FaceMeshConcept MeshType, typename SScalar >
MeshType vcl::intersection (const MeshType &m, const Sphere< SScalar > &sphere, double tol)
 Compute the intersection between a mesh and a ball.
 
template<FaceMeshConcept MeshType, typename SScalar >
MeshType vcl::intersection (const MeshType &m, const Sphere< SScalar > &sphere)
 Takes a mesh and a plane as inputs and computes the intersection between the mesh and the plane. It creates a new EdgeMesh to represent the intersection edges.
 

Detailed Description

List of mesh intersection algorithms.

You can access these algorithms by including #include <vclib/algorithms/mesh/intersection.h>

Function Documentation

◆ intersection() [1/3]

template<EdgeMeshConcept EdgeMesh, FaceMeshConcept MeshType, PlaneConcept PlaneType>
EdgeMesh vcl::intersection ( const MeshType &  m,
const PlaneType pl 
)

Takes a mesh and a plane as inputs and computes the intersection between the mesh and the plane. It creates a new EdgeMesh to represent the intersection edges.

First, for each vertex in the original mesh, it computes its distance to the plane and stores it in a vector. Then, for each face in the original mesh, it checks each of its edges to see if they intersect the plane. If an edge intersects the plane, the intersection point is computed and added to a vector of intersection points. If the edge lies exactly on the plane, its vertices are added to the intersection points.

Once all intersection points have been computed, the function creates a new edge mesh and adds an edge between each pair of consecutive intersection points that forms a line segment on the plane. If the original mesh has per-vertex normals, the function also computes and stores the normal at each intersection point.

Requirements:

  • EdgeMesh:
    • Vertices
      • Normals (optional)
    • Edges
  • MeshType:
    • Vertices
      • Normals (optional)
    • Faces
Parameters
m
pl
Returns
the intersection between the original mesh and the plane as a collection of line segments with optional normal vectors.

◆ intersection() [2/3]

template<FaceMeshConcept MeshType, typename SScalar >
MeshType vcl::intersection ( const MeshType &  m,
const Sphere< SScalar > &  sphere 
)

Takes a mesh and a plane as inputs and computes the intersection between the mesh and the plane. It creates a new EdgeMesh to represent the intersection edges.

First, for each vertex in the original mesh, it computes its distance to the plane and stores it in a vector. Then, for each face in the original mesh, it checks each of its edges to see if they intersect the plane. If an edge intersects the plane, the intersection point is computed and added to a vector of intersection points. If the edge lies exactly on the plane, its vertices are added to the intersection points.

Once all intersection points have been computed, the function creates a new edge mesh and adds an edge between each pair of consecutive intersection points that forms a line segment on the plane. If the original mesh has per-vertex normals, the function also computes and stores the normal at each intersection point.

Requirements:

  • EdgeMesh:
    • Vertices
      • Normals (optional)
    • Edges
  • MeshType:
    • Vertices
      • Normals (optional)
    • Faces
Parameters
m
pl
Returns
the intersection between the original mesh and the plane as a collection of line segments with optional normal vectors.

The tolerance is set as 1/10^5*2*pi*radius.

◆ intersection() [3/3]

template<FaceMeshConcept MeshType, typename SScalar >
MeshType vcl::intersection ( const MeshType &  m,
const Sphere< SScalar > &  sphere,
double  tol 
)

Compute the intersection between a mesh and a ball.

Given a mesh and a sphere, returns a new mesh made by a copy of all the faces entirely included in the sphere, plus new faces created by refining the ones intersected by the sphere border. It works by recursively splitting the triangles that cross the border, as long as their area is greater than a given value tol.

Note
The returned mesh is a triangle soup
Parameters
m
sphere
tol
Returns