Fix support and hole point reprojection after reload and netfabb
This commit is contained in:
parent
f23a275fbb
commit
f53289ae2d
2 changed files with 14 additions and 6 deletions
|
@ -97,7 +97,7 @@ std::unique_ptr<TriangleMesh> generate_interior(const TriangleMesh & mesh,
|
||||||
_generate_interior(mesh, ctl, hc.min_thickness, voxel_scale,
|
_generate_interior(mesh, ctl, hc.min_thickness, voxel_scale,
|
||||||
hc.closing_distance));
|
hc.closing_distance));
|
||||||
|
|
||||||
if (meshptr) {
|
if (meshptr && !meshptr->empty()) {
|
||||||
|
|
||||||
// This flips the normals to be outward facing...
|
// This flips the normals to be outward facing...
|
||||||
meshptr->require_shared_vertices();
|
meshptr->require_shared_vertices();
|
||||||
|
|
|
@ -28,17 +28,25 @@ void reproject_support_points(const EigenMesh3D &mesh, std::vector<PointType> &p
|
||||||
inline void reproject_points_and_holes(ModelObject *object)
|
inline void reproject_points_and_holes(ModelObject *object)
|
||||||
{
|
{
|
||||||
bool has_sppoints = !object->sla_support_points.empty();
|
bool has_sppoints = !object->sla_support_points.empty();
|
||||||
bool has_holes = !object->sla_drain_holes.empty();
|
|
||||||
|
|
||||||
if (!object || (!has_holes && !has_sppoints)) return;
|
// Disabling reprojection of holes as they have a significant offset away
|
||||||
|
// from the model body which tolerates minor geometrical changes.
|
||||||
|
//
|
||||||
|
// TODO: uncomment and ensure the right offset of the hole points if
|
||||||
|
// reprojection would still be necessary.
|
||||||
|
// bool has_holes = !object->sla_drain_holes.empty();
|
||||||
|
|
||||||
EigenMesh3D emesh{object->raw_mesh()};
|
if (!object || (/*!has_holes &&*/ !has_sppoints)) return;
|
||||||
|
|
||||||
|
TriangleMesh rmsh = object->raw_mesh();
|
||||||
|
rmsh.require_shared_vertices();
|
||||||
|
EigenMesh3D emesh{rmsh};
|
||||||
|
|
||||||
if (has_sppoints)
|
if (has_sppoints)
|
||||||
reproject_support_points(emesh, object->sla_support_points);
|
reproject_support_points(emesh, object->sla_support_points);
|
||||||
|
|
||||||
if (has_holes)
|
// if (has_holes)
|
||||||
reproject_support_points(emesh, object->sla_drain_holes);
|
// reproject_support_points(emesh, object->sla_drain_holes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in a new issue