Skip to content

Commit c796d57

Browse files
committed
Fem: Symbol scaling on vertex
1 parent 1f9be3f commit c796d57

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Mod/Fem/App/FemConstraint.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <BRepAdaptor_CompCurve.hxx>
2929
#include <BRepAdaptor_Curve.hxx>
3030
#include <BRepAdaptor_Surface.hxx>
31+
#include <BRepBndLib.hxx>
3132
#include <BRepClass_FaceClassifier.hxx>
3233
#include <BRepGProp.hxx>
3334
#include <BRepGProp_Face.hxx>
@@ -280,11 +281,11 @@ bool Constraint::getPoints(std::vector<Base::Vector3d>& points,
280281
gp_Pnt p = BRep_Tool::Pnt(vertex);
281282
points.emplace_back(p.X(), p.Y(), p.Z());
282283
normals.push_back(NormalDirection.getValue());
283-
// OvG: Scale by whole object mass in case of a vertex
284-
GProp_GProps props;
285-
BRepGProp::VolumeProperties(toposhape.getShape(), props);
286-
double lx = props.Mass();
287-
// OvG: setup draw scale for constraint
284+
// Scale by bounding box of the object in case of a vertex
285+
Bnd_Box box;
286+
BRepBndLib::Add(toposhape.getShape(), box);
287+
double l = sqrt(box.SquareExtent() / 3.0);
288+
double lx = pow(l, 3);
288289
*scale = this->calcDrawScaleFactor(sqrt(lx) * 0.5);
289290
}
290291
else if (sh.ShapeType() == TopAbs_EDGE) {

0 commit comments

Comments
 (0)