Visual Computing Library
|
List of mesh intersection algorithms. More...
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. | |
List of mesh intersection algorithms.
You can access these algorithms by including #include <vclib/algorithms/mesh/intersection.h>
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:
m | |
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:
m | |
pl |
The tolerance is set as 1/10^5*2*pi*radius.
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.
m | |
sphere | |
tol |