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:

pyBar

Post by yorik »

I recently discovered this simple but very interesting structural calculation application: http://pybar.fr/index.php?page=logiciel-pybar It's simple, it's only in french (that can be easily solved), but it works very well and it's in python. The input file format is very simple. It gives me quite a lot of ideas...
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: pyBar

Post by rockn »

Yeah pyBar rocks and it is regularly updated.
It's funny because I just started a project that requires a verification calculations parts.
I have to design an octagonal wooden kiosk. It is between 40 and 50 m² in size and I have some trusses to verify.
It could be great to have Import/Export of the structure and why not the loading.

Here is a french discussion (I am peterp@n on forum.ubuntu-fr.org) that can be interesting for software structure calculations.

Very good to hear that pyBar give you some ideas.
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

Wow, that's quite a long discussion... Reminds me the frame wall you had been doing some time ago, I moved it to the Arch forum so I can find it back later.

Basically I thought the file format of pyBar is pretty clear and simple... Such data (at least the geometry) could be exported from FreeCAD maybe... What I'm still not sure of is how the concept of nodes would enter, that is, how we can define the intersection or let's say node point between 2 structural elements. I don't know how other structural softwares do that...

After that we could easily have a force object, and later on other structural elements can behave as a force themselves... Food for thought.

I sent a mail to the author of pybar, to see if he would be interested in putting some ideas on the table too
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: pyBar

Post by rockn »

Hi,
To find the intersection we need to have the neutral fiber of structural element.
We need to find the point of intersection of the neutral fiber.
Let's draw a trusses with Arch Element or get it from a model.
FermeArch.jpg
FermeArch.jpg (32.59 KiB) Viewed 5831 times
Then project the external structure on floor and draw the neutral fiber (red).
But I'm pretty sure that you can get the neutral fiber directly from the Arch Element and then project it to get intersections.
There can be a work of trim/ex on lines.
In fact in this exemple I started with neutral fiber to place my Arch elements.
FermeLine.jpg
FermeLine.jpg (28.78 KiB) Viewed 5831 times
Now we have the coordinates of each node and there are 14.In pyBar I need only 10 nodes so we can delete the duplicates.
For each lines (7) in FreeCAD we need to define the list of nodes which compose it. is it possible to know if a point is on a line ?
Normally we get 13 bars (4 for horizontal bar, 2x2 for rafters, 2 for diagonals and 3 for the king post) to define the 7 arch elements. As long as I do not get to use my right to multiple nodes bar function in pyBar.
The difficulty is to set the relaxing of node. There is much spherical liaison in wood construction and much recessed liaison in metal construction. Normally we need the material of the element and constructive system ends (we have to wait materials and assembly workbench perhaps).
That would be great to be able to export the coordinates of the points and the definition of bars pyBar format. This is what takes the most time.

I hope I'm clear...
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

Interesting discussion... This gives me other ideas.
Indeed finding the neutral line of an element is easy. Usually it would be: take the center point of the base profile, and extrude it along the extrusion vector. We could easily add a method to all structural elements, that return 2 points and a bar. Finding intersections between bars is rather easy too, there is code for that already in the DraftGeomUtils module.

Your red drawing makes me think of this: imagine that we have a structural construction, like your truss here. What would be a smart workflow to export it to pyBar? Select all the elements, press an export button and that's it? Probably not, because the code that would export might do wrong guesses about where and which bars to intersect.

So we would need an intermediary step. Collect all the elements, and create the pyBar scheme, and possibly change or adjust the nodes.I was thinking first, the Drawing module could help with that, but maybe it would be a good opportunity to implement something more generic, a general way of defining intersection points between structural members. This way, the day someone wants to implement something else than pyBar, part of the work is already done.

But I have no idea of how that works in other civil engineering software. Someone has experience on that?
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: pyBar

Post by NormandC »

rockn wrote:I am peterp@n on forum.ubuntu-fr.org
Le monde est petit, I'm Gemnoc on the same forum. We exchanged a few replies about FreeCAD in the "conception mécanique" topic. :)
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: pyBar

Post by rockn »

Yorik wrote:Your red drawing makes me think of this: imagine that we have a structural construction, like your truss here. What would be a smart workflow to export it to pyBar? Select all the elements, press an export button and that's it? Probably not, because the code that would export might do wrong guesses about where and which bars to intersect.
To export to pyBar the steps are to make a list of nodes and the decomposition of line.
Exemple : There is two bars (X0-X2 and X1-X3) and one intersection point.

Code: Select all

      X3
      |
      |
X0----X1-----X2
I see it like this.
Get all coordinates nodes.
nodeX0 = x,y
nodeX1 = x1,y1
nodeX2 = x2,y2
nodeX3 = x3,y3
For each line in FreeCAD, test if nodes are on line and detect the position related of start to make a list with order nodes.
Line1 = (nodeX0,nodeX1,nodeX2)
Line2 = (nodeX1,nodeX3)
With this we can make the decomposition of line that pyBar need.
B1 = nodeX0,nodeX1
B2 = nodeX1,nodeX2
B3 = nodeX1,nodeX3
This will build a simple structure in pyBar witch all nodes are recessed (not relaxed).
It remains the user to place releases, supports and loads.
Yorik wrote:So we would need an intermediary step. Collect all the elements, and create the pyBar scheme, and possibly change or adjust the nodes.I was thinking first, the Drawing module could help with that, but maybe it would be a good opportunity to implement something more generic, a general way of defining intersection points between structural members. This way, the day someone wants to implement something else than pyBar, part of the work is already done.
Yes there is some concept to implement, I think of the concept of type of ends of structure
If you take the exemple above I need to release the NodeX1 in B3 if I want a rotule liason between Line1 et Line2.
We can imagine that the information of type of end of Line2 give the information that NodeX1 in B3 is relaxed.

I learn Autodesk Robot Structural Analysis a few years ago. It's a really huge gaz engine.
Basically we need to draw a wired model in space, and define each element (material, dimension, type of connection at the ends, service class, what checks are to do). An exemple of liaison between elements in Revit and the export to Structural Analysishttp://youtu.be/YpD8DAeWl6E It's hard to find It is difficult to find information about the operation of the softwares.
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

rockn wrote:I learn Autodesk Robot Structural Analysis a few years ago. It's a really huge gaz engine.
Basically we need to draw a wired model in space, and define each element (material, dimension, type of connection at the ends, service class, what checks are to do). An exemple of liaison between elements in Revit and the export to Structural Analysishttp://youtu.be/YpD8DAeWl6E It's hard to find It is difficult to find information about the operation of the softwares.
Very interesting.. They face the same problem as us. Yesterday I've been thinking: "And if we do the contrary? If you must first draw a big sketch, then place a structural element on each line of the sketch" but that seems a bit rigid... No way to easily move the individual elements... And also that wouldn't be very practical for non-planar situations.

But we could do something a bit like in the revit video: a structural member (when it is based on an extruded profile), defines 2 nodes automatically (that would be the two endpoints of an extrusion line that passes through the center point of the base profile). But you, as the user, would have the possibility to modify those nodes and give them arbitrary locations. So it would be your responsibility to set these points correctly if you want intersections to be calculated. Later on we can of course imagine some helper tools to help with that.

But I also think, in your example above, that the object X0-X2 should be aware of X1... That could be interesting later (for example export it alone, and apply a force at that point). We could then imagine the structural nodes of an object as an array of points... You could add as many as you want. That could also be useful for example to approximate arcs...

This seems a good start to me. 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.

Can you clarify what is recessed and relaxed nodes? These concepts are new to me :)
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Post by rockn »

Yorik wrote:Very interesting.. They face the same problem as us. Yesterday I've been thinking: "And if we do the contrary? If you must first draw a big sketch, then place a structural element on each line of the sketch" but that seems a bit rigid... No way to easily move the individual elements... And also that wouldn't be very practical for non-planar situations.
Like I have say I have created the example above with starting to draw the fiber neutral line and place the Arch Structure elements after.
Yorik wrote:But we could do something a bit like in the revit video: a structural member (when it is based on an extruded profile), defines 2 nodes automatically (that would be the two endpoints of an extrusion line that passes through the center point of the base profile). But you, as the user, would have the possibility to modify those nodes and give them arbitrary locations. So it would be your responsibility to set these points correctly if you want intersections to be calculated. Later on we can of course imagine some helper tools to help with that.
But I also think, in your example above, that the object X0-X2 should be aware of X1... That could be interesting later (for example export it alone, and apply a force at that point). We could then imagine the structural nodes of an object as an array of points... You could add as many as you want. That could also be useful for example to approximate arcs...
Yes I think about it too. Like armatures we can add an Intersection properties to arch structure object. We have to manually select all entities that intersect the first element and then we can have a signal if node/line are not coincident...And then we can modify those nodes and give them arbitrary locations like you says.
Yorik wrote:This seems a good start to me. 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.
Very good start !!!
Yorik wrote:Can you clarify what is recessed and relaxed nodes? These concepts are new to me :)
Yes, I don't know if I use the right terms in english.
Recessed or Not Relaxed is an assembly like a weld so there is a transfert force lever arm. There is no degrees of freedom.
Relaxed is an assembly made with only one bolt (for exemple) so the elements can rotate. There is the degrees of freedom in rotating axes. But for exemple in timber construction it's usually relaxed liaison that are use even if there 3 or 4 bolts in assembly.
It's a recessed liaison when there is a crown bolts.
Hope I'm clear.
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: pyBar

Post by yorik »

rockn wrote:Yes, I don't know if I use the right terms in english.
Recessed or Not Relaxed is an assembly like a weld so there is a transfert force lever arm. There is no degrees of freedom.
Relaxed is an assembly made with only one bolt (for exemple) so the elements can rotate. There is the degrees of freedom in rotating axes. But for exemple in timber construction it's usually relaxed liaison that are use even if there 3 or 4 bolts in assembly.
It's a recessed liaison when there is a crown bolts.
Hope I'm clear.
Got it perfectly! Thanks!
Post Reply