Karana.Dynamics.fa2ta
=====================

.. py:module:: Karana.Dynamics.fa2ta

.. autoapi-nested-parse::

   Convert a FA model into a TA model.

   Consider converting to C++.



Classes
-------

.. autoapisummary::

   Karana.Dynamics.fa2ta.TreeConverter


Module Contents
---------------

.. py:class:: TreeConverter(parent_prefs: collections.abc.Mapping[int, int] = {}, skip_prefs: collections.abc.Mapping[int, int] = {}, verbose: bool = False)

   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.



   .. py:attribute:: donebds
      :value: []



   .. py:attribute:: skipbds
      :value: []



   .. py:attribute:: donelcs
      :value: []



   .. py:attribute:: parent_prefs


   .. py:attribute:: skip_prefs


   .. py:attribute:: todo
      :value: []



   .. py:attribute:: visited
      :type:  list[Karana.Dynamics.PhysicalBody]
      :value: []



   .. py:attribute:: verbose
      :value: False



   .. py:method:: canConvertToHinge(lc: Karana.Dynamics.LoopConstraintBase, basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])

      Return whether the loop constraint can be converted to a hinge.

      It must be hinge-based an have at least one free body



   .. py:method:: convertToHinge(lc: Karana.Dynamics.LoopConstraintCutJoint, basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])

      Convert the loop constraint into a hinge and return the new child body.



   .. py:method:: convertBranch(bd: Karana.Dynamics.PhysicalBody, basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])

      Convert this body'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.



   .. py:method:: convertBranchBF(basebds: collections.abc.Container[Karana.Dynamics.PhysicalBody])

      Convert this body'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.



