Fix mirroring inside volumes trafos

Fix leftover after successive slicing runs
This commit is contained in:
tamasmeszaros 2023-01-18 11:20:22 +01:00
parent 53287002b3
commit b403ba10c1
2 changed files with 6 additions and 12 deletions

View File

@ -26,7 +26,8 @@ MeshBoolean::cgal::CGALMeshPtr get_cgalmesh(const CSGPartT &csgpart)
MeshBoolean::cgal::CGALMeshPtr ret; MeshBoolean::cgal::CGALMeshPtr ret;
indexed_triangle_set m = *its; indexed_triangle_set m = *its;
its_transform(m, get_transform(csgpart)); auto tr = get_transform(csgpart);
its_transform(m, get_transform(csgpart), true);
try { try {
ret = MeshBoolean::cgal::triangle_mesh_to_cgal(m); ret = MeshBoolean::cgal::triangle_mesh_to_cgal(m);

View File

@ -150,7 +150,7 @@ static indexed_triangle_set csgmesh_merge_positive_parts(const Cont &csgmesh)
const indexed_triangle_set * pmesh = csg::get_mesh(csgpart); const indexed_triangle_set * pmesh = csg::get_mesh(csgpart);
if (pmesh && op == csg::CSGType::Union) { if (pmesh && op == csg::CSGType::Union) {
indexed_triangle_set mcpy = *pmesh; indexed_triangle_set mcpy = *pmesh;
its_transform(mcpy, csg::get_transform(csgpart)); its_transform(mcpy, csg::get_transform(csgpart), true);
its_merge(m, mcpy); its_merge(m, mcpy);
} }
} }
@ -292,9 +292,8 @@ void SLAPrint::Steps::generate_preview(SLAPrintObject &po, SLAPrintObjectStep st
m = generate_preview_vdb(po, step); m = generate_preview_vdb(po, step);
} }
if (!m.empty()) po.m_preview_meshes[step] =
po.m_preview_meshes[step] = std::make_shared<const indexed_triangle_set>(std::move(m));
std::make_shared<const indexed_triangle_set>(std::move(m));
for (size_t i = size_t(step) + 1; i < slaposCount; ++i) for (size_t i = size_t(step) + 1; i < slaposCount; ++i)
{ {
@ -408,13 +407,7 @@ void SLAPrint::Steps::drill_holes(SLAPrintObject &po)
csg_inserter{po.m_mesh_to_slice, slaposDrillHoles}, csg_inserter{po.m_mesh_to_slice, slaposDrillHoles},
csg::mpartsDrillHoles); csg::mpartsDrillHoles);
auto r = po.m_mesh_to_slice.equal_range(slaposDrillHoles); generate_preview(po, slaposDrillHoles);
// update preview mesh
if (r.first != r.second)
generate_preview(po, slaposDrillHoles);
else
po.m_preview_meshes[slaposDrillHoles] = po.get_mesh_to_print();
// Release the data, won't be needed anymore, takes huge amount of ram // Release the data, won't be needed anymore, takes huge amount of ram
if (po.m_hollowing_data && po.m_hollowing_data->interior) if (po.m_hollowing_data && po.m_hollowing_data->interior)