New supports now do rafts at least to the extent the test cases run through.

New supports enabled, old supports will go away soon.
This commit is contained in:
bubnikv 2016-12-20 12:19:13 +01:00
parent 5614e997a4
commit 955bc957ba
17 changed files with 279 additions and 308 deletions

View file

@ -3,6 +3,7 @@
#include "Flow.hpp"
#include "PrintConfig.hpp"
#include "Slicing.hpp"
namespace Slic3r {
@ -22,7 +23,8 @@ class PrintObjectSupportMaterial
public:
enum SupporLayerType {
sltUnknown = 0,
sltRaft,
sltRaftBase,
sltRaftInterface,
stlFirstLayer,
sltBottomContact,
sltBottomInterface,
@ -118,37 +120,17 @@ public:
typedef std::deque<MyLayer> MyLayerStorage;
public:
PrintObjectSupportMaterial(const PrintObject *object);
PrintObjectSupportMaterial(const PrintObject *object, const SlicingParameters &slicing_params);
// Height of the 1st layer is user configured as it is important for the print
// to stick to he print bed.
coordf_t first_layer_height() const { return m_object_config->first_layer_height.value; }
// Is raft enabled?
bool has_raft() const { return m_has_raft; }
bool has_raft() const { return m_slicing_params.has_raft(); }
// Has any support?
bool has_support() const { return m_object_config->support_material.value; }
// How many raft layers are there below the 1st object layer?
// The 1st object layer_id will be offsetted by this number.
size_t num_raft_layers() const { return m_object_config->raft_layers.value; }
// num_raft_layers() == num_raft_base_layers() + num_raft_interface_layers() + num_raft_contact_layers().
size_t num_raft_base_layers() const { return m_num_base_raft_layers; }
size_t num_raft_interface_layers() const { return m_num_interface_raft_layers; }
size_t num_raft_contact_layers() const { return m_num_contact_raft_layers; }
coordf_t raft_height() const { return m_raft_height; }
coordf_t raft_base_height() const { return m_raft_base_height; }
coordf_t raft_interface_height() const { return m_raft_interface_height; }
coordf_t raft_contact_height() const { return m_raft_contact_height; }
bool raft_bridging() const { return m_raft_contact_layer_bridging; }
// 1st layer of the object will be printed depeding on the raft settings.
coordf_t first_object_layer_print_z() const { return m_object_1st_layer_print_z; }
coordf_t first_object_layer_height() const { return m_object_1st_layer_height; }
coordf_t first_object_layer_gap() const { return m_object_1st_layer_gap; }
bool first_object_layer_bridging() const { return m_object_1st_layer_bridging; }
// Generate support material for the object.
// New support layers will be added to the object,
// with extrusion paths and islands filled in for each support layer.
@ -185,10 +167,11 @@ private:
MyLayersPtr &intermediate_layers,
std::vector<Polygons> &layer_support_areas) const;
Polygons generate_raft_base(
MyLayersPtr generate_raft_base(
const PrintObject &object,
const MyLayersPtr &bottom_contacts,
MyLayersPtr &intermediate_layers) const;
const MyLayersPtr &top_contacts,
MyLayersPtr &intermediate_layers,
MyLayerStorage &layer_storage) const;
MyLayersPtr generate_interface_layers(
const PrintObject &object,
@ -205,7 +188,7 @@ private:
// Produce the actual G-code.
void generate_toolpaths(
const PrintObject &object,
const Polygons &raft,
const MyLayersPtr &raft_layers,
const MyLayersPtr &bottom_contacts,
const MyLayersPtr &top_contacts,
const MyLayersPtr &intermediate_layers,
@ -214,36 +197,14 @@ private:
const PrintObject *m_object;
const PrintConfig *m_print_config;
const PrintObjectConfig *m_object_config;
SlicingParameters m_slicing_params;
Flow m_first_layer_flow;
Flow m_support_material_flow;
coordf_t m_support_material_spacing;
Flow m_support_material_interface_flow;
bool m_soluble_interface;
coordf_t m_support_material_interface_spacing;
Flow m_support_material_raft_base_flow;
Flow m_support_material_raft_interface_flow;
Flow m_support_material_raft_contact_flow;
bool m_has_raft;
size_t m_num_base_raft_layers;
size_t m_num_interface_raft_layers;
size_t m_num_contact_raft_layers;
// If set, the raft contact layer is laid with round strings, which are easily detachable
// from both the below and above layes.
// Otherwise a normal flow is used and the strings are squashed against the layer below,
// creating a firm bond with the layer below and making the interface top surface flat.
coordf_t m_raft_height;
coordf_t m_raft_base_height;
coordf_t m_raft_interface_height;
coordf_t m_raft_contact_height;
bool m_raft_contact_layer_bridging;
coordf_t m_object_1st_layer_print_z;
coordf_t m_object_1st_layer_height;
coordf_t m_object_1st_layer_gap;
bool m_object_1st_layer_bridging;
coordf_t m_object_layer_height_max;
coordf_t m_support_layer_height_min;
coordf_t m_support_layer_height_max;
coordf_t m_support_interface_layer_height_max;