FEM: Implement constraint displacement in C++

This commit is contained in:
vginkeo
2016-02-11 08:55:57 +02:00
parent ff4d7ad365
commit 034e377dd0
30 changed files with 2277 additions and 42 deletions

View File

@@ -173,9 +173,9 @@ const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vecto
normals.push_back(NormalDirection.getValue());
//OvG: Scale by whole object mass in case of a vertex
GProp_GProps props;
BRepGProp::VolumeProperties(toposhape._Shape, props);
double lx = props.Mass();
*scale = this->calcDrawScaleFactor(sqrt(lx)); //OvG: setup draw scale for constraint
BRepGProp::VolumeProperties(toposhape._Shape, props);
double lx = props.Mass();
*scale = this->calcDrawScaleFactor(sqrt(lx)*0.5); //OvG: setup draw scale for constraint
} else if (sh.ShapeType() == TopAbs_EDGE) {
BRepAdaptor_Curve curve(TopoDS::Edge(sh));
double fp = curve.FirstParameter();
@@ -185,7 +185,7 @@ const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vecto
double l = props.Mass();
// Create points with 10 units distance, but at least one at the beginning and end of the edge
int steps;
if (l >= 100) //OvG: Increase 10 units distance proportionately to l for larger objects.
if (l >= 30) //OvG: Increase 10 units distance proportionately to l for larger objects.
{
*scale = this->calcDrawScaleFactor(l); //OvG: setup draw scale for constraint
steps = (int)round(l / (10*( *scale)));
@@ -232,7 +232,7 @@ const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vecto
isoc.Load(GeomAbs_IsoV, ulp);
double lu = (l + GCPnts_AbscissaPoint::Length(isoc, Precision::Confusion()))/2.0;
int stepsv;
if (lv >= 100) //OvG: Increase 10 units distance proportionately to lv for larger objects.
if (lv >= 30) //OvG: Increase 10 units distance proportionately to lv for larger objects.
{
*scale = this->calcDrawScaleFactor(lv,lu); //OvG: setup draw scale for constraint
stepsv = (int)round(lv / (10*( *scale)));
@@ -250,7 +250,7 @@ const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vecto
}
stepsv = stepsv>CONSTRAINTSTEPLIMIT?CONSTRAINTSTEPLIMIT:stepsv; //OvG: Place upper limit on number of steps
int stepsu;
if (lu >= 100) //OvG: Increase 10 units distance proportionately to lu for larger objects.
if (lu >= 30) //OvG: Increase 10 units distance proportionately to lu for larger objects.
{
*scale = this->calcDrawScaleFactor(lv,lu); //OvG: setup draw scale for constraint
stepsu = (int)round(lu / (10*( *scale)));