mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-27 10:41:15 -06:00
Adding object elevation param.
Quick attempt to build with MinGW 7.3. Successful compile, failed linking
This commit is contained in:
parent
ad8c7c9f97
commit
87d49cf82f
12 changed files with 45 additions and 28 deletions
|
|
@ -2515,7 +2515,15 @@ void PrintConfigDef::init_sla_params()
|
|||
def->sidetext = L("mm");
|
||||
def->cli = "";
|
||||
def->min = 0;
|
||||
def->default_value = new ConfigOptionFloat();
|
||||
def->default_value = new ConfigOptionFloat(15.0);
|
||||
|
||||
def = this->add("support_object_elevation", coFloat);
|
||||
def->label = L("Object elevation");
|
||||
def->tooltip = L("How much the supports should lift up the supported object.");
|
||||
def->sidetext = L("mm");
|
||||
def->cli = "";
|
||||
def->min = 0;
|
||||
def->default_value = new ConfigOptionFloat(5.0);
|
||||
|
||||
def = this->add("pad_wall_thickness", coFloat);
|
||||
def->label = L("Pad wall thickness");
|
||||
|
|
@ -2542,7 +2550,7 @@ void PrintConfigDef::init_sla_params()
|
|||
def->default_value = new ConfigOptionFloat(50.0);
|
||||
|
||||
def = this->add("pad_edge_radius", coFloat);
|
||||
def->label = L("pad edge radius");
|
||||
def->label = L("Pad edge radius");
|
||||
def->tooltip = L("");
|
||||
def->sidetext = L("mm");
|
||||
def->cli = "";
|
||||
|
|
|
|||
|
|
@ -960,6 +960,7 @@ protected:
|
|||
OPT_PTR(support_base_height);
|
||||
OPT_PTR(support_critical_angle);
|
||||
OPT_PTR(support_max_bridge_length);
|
||||
OPT_PTR(support_object_elevation);
|
||||
OPT_PTR(pad_wall_thickness);
|
||||
OPT_PTR(pad_wall_height);
|
||||
OPT_PTR(pad_max_merge_distance);
|
||||
|
|
|
|||
|
|
@ -510,7 +510,9 @@ struct Pad {
|
|||
Pad(const TriangleMesh& object_support_mesh,
|
||||
const ExPolygons& baseplate,
|
||||
double ground_level,
|
||||
const PoolConfig& cfg) : zlevel(ground_level + cfg.min_wall_height_mm/2)
|
||||
const PoolConfig& pcfg) :
|
||||
cfg(pcfg),
|
||||
zlevel(ground_level + cfg.min_wall_height_mm/2)
|
||||
{
|
||||
ExPolygons basep;
|
||||
base_plate(object_support_mesh, basep,
|
||||
|
|
@ -1092,7 +1094,7 @@ bool SLASupportTree::generate(const PointSet &points,
|
|||
cfg.head_back_radius_mm,
|
||||
cfg.head_front_radius_mm,
|
||||
cfg.head_width_mm,
|
||||
cfg.head_penetraiton_mm,
|
||||
cfg.head_penetration_mm,
|
||||
nmls.row(i), // dir
|
||||
head_pos.row(i) // displacement
|
||||
);
|
||||
|
|
@ -1460,7 +1462,7 @@ bool SLASupportTree::generate(const PointSet &points,
|
|||
Head base_head(cfg.head_back_radius_mm,
|
||||
cfg.head_front_radius_mm,
|
||||
cfg.head_width_mm,
|
||||
cfg.head_penetraiton_mm,
|
||||
cfg.head_penetration_mm,
|
||||
{0.0, 0.0, 1.0},
|
||||
{headend(X), headend(Y), headend(Z) - gh});
|
||||
|
||||
|
|
@ -1659,10 +1661,10 @@ const TriangleMesh &SLASupportTree::add_pad(const SliceLayer& baseplate,
|
|||
TriangleMesh mm;
|
||||
merged_mesh(mm);
|
||||
PoolConfig pcfg;
|
||||
// pcfg.min_wall_thickness_mm = min_wall_thickness_mm;
|
||||
// pcfg.min_wall_height_mm = min_wall_height_mm;
|
||||
// pcfg.max_merge_distance_mm = max_merge_distance_mm;
|
||||
// pcfg.edge_radius_mm = edge_radius_mm;
|
||||
pcfg.min_wall_thickness_mm = min_wall_thickness_mm;
|
||||
pcfg.min_wall_height_mm = min_wall_height_mm;
|
||||
pcfg.max_merge_distance_mm = max_merge_distance_mm;
|
||||
pcfg.edge_radius_mm = edge_radius_mm;
|
||||
return m_impl->create_pad(mm, baseplate, pcfg).tmesh;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ struct SupportConfig {
|
|||
double head_front_radius_mm = 0.2;
|
||||
|
||||
// How much the pinhead has to penetrate the model surface
|
||||
double head_penetraiton_mm = 0.5;
|
||||
double head_penetration_mm = 0.5;
|
||||
|
||||
// Radius of the back side of the 3d arrow.
|
||||
double head_back_radius_mm = 0.5;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model,
|
|||
// Temporary: just to have to correct layer height for the rasterization
|
||||
DynamicPrintConfig config(config_in);
|
||||
config.normalize();
|
||||
auto lh = config.opt<ConfigOptionFloat>("layer_height");
|
||||
//auto lh = config.opt<ConfigOptionFloat>("layer_height");
|
||||
|
||||
// Temporary quick fix, just invalidate everything.
|
||||
{
|
||||
|
|
@ -102,7 +102,10 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model,
|
|||
// Generate new SLAPrintObjects.
|
||||
for (ModelObject *model_object : m_model.objects) {
|
||||
auto po = new SLAPrintObject(this, model_object);
|
||||
po->m_config.layer_height.set(lh);
|
||||
|
||||
// po->m_config.layer_height.set(lh);
|
||||
po->m_config.apply(config, true);
|
||||
|
||||
m_objects.emplace_back(po);
|
||||
for (ModelInstance *oinst : model_object->instances) {
|
||||
Point tr = Point::new_scale(oinst->get_offset()(X),
|
||||
|
|
@ -172,14 +175,14 @@ void SLAPrint::process()
|
|||
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();
|
||||
scfg.head_front_radius_mm = c.support_head_front_radius.getFloat();
|
||||
scfg.head_back_radius_mm = c.support_head_back_radius.getFloat();
|
||||
scfg.head_penetration_mm = c.support_head_penetration.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() * PI / 180.0 ;
|
||||
scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat();
|
||||
scfg.pillar_radius_mm = c.support_pillar_radius.getFloat();
|
||||
|
||||
sla::Controller ctl;
|
||||
ctl.statuscb = [this](unsigned st, const std::string& msg) {
|
||||
|
|
@ -216,10 +219,11 @@ void SLAPrint::process()
|
|||
double lh = po.m_config.layer_height.getFloat();
|
||||
double elevation = po.m_config.support_object_elevation.getFloat();
|
||||
|
||||
std::cout << "Pad height " << h << std::endl;
|
||||
|
||||
sla::ExPolygons bp;
|
||||
if(elevation < h/2)
|
||||
sla::base_plate(po.transformed_mesh(), bp,
|
||||
float(h/2), float(lh));
|
||||
if(elevation < h/2) sla::base_plate(po.transformed_mesh(), bp,
|
||||
float(h/2), float(lh));
|
||||
|
||||
po.m_supportdata->support_tree_ptr->add_pad(bp, wt, h, md, er);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue