diff options
author | bubnikv <bubnikv@gmail.com> | 2018-03-15 19:14:13 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-03-15 19:14:13 +0300 |
commit | 4f0c6dd8799479997fb8d580c8684efd9a4e3c15 (patch) | |
tree | 1539261564b3baca567449763aa7d079c77e5e1b /xs/src/libslic3r/TriangleMesh.hpp | |
parent | 1ae8684af147f3007324a3c876986b83231db4e1 (diff) |
Reworked the fix of #784 for efficiency and robustness:
First, the same direction segments are chained as before, but this time
the remaining open polylines are collected to be processed in the 2nd step.
Second, the remaining open polylines are connected by a greedy algorithm
disregarding their original orientation. As the orientation of loops
created by the 2nd step is mixed, the orientation of these loops is
unknown, therfore a CCW orientation is enforced. The CCW heuristics
may fill holes and cavities, but no outer geometry will be lost.
Diffstat (limited to 'xs/src/libslic3r/TriangleMesh.hpp')
-rw-r--r-- | xs/src/libslic3r/TriangleMesh.hpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xs/src/libslic3r/TriangleMesh.hpp b/xs/src/libslic3r/TriangleMesh.hpp index 3192c90b6..c700784a5 100644 --- a/xs/src/libslic3r/TriangleMesh.hpp +++ b/xs/src/libslic3r/TriangleMesh.hpp @@ -85,11 +85,11 @@ enum FacetEdgeType { feHorizontal }; -class IntersectionPoint : public Point +class IntersectionReference { public: - IntersectionPoint() : point_id(-1), edge_id(-1) {}; - // Inherits coord_t x, y + IntersectionReference() : point_id(-1), edge_id(-1) {}; + IntersectionReference(int point_id, int edge_id) : point_id(point_id), edge_id(edge_id) {} // Where is this intersection point located? On mesh vertex or mesh edge? // Only one of the following will be set, the other will remain set to -1. // Index of the mesh vertex. @@ -98,6 +98,15 @@ public: int edge_id; }; +class IntersectionPoint : public Point, public IntersectionReference +{ +public: + IntersectionPoint() {}; + IntersectionPoint(int point_id, int edge_id, const Point &pt) : IntersectionReference(point_id, edge_id), Point(pt) {} + IntersectionPoint(const IntersectionReference &ir, const Point &pt) : IntersectionReference(ir), Point(pt) {} + // Inherits coord_t x, y +}; + class IntersectionLine : public Line { public: |