Karana.Dynamics.fa2ta#
Convert a FA model into a TA model.
Consider converting to C++.
Classes#
Class to do an FA to TA conversion on a Multibody |
Module Contents#
- class Karana.Dynamics.fa2ta.TreeConverter(parent_prefs: collections.abc.Mapping[int, int] | None = None, skip_prefs: collections.abc.Mapping[int, int] | None = None, verbose: bool = False)[source]#
Class to do an FA to TA conversion on a Multibody
Whenever a hinge-based loop constraint is between a pair of bodies where at least one of the bodies is FULL6DOF, the loop constraint can be converted to a regular hinge. Using this approach, this class can greedily convert fully or partially FA models to TA models with a minimal number of loop constraints, reducing the total number of constraints and degrees of freedom in the system.
- donebds = []#
- skipbds = []#
- donelcs = []#
- parent_prefs#
- skip_prefs#
- todo = []#
- visited = []#
- verbose = False#
- canConvertToHinge(lc: Karana.Dynamics.LoopConstraintBase, basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])[source]#
Whether the loop contraint can be converted to a hinge
It must be hinge-based an have at least one free body
- convertToHinge(lc: Karana.Dynamics.LoopConstraintHinge, basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])[source]#
Convert the loop constraint into a hinge and return the new child body.
- convertBranch(bd: Karana.Dynamics.PhysicalBody, basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])[source]#
Convert this bd’s loop constraints to hinges, and continue down the branch to do this for downstream bodies as well. If bd is in the basebds list, then use it as the parent body.
- convertBranchBF(basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])[source]#
Convert this bd’s loop constraints to hinges, and continue down the branch to do this for downstream bodies as well. If bd is in the basebds list, then use it as the parent body. Breadth first traverse.