Fem constraint, distance of symbols

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Fem constraint, distance of symbols

Post by bernd »

I'm playing with the Fem WB and run into trouble because of huge performance problems ...

Since I'm structural engin. the models I'm playing with reach from 2 meters to 50 m. The Fem constraint symbols (the red arrows and boxes) are in a raster of 10 mm. Means on a face of 1 by 1 m there are allready 10000 symbols. :o :shock:

Just tried to adjust this. I checked ViewProviderFemConstraint.cpp and TaskFemConstraint.cpp Found how to adjust the size and the shape of the sympols but I could just not found were to adjust the distance between the symbols. Could someone point me to the right pice of code?
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Fem constraint, distance of symbols

Post by wmayer »

void ViewProviderFemConstraintForce::updateData(const App::Property* prop) and there the call of createArrow
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Fem constraint, distance of symbols

Post by bernd »

wmayer wrote:void ViewProviderFemConstraintForce::updateData(const App::Property* prop) and there the call of createArrow
Thanks Werner. Found that one before but I could neiter found how to change sep nor where is defined inside sep the distance is 10 mm. sep is Type SoSeparator(). My C++ is just too smal ... :(

Mhh found a workaround ... Go get a cup of koffee or two ... :o :shock: The arrows show up even if there are thousands ... Afterwards Visibility can be turned off in view. The constraints are editable even if the symbol is not visible.

I'll come back to this for sure because this needs to be attracked at some point ...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Fem constraint, distance of symbols

Post by bernd »

Found it :D ... Just as a reminder the informations.

The points where the arrows are drawn are a property of the FreeCAD ForceObject

Code: Select all

>>> App.ActiveDocument.FemConstraintForce.Points
[Vector (0.0, 0.0, 80.0), Vector (100.0, 0.0, 80.0), Vector (0.0, 100.0, 80.0), Vector (100.0, 100.0, 80.0)]
but it is read only

Code: Select all

>>> App.ActiveDocument.FemConstraintForce.Points = []
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'DocumentObject' attribute 'Points' is read-only
src/Mod/Fem/App/FemConstraintForce.cpp
https://github.com/FreeCAD/FreeCAD_sf_m ... tForce.cpp

Code: Select all

ConstraintForce::ConstraintForce()
{
...
    ADD_PROPERTY_TYPE(Points, (Base::Vector3d()),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
                      "Points where arrows are drawn");
...}
the step between the points is defined in
src/Mod/Fem/App/FemConstraint.cpp
https://github.com/FreeCAD/FreeCAD_sf_m ... traint.cpp

Code: Select all

const bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vector<Base::Vector3d> &normals) const
{
...
}
watch out for for steps, stepsv, stepsu
Post Reply