| 81 | using namespace SelfIntersectionHelper; |
| 82 | |
| 83 | SelfIntersection::SelfIntersection( |
| 84 | const MatrixFr& vertices, const MatrixIr& faces) |
| 85 | : m_faces(faces) { |
| 86 | const size_t num_vertices = vertices.rows(); |
| 87 | const size_t dim = vertices.cols(); |
| 88 | const size_t vertex_per_face = faces.cols(); |
| 89 | |
| 90 | if (dim != 3) { |
| 91 | throw NotImplementedError( |
| 92 | "Self intersection check only support 3D"); |
| 93 | } |
| 94 | if (vertex_per_face != 3) { |
| 95 | throw NotImplementedError( |
| 96 | "Self intersection check only works with triangles"); |
| 97 | } |
| 98 | |
| 99 | m_points.resize(num_vertices); |
| 100 | for (size_t i=0; i<num_vertices; i++) { |
| 101 | m_points[i] = Point_3( |
| 102 | vertices(i,0), |
| 103 | vertices(i,1), |
| 104 | vertices(i,2)); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | void SelfIntersection::detect_self_intersection() { |
| 109 | clear(); |
no test coverage detected