mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 13:17:54 -06:00
Merged with dev
This commit is contained in:
parent
d934b63424
commit
fe3b92870f
90 changed files with 3310 additions and 1748 deletions
|
@ -83,7 +83,7 @@ private:
|
|||
|
||||
enum FacetEdgeType {
|
||||
// A general case, the cutting plane intersect a face at two different edges.
|
||||
feNone,
|
||||
feGeneral,
|
||||
// Two vertices are aligned with the cutting plane, the third vertex is below the cutting plane.
|
||||
feTop,
|
||||
// Two vertices are aligned with the cutting plane, the third vertex is above the cutting plane.
|
||||
|
@ -117,6 +117,14 @@ public:
|
|||
class IntersectionLine : public Line
|
||||
{
|
||||
public:
|
||||
IntersectionLine() : a_id(-1), b_id(-1), edge_a_id(-1), edge_b_id(-1), edge_type(feGeneral), flags(0) {}
|
||||
|
||||
bool skip() const { return (this->flags & SKIP) != 0; }
|
||||
void set_skip() { this->flags |= SKIP; }
|
||||
|
||||
bool is_seed_candidate() const { return (this->flags & NO_SEED) == 0 && ! this->skip(); }
|
||||
void set_no_seed(bool set) { if (set) this->flags |= NO_SEED; else this->flags &= ~NO_SEED; }
|
||||
|
||||
// Inherits Point a, b
|
||||
// For each line end point, either {a,b}_id or {a,b}edge_a_id is set, the other is left to -1.
|
||||
// Vertex indices of the line end points.
|
||||
|
@ -125,11 +133,23 @@ public:
|
|||
// Source mesh edges of the line end points.
|
||||
int edge_a_id;
|
||||
int edge_b_id;
|
||||
// feNone, feTop, feBottom, feHorizontal
|
||||
// feGeneral, feTop, feBottom, feHorizontal
|
||||
FacetEdgeType edge_type;
|
||||
// Used by TriangleMeshSlicer::make_loops() to skip duplicate edges.
|
||||
bool skip;
|
||||
IntersectionLine() : a_id(-1), b_id(-1), edge_a_id(-1), edge_b_id(-1), edge_type(feNone), skip(false) {};
|
||||
// Used by TriangleMeshSlicer::slice() to skip duplicate edges.
|
||||
enum {
|
||||
// Triangle edge added, because it has no neighbor.
|
||||
EDGE0_NO_NEIGHBOR = 0x001,
|
||||
EDGE1_NO_NEIGHBOR = 0x002,
|
||||
EDGE2_NO_NEIGHBOR = 0x004,
|
||||
// Triangle edge added, because it makes a fold with another horizontal edge.
|
||||
EDGE0_FOLD = 0x010,
|
||||
EDGE1_FOLD = 0x020,
|
||||
EDGE2_FOLD = 0x040,
|
||||
// The edge cannot be a seed of a greedy loop extraction (folds are not safe to become seeds).
|
||||
NO_SEED = 0x100,
|
||||
SKIP = 0x200,
|
||||
};
|
||||
uint32_t flags;
|
||||
};
|
||||
typedef std::vector<IntersectionLine> IntersectionLines;
|
||||
typedef std::vector<IntersectionLine*> IntersectionLinePtrs;
|
||||
|
@ -144,7 +164,12 @@ public:
|
|||
void init(TriangleMesh *mesh, throw_on_cancel_callback_type throw_on_cancel);
|
||||
void slice(const std::vector<float> &z, std::vector<Polygons>* layers, throw_on_cancel_callback_type throw_on_cancel) const;
|
||||
void slice(const std::vector<float> &z, std::vector<ExPolygons>* layers, throw_on_cancel_callback_type throw_on_cancel) const;
|
||||
bool slice_facet(float slice_z, const stl_facet &facet, const int facet_idx,
|
||||
enum FacetSliceType {
|
||||
NoSlice = 0,
|
||||
Slicing = 1,
|
||||
Cutting = 2
|
||||
};
|
||||
FacetSliceType slice_facet(float slice_z, const stl_facet &facet, const int facet_idx,
|
||||
const float min_z, const float max_z, IntersectionLine *line_out) const;
|
||||
void cut(float z, TriangleMesh* upper, TriangleMesh* lower) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue