mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Refactoring changes to the slice index.
This commit is contained in:
parent
5e646562cd
commit
d165dbb498
5 changed files with 249 additions and 215 deletions
|
@ -5014,26 +5014,28 @@ void GLCanvas3D::_render_sla_slices() const
|
|||
if ((bottom_obj_triangles.empty() || bottom_sup_triangles.empty() || top_obj_triangles.empty() || top_sup_triangles.empty()) && obj->is_step_done(slaposIndexSlices))
|
||||
{
|
||||
// FIXME: is this all right (by Tamas)?
|
||||
SliceRange obj_range = obj->get_slices(soModel, float(min_z), float(max_z));
|
||||
SliceRange sup_range = obj->get_slices(soSupport, float(min_z), float(max_z));
|
||||
auto obj_end = obj->get_model_slices().end();
|
||||
auto sup_end = obj->get_support_slices().end();
|
||||
auto slice_range = obj->get_slice_records(coord_t(min_z / SCALING_FACTOR),
|
||||
coord_t(max_z / SCALING_FACTOR));
|
||||
const ExPolygons& obj_bottom = obj->get_slices_from_record(slice_range.begin(), soModel);
|
||||
const ExPolygons& obj_top = obj->get_slices_from_record(std::prev(slice_range.end()), soModel);
|
||||
const ExPolygons& sup_bottom = obj->get_slices_from_record(slice_range.begin(), soSupport);
|
||||
const ExPolygons& sup_top = obj->get_slices_from_record(std::prev(slice_range.end()), soSupport);
|
||||
|
||||
// calculate model bottom cap
|
||||
if(bottom_obj_triangles.empty() && obj_range.from != obj_end)
|
||||
bottom_obj_triangles = triangulate_expolygons_3d(*obj_range.from, min_z, true);
|
||||
if(bottom_obj_triangles.empty() && !obj_bottom.empty())
|
||||
bottom_obj_triangles = triangulate_expolygons_3d(obj_bottom, min_z, true);
|
||||
|
||||
// calculate support bottom cap
|
||||
if(bottom_sup_triangles.empty() && sup_range.from != sup_end)
|
||||
bottom_sup_triangles = triangulate_expolygons_3d(*sup_range.from, min_z, true);
|
||||
if(bottom_sup_triangles.empty() && !sup_bottom.empty())
|
||||
bottom_sup_triangles = triangulate_expolygons_3d(sup_bottom, min_z, true);
|
||||
|
||||
// calculate model top cap
|
||||
if(top_obj_triangles.empty() && obj_range.to != obj_end)
|
||||
top_obj_triangles = triangulate_expolygons_3d(*obj_range.to, max_z, false);
|
||||
if(top_obj_triangles.empty() && !obj_top.empty())
|
||||
top_obj_triangles = triangulate_expolygons_3d(obj_top, max_z, false);
|
||||
|
||||
// calculate support top cap
|
||||
if(top_sup_triangles.empty() && sup_range.to != sup_end)
|
||||
top_sup_triangles = triangulate_expolygons_3d(*sup_range.to, max_z, false);
|
||||
if(top_sup_triangles.empty() && !sup_top.empty())
|
||||
top_sup_triangles = triangulate_expolygons_3d(sup_top, max_z, false);
|
||||
|
||||
// const std::vector<ExPolygons>& model_slices = obj->get_model_slices();
|
||||
// const std::vector<ExPolygons>& support_slices = obj->get_support_slices();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue