Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2020-02-08 23:36:29 +0300
committerbubnikv <bubnikv@gmail.com>2020-02-08 23:36:43 +0300
commit4e11552da980f07216f1720f67f539703ed90ed1 (patch)
treeb5bb0b12b58333cd109cbbb32b1b498b9e05a7be /src/libslic3r/TriangleMesh.hpp
parent79ce691d58ec14ced18e9ade05d9cad012e096b8 (diff)
Spiral vase improvements and bugfixes.
Fixes Connecting / expanding Bottom Layers to Vase Perimeter #253 Fixes Slicing error in vase mode #452 Fixes Slicing Issue (Vase Mode, 0.6mm dmr nozzle) #1887 Fixes Top fill pattern isn't used in spiral vase mode #2533 Fixes Cisar's vase doesn't slice correctly, creates artefacts #3595 When the model is sliced, all the contours are newly oriented counter-clockwise (even holes), merged and then only the largest area contour is retained. In perimeter generator, if the largest contour splits into multiple perimeters, newly only the largest area perimeter is retained in spiral vase mode. These two changes solve #3595 and similar. The infill is newly calculated only for the bottom solid layers if the spiral vase mode is active (removes various unwanted infill along the vase walls), and the last bottom solid layer is switched to a top solid pattern (solves #2533). The thin walls are newly enforced to be disabled in spiral vase mode, and the "ensure vertical shell wall" is enforced in spiral vase mode to extend the bottom of the vase to the vase hull (fixes #253).
Diffstat (limited to 'src/libslic3r/TriangleMesh.hpp')
-rw-r--r--src/libslic3r/TriangleMesh.hpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/libslic3r/TriangleMesh.hpp b/src/libslic3r/TriangleMesh.hpp
index 1a22a9343..bd872a975 100644
--- a/src/libslic3r/TriangleMesh.hpp
+++ b/src/libslic3r/TriangleMesh.hpp
@@ -162,6 +162,16 @@ public:
typedef std::vector<IntersectionLine> IntersectionLines;
typedef std::vector<IntersectionLine*> IntersectionLinePtrs;
+enum class SlicingMode : uint32_t {
+ // Regular slicing, maintain all contours and their orientation.
+ Regular,
+ // Maintain all contours, orient all contours CCW, therefore all holes are being closed.
+ Positive,
+ // Orient all contours CCW and keep only the contour with the largest area.
+ // This mode is useful for slicing complex objects in vase mode.
+ PositiveLargestContour,
+};
+
class TriangleMeshSlicer
{
public:
@@ -169,8 +179,8 @@ public:
TriangleMeshSlicer() : mesh(nullptr) {}
TriangleMeshSlicer(const TriangleMesh* mesh) { this->init(mesh, [](){}); }
void init(const 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, const float closing_radius, std::vector<ExPolygons>* layers, throw_on_cancel_callback_type throw_on_cancel) const;
+ void slice(const std::vector<float> &z, SlicingMode mode, std::vector<Polygons>* layers, throw_on_cancel_callback_type throw_on_cancel) const;
+ void slice(const std::vector<float> &z, SlicingMode mode, const float closing_radius, std::vector<ExPolygons>* layers, throw_on_cancel_callback_type throw_on_cancel) const;
enum FacetSliceType {
NoSlice = 0,
Slicing = 1,
@@ -207,7 +217,7 @@ inline void slice_mesh(
{
if (mesh.empty()) return;
TriangleMeshSlicer slicer(&mesh);
- slicer.slice(z, &layers, thr);
+ slicer.slice(z, SlicingMode::Regular, &layers, thr);
}
inline void slice_mesh(
@@ -219,7 +229,7 @@ inline void slice_mesh(
{
if (mesh.empty()) return;
TriangleMeshSlicer slicer(&mesh);
- slicer.slice(z, closing_radius, &layers, thr);
+ slicer.slice(z, SlicingMode::Regular, closing_radius, &layers, thr);
}
TriangleMesh make_cube(double x, double y, double z);