I agree with you, an MBDyn simulation is far too complex for the much simpler task of an assembly, and will be terribly slow if an MBDyn simulation has to be performed every time the user updates one part, however, I would suspect that with MBDyn it may be possible to solve exclusively the kinematics of an assembly, and skip the dynamics. Since for an asembly workbench we are only interested on the kinematics, and skipping all the dynamics simulations will make MBDyn much faster. I still have to learn Modelica. I've heard of it but have no experience with it.saso wrote: ↑Tue Nov 12, 2019 3:56 pmYes, lately I was actually thinking about something similar, this is why I asked this questionsjosegegas wrote: ↑Tue Nov 12, 2019 12:23 pm I actually think that MBDyn can do as the definitive asembly workbench for FreeCAD. As you can see in my videos, the parts move perfectly because MBDyn takes care of the assembly, it looks for all the constraints and everything. I'm quite existed about this.
I was however thinking about doing it with Modelica, since Modelica is a language, we could even write our own libraries with it, if some of the existing ones would not be useful for our needs... But I am not preferring one solution over the other, similar to how we can use different solvers for FEM/CFD it would be IMO good to also have support for different solutions for simulations.
But directly using something like this for the assembly solver I am not sure if it is really possible. For assembling the model (from different parts and sub-assemblies) the user does not really need all the power of such simulation engines, what s/he needs however is a very fast (real time) solver, simulation engines however normally need some time (in complex models it can actually be a very long time) to "solve" the simulation. So, for the basic assembly we would need a simplified version of such a simulation engine with a sort of JIT compiler OR a combination of a more standard assembly constraints/mates and a more advanced ones for simulations (and I think most commercial parametric cad software is doing it like this).
This is however actually also one of the reasons for this post https://forum.freecadweb.org/viewtopic.php?f=8&t=40775, if Modelica, as a language, is a step further from the simulation packages and libraries, then DifferentialEquations.jl and SUNDIALS projects are another step further in to research of the best algorithms and mathematics that are behind this.
Pd. What about using the same FreeCAD sketch solver to solve assemblies? The sketch solver is able to "solve basic assemblies" quite fast. This is actually what I started doing some time ago:
https://www.youtube.com/watch?v=BHbnOlBvpLI&t=327s
It's pretty straightforward. The script just changes the one constraint in a sketch, then read the values of reference constraints, and then move the 3D parts... Here's the basic idea:
https://www.youtube.com/watch?v=uHEJ3IyaSFk&t=145s