23#ifndef VCL_ALGORITHMS_CORE_INTERSECTION_ELEMENT_H
24#define VCL_ALGORITHMS_CORE_INTERSECTION_ELEMENT_H
28#include <vclib/algorithms/core/polygon.h>
29#include <vclib/concepts/mesh/elements/face.h>
30#include <vclib/space/core/box.h>
31#include <vclib/space/core/sphere.h>
32#include <vclib/space/core/triangle_wrapper.h>
56template<FaceConcept FaceType, Po
intConcept Po
intType>
64 f.vertex(2)->coord()),
71 for (uint
i = 0;
i <
tris.size() && !
b;
i += 3) {
74 f.vertex(
tris[
i])->coord(),
75 f.vertex(
tris[
i + 1])->coord(),
76 f.vertex(
tris[
i + 2])->coord()),
88template<Po
intConcept Po
intType, FaceConcept FaceType>
114template<FaceConcept FaceType, Po
intConcept Po
intType,
typename SScalar>
119 std::pair<SScalar, SScalar>&
res)
124 f.vertex(0)->coord(),
125 f.vertex(1)->coord(),
126 f.vertex(2)->coord()),
132 if (f.vertexNumber() == 3) {
135 f.vertex(0)->coord(),
136 f.vertex(1)->coord(),
137 f.vertex(2)->coord()),
143 res.first = std::numeric_limits<SScalar>::max();
144 std::pair<SScalar, SScalar>
r;
150 for (uint
i = 0;
i <
tris.size() && !
b;
i += 3) {
153 f.vertex(
tris[
i])->coord(),
154 f.vertex(
tris[
i + 1])->coord(),
155 f.vertex(
tris[
i + 2])->coord()),
160 if (
r.first <
res.first) {
185template<FaceConcept FaceType,
typename SScalar>
189 std::pair<SScalar, SScalar>
res;
198template<
typename SScalar, FaceConcept FaceType>
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The TriangleWrapper class is a wrapper around a N-Dimensional triangle.
Definition triangle_wrapper.h:54
bool intersect(const FaceType &f, const Box< PointType > &box)
Checks if a face intersects a box.
Definition element.h:57
std::vector< uint > earCut(Iterator begin, Iterator end)
Triangulates a simple polygon with no holes using the ear-cutting algorithm.
Definition ear_cut.h:92