pyBar

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

Opened a mantis ticket for this - issue #1313
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: pyBar

Post by bernd »

How could I missed this disscusion. I have't time at all today but I can't help it writing a few hints. I do not know pybar. I even do not speak french at all :( But it seams really interesting. Is there any english docoumentation available?
yorik wrote: ... We could add to structural elements something like the sketch grid ... Some visual widget that you can turn on/off, that would show the structural nodes and lines of an object. ...
Would be just brilliant even for walls and floors.

Mainly you guy are disscussing how to transform a geometrical model in an analytical model. This kind of work is every day buissness for me at work but mostly for building shell which contains shapes and plate. Trusses I have been converting only a few. (http://www.youtube.com/watch?v=Vwmrb7X8UZ8 and http://www.youtube.com/watch?v=1ItEgs4TX48) But videos are not up to date.

To give you guys hope. Even the best structural calculation software packages still have big problems with the task of converting geometrical modells to analytical modells. The engineer has to to the rest depending on how good the software transfered the model. This mainly excactly for the reason disscussed here. The geometrical model consists of solids (volumes) and the analytical model only uses axes (trusses) or planes (slabs and plates). Ideally the axes of trusses meet in a point and the planes of plates and slabs meet in a line. But in reallity this mostly does not happen at all. 8-)

Most mechanics do not have the axis problem because they directly use volume elements to do structural calculations. This is what the FEM Modul of Jürgen is going to do in the future. See the videos in this thread (viewtopic.php?f=18&t=4190#p33193)

For trusses mostly the following 2 solutions are used (I need to think if there are more which makes sense):
1 The method shown in the video. Between the end points of the elements an kontact element is added which connects the trusses together. Big problem here is, if a few trusses connect at one point it could cause nummerical problems depending on the length of the kontakt element (could be only 0.0001 cm or 10 cm). And if one would set recessed and relaxed nodes it is difficault because there are a lot nodes in the zone where the trusses are connect to each other.

2 A parameter is given. For example 10 cm, and during the transformation of the geometrical modell to the analytical model all trusses endpoints which are inside a zone of 10 cm are just connected together at one point. Means for the video. If the space between the elements are less than 10 cm the element end points are automatically moved together. For the analytical model this is the way one would go if he had to put in the analytical model by hand. But if the software does it automatically sometimes happens funny things :-) with your model.

It is quite difficult to write such stuff in an foreign language. Bernd
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

Great, this discussion is really getting somewhere.
pybar is only in french I'm afraid, but with a bit of incentive that could maybe be changed. Implementing a translation framework is not too hard. There is no non-french doc, but this video should be more or less understandable: https://vimeo.com/14692092

Basically it calculates reactions, internal efforts and moments of a planar structure. Might not be the best software available, but it has several very interesting features for us: it is made in python, it is simple to manipulate, and the input format is very easy to handle...
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: pyBar

Post by bernd »

Thanks for the link. It's a cool little tool to calculate this kind of 2D Structures rockn has shown in this thread. It's a pitty even the file format of pyBar is in french. But yes it is understandable how it works. Would be nice if it gets translated. Rockn, are you really using this tool or it is just some play ground?

I'm really interested in this converting geometrical modells to analytical models too. Most of the fileformats of the 2D truss calculation software are similar and not that difficult to generate if you know the axis, nodes and cross sections of the bars.

The easiest would be modell the truss in FreeCAD the way the axis of the bars meet each other but than it is unusable for construction drawings.

A start point for the export would be to go for the second solution I made in the post before. Just move the endpoints of the trusses together if they are inside a given value (mabe 10 cm). For the calculation of internal forces, displacements it often makes not a big difference but it could make one ... Mostly it gives a cleaner model without this contact elements. But question would be move both points together or move one to the other. Which one should move which one stays? Easiest would may be to move both to the half of the Euclidean distance between the end points of the bar axis. But this could result in bars which have been exact horizontal are no longer horizontal and bars which have been exact vertical are no longer vertical because one end point of the bar has moved. If a column is no longer exact vertical this could result in hight bending moment because of a hight normal force. and so on and so on. Nothing which not could be solved by a great community :).

YEAH, it would be great to make it possible to export from FreeCAD to calculation software. :)
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

This is basically what I imagine to do for now:
nodes.jpg
nodes.jpg (16.67 KiB) Viewed 4214 times
For each structural member (and other types later too) you can define a series of nodes (they are set by default when you create the member, but you can change). Then, a line passes through all those nodes. If you are not happy with the default ones, you can change them manually. We can add some helper tools too for example to extend the line of one member until it intersects another.

I think that would be a good start, and the door would be open for export to pybar already. Seems good to you guys?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: pyBar

Post by bernd »

yorik wrote:... For each structural member (and other types later too) you can define a series of nodes (they are set by default when you create the member, but you can change). Then, a line passes through all those nodes... If you are not happy with the default ones, you can change them manually. We can add some helper tools too for example to extend the line of one member until it intersects another. ...
brilliant idea. One hint. It would be goot to keep the original geometrical axis of a element. They are may be called geometrical axis of a element. If one changes an axis make a copy and make the colour different and call them may be axis for analytical calculation. The user would know which axis he has changed manually. Export the analytical axis and if there is no one take the geometrical one.
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: pyBar

Post by rockn »

@berndhahnebach : I was wondering when you were coming to this discussion. ;)
To answer you : I use pyBar a little for little assembly like this trusse because it's long and difficult to calculate all equation in each bar..
I have spreadsheets for simple elements like rafters, purlins, column. I have also a spreadsheet who need only the stress.
And pyBar is cool to get weighted stress, of course I need to analysed with eye the combinaison the worst combination and I need to evaluate the x position where moment is the most important.
UTOPIA ON : I also decided to make my engineering office only with free software ;)

Yes we are speaking about how to transform a geometrical model in an analytical model and it's awesome that Yorik is interessed by this. And I think it's important to keep in mind that the calculating step is as important as architecture step.

@Yorik : seems good to me ;)
Formations - Assistance - Développement : https://freecad-france.com
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: pyBar

Post by bernd »

rockn wrote:...UTOPIA ON : I also decided to make my engineering office only with free software ;) ...
You are not the only one who is dreaming of this. The good thing is we are not only dreaming we are going up the stair quite slowly but step by step.
rockn wrote: ... it's awesome that Yorik is interessed by this ...
+1
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: pyBar

Post by rockn »

Hello !
I look the FEM module (don't work well cause I have to install NetGen) but if I understand well it's a module to calculate the effort in object.
Is it possible to adapt this to apply force to Arch Elements ? And get results ?
Formations - Assistance - Développement : https://freecad-france.com
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: pyBar

Post by bernd »

rockn wrote:... but if I understand well it's a module to calculate the effort in object.
Is it possible to adapt this to apply force to Arch Elements ? And get results ?
As any Arch Element has a shape (which is usually a solid or a compound) it shold be possible to use the FEM WB to generate a FEM Net to an Arch Element using netgen and to calculate the displacements and thus the internal forces using another external software calculix. The FEM module is on my long term to do list.I have'nt tried it yet. May be the question should be asked in the FEM part of the forum. Jürgen knows it better sure as death.

But all examples of the FreeCAD FEM Module I saw use 3D Volume Elements for net generation and calculation. If 3D-Volume Elements are used the problem will be how to integrate the results to get forces if your arch element is an bar or slab. I do not know if the FEM-Module and netgen supports 1D or 2D FEM net generation as well, but than again you will have the axis problem disscussed earlier in this thread. A good start to see how things work out are the video in this thread viewtopic.php?f=18&t=4190#p33193 and the wiki page of fem wb http://freecadweb.org/wiki/index.php?title=FEM_project

I'd be curious if you gone give it a try. Bernd

EDIT:
Netgen is capable of meshing shell (2D) and solid (3D) FEM-meshes. (For 1D a seperate mesh software is not really needed because the mesh is given by the model.) Calculix is capable of calculating beam (1D), shell (2D) and solid (3D) elements.
Post Reply