+ support of linear b-spline/bezier curves and planar b-spline/bezier surfaces to get direction
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#endif
|
||||
|
||||
#include "FemConstraint.h"
|
||||
#include "FemTools.h"
|
||||
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
#include <Base/Console.h>
|
||||
@@ -322,25 +323,6 @@ const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub &direct
|
||||
str << "No such sub-element '" << subName << "'";
|
||||
throw Base::AttributeError(str.str());
|
||||
}
|
||||
gp_Dir dir;
|
||||
|
||||
if (sh.ShapeType() == TopAbs_FACE) {
|
||||
BRepAdaptor_Surface surface(TopoDS::Face(sh));
|
||||
if (surface.GetType() == GeomAbs_Plane) {
|
||||
dir = surface.Plane().Axis().Direction();
|
||||
} else {
|
||||
return Base::Vector3d(0,0,0); // "Direction must be a planar face or linear edge"
|
||||
}
|
||||
} else if (sh.ShapeType() == TopAbs_EDGE) {
|
||||
BRepAdaptor_Curve line(TopoDS::Edge(sh));
|
||||
if (line.GetType() == GeomAbs_Line) {
|
||||
dir = line.Line().Direction();
|
||||
} else {
|
||||
return Base::Vector3d(0,0,0); // "Direction must be a planar face or linear edge"
|
||||
}
|
||||
}
|
||||
|
||||
Base::Vector3d the_direction(dir.X(), dir.Y(), dir.Z());
|
||||
the_direction.Normalize();
|
||||
return the_direction;
|
||||
return Fem::Tools::getDirectionFromShape(sh);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user