FEM: Handle unknown exception when applying a constraint to a B-Spline surface
Fixes #13213 An OCC exception is raised when trying to normalize a null vector. The solution is to check the square length before normalizing it
This commit is contained in:
@@ -430,7 +430,9 @@ bool Constraint::getPoints(std::vector<Base::Vector3d>& points,
|
||||
if (classifier.State() != TopAbs_OUT) {
|
||||
points.emplace_back(p.X(), p.Y(), p.Z());
|
||||
props.Normal(u, v, center, normal);
|
||||
normal.Normalize();
|
||||
if (normal.SquareMagnitude() > 0.0) {
|
||||
normal.Normalize();
|
||||
}
|
||||
normals.emplace_back(normal.X(), normal.Y(), normal.Z());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user