Rigid body constraint
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Rigid body constraint
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
Ahh do not forget to read https://github.com/FreeCAD/FreeCAD/blob ... entions.md
Re: Rigid body constraint
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.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
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.
Re: Rigid body constraint
@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?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
My latest (or last) project: B-spline Construction Project.
-
- Posts: 42
- Joined: Sun Jun 30, 2019 12:56 pm
Re: Rigid body constraint
xhttps://forum.freecadweb.org/viewtopic.php?p=532527#p532527
I came across this series of posts started by:
Theory, sorry about this:
If all nodes have 6 degrees of freedom, dof, then we have a lever matrix thus:
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:
I have left the zeros in, but they should be removed as they serve no purpose. This can be input into "*EQUATION" thus:
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.
I came across this series of posts started by:
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.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:...
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
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
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
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
Re: Rigid body constraint
@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.
Re: Rigid body constraint
Sorry for not getting to this sooner. Do you mean the python script generates Calculix file or NASTRAN?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.
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.
Re: Rigid body constraint
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.
Re: Rigid body constraint
I can get a snap build for you if you have a Linux install.
My latest (or last) project: B-spline Construction Project.
-
- Posts: 522
- Joined: Mon Feb 27, 2017 5:33 am
- Location: Australia
Re: Rigid body constraint
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/