This commit is contained in:
bubnikv 2019-05-07 13:36:24 +02:00
commit bf0b75b398
3 changed files with 45 additions and 32 deletions

View file

@ -582,8 +582,8 @@ void base_plate(const TriangleMesh &mesh, ExPolygons &output, float h,
}
}
void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
const PoolConfig& cfg)
Contour3D create_base_pool(const ExPolygons &ground_layer,
const PoolConfig& cfg = PoolConfig())
{
// for debugging:
// Benchmark bench;
@ -618,7 +618,7 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
Contour3D pool;
for(ExPolygon& concaveh : concavehs) {
if(concaveh.contour.points.empty()) return;
if(concaveh.contour.points.empty()) return pool;
// Get rid of any holes in the concave hull output.
concaveh.holes.clear();
@ -683,7 +683,7 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
// Generate the smoothed edge geometry
pool.merge(round_edges(ob,
if(s_eradius > 0) pool.merge(round_edges(ob,
r,
phi,
0, // z position of the input plane
@ -698,7 +698,8 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
if(wingheight > 0) {
// Generate the smoothed edge geometry
pool.merge(round_edges(middle_base,
wh = 0;
if(s_eradius) pool.merge(round_edges(middle_base,
r,
phi - 90, // from tangent lines
0, // z position of the input plane
@ -722,6 +723,14 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
pool.merge(triangulate_expolygon_3d(inner_base, -wingheight));
}
return pool;
}
void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
const PoolConfig& cfg)
{
// For debugging:
// bench.stop();
@ -729,7 +738,7 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
// std::fstream fout("pad_debug.obj", std::fstream::out);
// if(fout.good()) pool.to_obj(fout);
out.merge(mesh(pool));
out.merge(mesh(create_base_pool(ground_layer, cfg)));
}
}

View file

@ -1053,8 +1053,6 @@ void SLAPrint::process()
const double width = m_printer_config.display_width.getFloat() / SCALING_FACTOR;
const double height = m_printer_config.display_height.getFloat() / SCALING_FACTOR;
const double display_area = width*height;
const coord_t clpr_back_offs = - coord_t(m_printer_config.absolute_correction.getFloat() / SCALING_FACTOR);
// get polygons for all instances in the object
auto get_all_polygons =
@ -1138,7 +1136,7 @@ void SLAPrint::process()
auto printlayerfn = [this,
// functions and read only vars
get_all_polygons, polyunion, polydiff, areafn,
area_fill, display_area, exp_time, init_exp_time, fast_tilt, slow_tilt, delta_fade_time, clpr_back_offs,
area_fill, display_area, exp_time, init_exp_time, fast_tilt, slow_tilt, delta_fade_time,
// write vars
&mutex, &models_volume, &supports_volume, &estim_time, &slow_layers,
@ -1174,8 +1172,6 @@ void SLAPrint::process()
for(const SliceRecord& record : layer.slices()) {
const SLAPrintObject *po = record.print_obj();
// const ExPolygons &rawmodelslices = record.get_slice(soModel);
// const ExPolygons &modelslices = clpr_back_offs != 0 ? offset_ex(rawmodelslices, clpr_back_offs) : rawmodelslices;
const ExPolygons &modelslices = record.get_slice(soModel);
bool is_lefth = record.print_obj()->is_left_handed();
@ -1184,8 +1180,6 @@ void SLAPrint::process()
for(ClipperPolygon& p_tmp : v) model_polygons.emplace_back(std::move(p_tmp));
}
// const ExPolygons &rawsupportslices = record.get_slice(soSupport);
// const ExPolygons &supportslices = clpr_back_offs != 0 ? offset_ex(rawsupportslices, clpr_back_offs) : rawsupportslices;
const ExPolygons &supportslices = record.get_slice(soSupport);
if (!supportslices.empty()) {