Fix for crash when generating supports with empty input points
This commit is contained in:
parent
45b51bd40e
commit
7fe7f33b80
2 changed files with 6 additions and 5 deletions
|
@ -929,6 +929,9 @@ bool SLASupportTree::generate(const PointSet &points,
|
||||||
const SupportConfig &cfg,
|
const SupportConfig &cfg,
|
||||||
const Controller &ctl)
|
const Controller &ctl)
|
||||||
{
|
{
|
||||||
|
// If there are no input points there is no point in doing anything
|
||||||
|
if(points.rows() == 0) return false;
|
||||||
|
|
||||||
PointSet filtered_points; // all valid support points
|
PointSet filtered_points; // all valid support points
|
||||||
PointSet head_positions; // support points with pinhead
|
PointSet head_positions; // support points with pinhead
|
||||||
PointSet head_normals; // head normals
|
PointSet head_normals; // head normals
|
||||||
|
@ -1619,10 +1622,7 @@ bool SLASupportTree::generate(const PointSet &points,
|
||||||
return pc == ABORT;
|
return pc == ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
SLASupportTree::SLASupportTree(): m_impl(new Impl())
|
SLASupportTree::SLASupportTree(): m_impl(new Impl()) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const TriangleMesh &SLASupportTree::merged_mesh() const
|
const TriangleMesh &SLASupportTree::merged_mesh() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,6 +84,7 @@ size_t SpatIndex::size() const
|
||||||
}
|
}
|
||||||
|
|
||||||
PointSet normals(const PointSet& points, const EigenMesh3D& mesh) {
|
PointSet normals(const PointSet& points, const EigenMesh3D& mesh) {
|
||||||
|
if(points.rows() == 0 || mesh.V.rows() == 0 || mesh.F.rows() == 0) return {};
|
||||||
#ifdef IGL_COMPATIBLE
|
#ifdef IGL_COMPATIBLE
|
||||||
Eigen::VectorXd dists;
|
Eigen::VectorXd dists;
|
||||||
Eigen::VectorXi I;
|
Eigen::VectorXi I;
|
||||||
|
@ -108,7 +109,7 @@ PointSet normals(const PointSet& points, const EigenMesh3D& mesh) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
#else // TODO: do something on 32 bit windows
|
||||||
return {};
|
return {};
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue