mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-06 07:14:57 +08:00
Connecting UI parameters to the calculation input.
* I also added temporary default values in PrintConfig to not get random values.
This commit is contained in:
parent
ab94391fd0
commit
6430fb2ec2
@ -905,46 +905,47 @@ public:
|
|||||||
ConfigOptionFloat layer_height;
|
ConfigOptionFloat layer_height;
|
||||||
|
|
||||||
// Radius in mm of the pointing side of the head.
|
// Radius in mm of the pointing side of the head.
|
||||||
ConfigOptionFloat support_head_front_radius /*= 0.2*/;
|
ConfigOptionFloat support_head_front_radius = 0.2;
|
||||||
|
|
||||||
// How much the pinhead has to penetrate the model surface
|
// How much the pinhead has to penetrate the model surface
|
||||||
ConfigOptionFloat support_head_penetraiton /*= 0.2*/;
|
ConfigOptionFloat support_head_penetraiton = 0.2;
|
||||||
|
|
||||||
// Radius of the back side of the 3d arrow.
|
// Radius of the back side of the 3d arrow. TODO: consider renaming this
|
||||||
ConfigOptionFloat support_head_back_radius /*= 0.5*/;
|
// to actual pillar radius, because that's what it boils down to.
|
||||||
|
ConfigOptionFloat support_head_back_radius = 0.5;
|
||||||
|
|
||||||
// Width in mm from the back sphere center to the front sphere center.
|
// Width in mm from the back sphere center to the front sphere center.
|
||||||
ConfigOptionFloat support_head_width /*= 1.0*/;
|
ConfigOptionFloat support_head_width = 1.0;
|
||||||
|
|
||||||
// Radius in mm of the support pillars.
|
// Radius in mm of the support pillars.
|
||||||
// TODO: This parameter is invalid. The pillar radius will be dynamic in
|
// TODO: This parameter is questionable. The pillar radius will be dynamic in
|
||||||
// nature. Merged pillars will have an increased thickness. This parameter
|
// nature. Merged pillars will have an increased thickness. This parameter
|
||||||
// may serve as the maximum radius, or maybe an increase when two are merged
|
// may serve as the maximum radius, or maybe an increase when two are merged
|
||||||
// The default radius will be derived from head_back_radius_mm
|
// The default radius will be derived from head_back_radius_mm
|
||||||
ConfigOptionFloat support_pillar_radius /*= 0.8*/;
|
ConfigOptionFloat support_pillar_radius = 0.8;
|
||||||
|
|
||||||
// Radius in mm of the pillar base.
|
// Radius in mm of the pillar base.
|
||||||
ConfigOptionFloat support_base_radius /*= 2.0*/;
|
ConfigOptionFloat support_base_radius = 2.0;
|
||||||
|
|
||||||
// The height of the pillar base cone in mm.
|
// The height of the pillar base cone in mm.
|
||||||
ConfigOptionFloat support_base_height /*= 1.0*/;
|
ConfigOptionFloat support_base_height = 1.0;
|
||||||
|
|
||||||
// The default angle for connecting support sticks and junctions.
|
// The default angle for connecting support sticks and junctions.
|
||||||
ConfigOptionFloat support_critical_angle /*= M_PI/4*/;
|
ConfigOptionFloat support_critical_angle = 45;
|
||||||
|
|
||||||
// The max length of a bridge in mm
|
// The max length of a bridge in mm
|
||||||
ConfigOptionFloat support_max_bridge_length /*= 15.0*/;
|
ConfigOptionFloat support_max_bridge_length = 15.0;
|
||||||
|
|
||||||
// The elevation in Z direction upwards. This is the space between the pad
|
// The elevation in Z direction upwards. This is the space between the pad
|
||||||
// and the model object's bounding box bottom.
|
// and the model object's bounding box bottom. Units in mm.
|
||||||
ConfigOptionFloat support_object_elevation;
|
ConfigOptionFloat support_object_elevation = 5.0;
|
||||||
|
|
||||||
// Now for the base pool (plate) ///////////////////////////////////////////
|
// Now for the base pool (pad) /////////////////////////////////////////////
|
||||||
|
|
||||||
ConfigOptionFloat pad_wall_thickness /*= 2*/;
|
ConfigOptionFloat pad_wall_thickness= 2;
|
||||||
ConfigOptionFloat pad_wall_height /*= 5*/;
|
ConfigOptionFloat pad_wall_height = 5;
|
||||||
ConfigOptionFloat pad_max_merge_distance /*= 50*/;
|
ConfigOptionFloat pad_max_merge_distance = 50;
|
||||||
ConfigOptionFloat pad_edge_radius /*= 1*/;
|
ConfigOptionFloat pad_edge_radius = 1;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||||
|
@ -33,7 +33,7 @@ struct SupportConfig {
|
|||||||
double head_front_radius_mm = 0.2;
|
double head_front_radius_mm = 0.2;
|
||||||
|
|
||||||
// How much the pinhead has to penetrate the model surface
|
// How much the pinhead has to penetrate the model surface
|
||||||
double head_penetraiton = 0.2;
|
double head_penetraiton_mm = 0.2;
|
||||||
|
|
||||||
// Radius of the back side of the 3d arrow.
|
// Radius of the back side of the 3d arrow.
|
||||||
double head_back_radius_mm = 0.5;
|
double head_back_radius_mm = 0.5;
|
||||||
|
@ -169,7 +169,17 @@ void SLAPrint::process()
|
|||||||
auto& emesh = po.m_supportdata->emesh;
|
auto& emesh = po.m_supportdata->emesh;
|
||||||
auto& pts = po.m_supportdata->support_points; // nowhere filled yet
|
auto& pts = po.m_supportdata->support_points; // nowhere filled yet
|
||||||
try {
|
try {
|
||||||
SupportConfig scfg; // TODO fill or replace with po.m_config
|
sla::SupportConfig scfg;
|
||||||
|
SLAPrintObjectConfig& c = po.m_config;
|
||||||
|
|
||||||
|
scfg.head_front_radius_mm = c.support_head_front_radius.getFloat();
|
||||||
|
scfg.head_back_radius_mm = c.support_head_back_radius.getFloat();
|
||||||
|
scfg.head_penetraiton_mm = c.support_head_penetraiton.getFloat();
|
||||||
|
scfg.head_width_mm = c.support_head_width.getFloat();
|
||||||
|
scfg.object_elevation_mm = c.support_object_elevation.getFloat();
|
||||||
|
scfg.tilt = c.support_critical_angle.getFloat() * 180.0 / PI;
|
||||||
|
scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat();
|
||||||
|
scfg.pillar_radius_mm = c.support_pillar_radius.getFloat();
|
||||||
|
|
||||||
sla::Controller ctl;
|
sla::Controller ctl;
|
||||||
ctl.statuscb = [this](unsigned st, const std::string& msg) {
|
ctl.statuscb = [this](unsigned st, const std::string& msg) {
|
||||||
@ -445,8 +455,10 @@ double SLAPrintObject::get_elevation() const {
|
|||||||
|
|
||||||
const std::vector<ExPolygons> &SLAPrintObject::get_support_slices() const
|
const std::vector<ExPolygons> &SLAPrintObject::get_support_slices() const
|
||||||
{
|
{
|
||||||
if(!m_supportdata) return {};
|
// I don't want to return a copy but the points may not exist, so ...
|
||||||
|
static const std::vector<ExPolygons> dummy_empty;
|
||||||
|
|
||||||
|
if(!m_supportdata) return dummy_empty;
|
||||||
return m_supportdata->support_slices;
|
return m_supportdata->support_slices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user