Rigid body constraint

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: Rigid body constraint

Post by bernd »

Normally after all this above I start with the gui. We even could merge such an object without gui. It is not user friendly for gui user, but with example and unit test the code is robust. Something what is important IMHO

Ahh do not forget to read https://github.com/FreeCAD/FreeCAD/blob ... entions.md
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

bernd wrote: Mon Nov 07, 2022 7:33 am Normally after all this above I start with the gui. We even could merge such an object without gui. It is not user friendly for gui user, but with example and unit test the code is robust. Something what is important IMHO

Ahh do not forget to read https://github.com/FreeCAD/FreeCAD/blob ... entions.md
Hi thanks for the info. Indeed I guess the app and test first approach is the best. Unfortunately I was relearning rigid body constraint in INP at the same time as implementing this, and the GUI route felt better.

And indeed I already did read the coding conventions, but it was a while ago and I don't usually work on FEM. Sorry if the pr is not fully compliant. I'll try to make it better. If there are some glaring errors you see please let me know.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

bernd wrote: Mon Nov 07, 2022 7:28 am What I normally do If I create a new object is to create a example as well. Since I do start with object and writer and at last do the gui I need some python to create the object anyway. Some more python and the example is ready. See for example this git commit 94c0522c38
@bernd I just now looked at the example in details. I can't use it directly yet, though, because I still didn't get to put the new nodes in. I realize that you did direct me to how this can be done but couldn't make much out of it. Is there an example where a constraint adds a point?
My latest (or last) project: B-spline Construction Project.
mac_the_bike
Posts: 42
Joined: Sun Jun 30, 2019 12:56 pm

Re: Rigid body constraint

Post by mac_the_bike »

xhttps://forum.freecadweb.org/viewtopic.php?p=532527#p532527
I came across this series of posts started by:
Post by NewJoker » Fri Aug 06, 2021 5:35 pm
I've noticed that rigid body constraint is not yet implemented in FreeCAD. It's a very common and useful CalculiX feature that has 3 main applications:...
I am not sure what you mean - but if you mean something like an RBE2, NASTRAN, "element", then I have written a python script to generate one for a set of nodes.
Theory, sorry about this:
If all nodes have 6 degrees of freedom, dof, then we have a lever matrix thus:

Code: Select all

     d1 = | 1, 0, 0,    0, -dz,  dy | i1
     d2 = | 0, 1, 0,   dz,   0, -dx | i2
     d3 = | 0, 0, 1,  -dy,  dx,   0 | i3
     d4 = | 0, 0, 0,    1,   0,   0 | i4
     d5 = | 0, 0, 0,    0,   1,   0 | i5
     d6 = | 0, 0, 0,    0,   0,   1 | i6
In short:
     D = L * I
where, typically:
d1 is the dependent node x translation
d4 is the dependent node x rotation
i? are the equivalent for the independent node
d1 looks like "2.1", i.e. node 2 displacement 1.
dx is x(dependent) - x(independent)
In calculix nodes only have 3 dof, so the lever matrix is only the first three rows of the matrix L and D contains the first three entries.
i1, i2 and i3 are used for the translations. i4, i5 and i6 have to be replaced by something like the "*ROT NODE" in "*RIGID BODY"; they are renamed to r1, r2 and r3 and are used for the rotations. "I" then looks like [ i1, i2, i3, r1, r2, r3 ]. This matrix relationship can de implemented by the use of the "*EQUATION" input option. See:
https://web.mit.edu/calculix_v2.7/Calc ... e200.html
For example, if the first row of the new lever matrix is used, it can be rearranged into the "*EQUATION" format, noting that the first node must be the dependent node:

Code: Select all

d1 * -1 + i1 * 1 + i2 * 0 + i3 * 0 + r1 * 0 - r2 * dz + r3 * dy = 0
I have left the zeros in, but they should be removed as they serve no purpose. This can be input into "*EQUATION" thus:

Code: Select all

d, 1, -1,       i, 1, 1,          r, 2, -dz,         r, 3, dy
e.g.:
*EQUATION
4
40, 1, -1.0,    11000, 1, 1.0,    11001, 2, -5.0,    11001, 3, 0.0
It is important that dx, dy and dz are output to the maximum number of significant digits if Rigid Body Motion is to be retained. Also, there must be 2 or more dependent nodes to eliminate mechanisms.
The attached code generates this data for a specified set of nodes, see the top of the file for details of input. The output is to the Python Console. This should really have a "ui" to input the values. It also uses an idea from aerospaceweeb, (Feature Request/Inquiry: MPC and RBE elements), to generate a spider showing the connections.
Question:
Does anybody know how "*RIGID BODY" works, I don't mean what is the input?
I don't understand how you can apply a rotation, with "*BOUNDARY", using a "*ROT NODE", without specifying a point through which the rotation vector passes.
Attachments
mpc.py
(6.35 KiB) Downloaded 43 times
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

@NewJoker what's your opinion on the status of this feature? It won't to be ready for 0.21, but it can be done soon after.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

mac_the_bike wrote: Sat Nov 19, 2022 1:03 pm
I am not sure what you mean - but if you mean something like an RBE2, NASTRAN, "element", then I have written a python script to generate one for a set of nodes.
...
Question:
Does anybody know how "*RIGID BODY" works, I don't mean what is the input?
I don't understand how you can apply a rotation, with "*BOUNDARY", using a "*ROT NODE", without specifying a point through which the rotation vector passes.
Sorry for not getting to this sooner. Do you mean the python script generates Calculix file or NASTRAN?

As for your questions, I believe the point is assumed to be the "ref node" if it's provided, or center of gravity. The documentation is linked somewhere in this thread, though I don't have it readily in hand. Let me know if you can't find it out.
My latest (or last) project: B-spline Construction Project.
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Rigid body constraint

Post by NewJoker »

jnxd wrote: Tue May 30, 2023 5:17 pm @NewJoker what's your opinion on the status of this feature? It won't to be ready for 0.21, but it can be done soon after.
I still haven't been able to compile FreeCAD from the source (even the original one). But if it works properly (even with some limitations at the moment), I would definitely like to see it merged after the feature freeze for the 0.21 release is over. Additional features can be added later, after testing in weekly builds.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Rigid body constraint

Post by jnxd »

NewJoker wrote: Tue May 30, 2023 6:20 pm I still haven't been able to compile FreeCAD from the source (even the original one).
I can get a snap build for you if you have a Linux install.
My latest (or last) project: B-spline Construction Project.
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Rigid body constraint

Post by NewJoker »

jnxd wrote: Sat Jun 03, 2023 4:12 am I can get a snap build for you if you have a Linux install.
I only have Windows on all of my computers but I'll try to figure it out and I'll let you know if I have an option to test this in any way. Meanwhile, maybe some other testers could help us.
Laurie Hartley
Posts: 522
Joined: Mon Feb 27, 2017 5:33 am
Location: Australia

Re: Rigid body constraint

Post by Laurie Hartley »

NewJoker wrote: Sat Jun 03, 2023 5:01 pm
jnxd wrote: Sat Jun 03, 2023 4:12 am I can get a snap build for you if you have a Linux install.
I only have Windows on all of my computers but I'll try to figure it out and I'll let you know if I have an option to test this in any way. Meanwhile, maybe some other testers could help us.
I can’t help with the testing (way beyond my abilities) however if you have a spare hour or so you might consider creating a live Linux bootable USB with persistence. I have run a snap of FreeCAD on MX Linux.

https://youtu.be/KvVKY4DFAfc
https://mxlinux.org/wiki/system/create- ... s-desktop/
Post Reply