FInish csg operation stacking in cgal side

Broken slicing
This commit is contained in:
tamasmeszaros 2022-12-21 13:53:33 +01:00
parent 25ca46e3eb
commit d75b951c39
4 changed files with 213 additions and 93 deletions

View file

@ -206,7 +206,15 @@ indexed_triangle_set SLAPrint::Steps::generate_preview_vdb(
void SLAPrint::Steps::generate_preview(SLAPrintObject &po, SLAPrintObjectStep step)
{
po.m_preview_meshes[step] = TriangleMesh{generate_preview_vdb(po, step)};
auto r = range(po.m_mesh_to_slice);
if (csg::check_csgmesh_booleans(r) == r.end()) {
auto cgalmesh = csg::perform_csgmesh_booleans(r);
po.m_preview_meshes[step] = MeshBoolean::cgal::cgal_to_triangle_mesh(*cgalmesh);
} else {
po.active_step_add_warning(PrintStateBase::WarningLevel::NON_CRITICAL,
L("Can't do proper mesh booleans!"));
po.m_preview_meshes[step] = TriangleMesh{generate_preview_vdb(po, step)};
}
for (size_t i = size_t(step) + 1; i < slaposCount; ++i)
{