Skip to content

propopsed changes to python preprocessor

this merge request includes the following addition and changes:

  • remove the assertions to check whether classes are given as arguments to nodes, total joints, etc.
    • why? to allow more liberal definition of nodes inside logical loops, example:
nodeTuple = (
                        ('R','A') + tuple(['B'+str(x)+'d' for x in range(0,N)])
                        + tuple(['H'+str(x)+'d' for x in range(0,N)])
                        + tuple(['S'+str(x)+'d' for x in range(0,5)])
                        )

for i in nodeTuple:
        nodes.append(DynamicRefNode(i, i))
  • creation of a placement class, to simplify the definition of positions and rotations for complex linkages, by allowing to define new references using their relative position and orientation with respect to another reference
    • example and explanation::
## vector from global to airframe
GeA=MBPlacement(
        'A',
        'G',
        ( 0.,
        -p.airframe['belowRotor'],
        0.,
        0.,
        0.,
        0. ))
## PLACEMENT DEFINITIONS
 # name part for origin of direction vector
 # name part for destination of direction vector
 # x-component
 # y-component
 # z-component
 # Euler123, angle 1 in degrees
 # Euler123, angle 2 in degrees
 # Euler123, angle 3 in degrees
##
  • addition of a dimension multiplier to, for example, scale output for visualization or convert units
    • example: DimMult(0.1) # ie: i'm working in millimeters, but actually multiplying by (100 ie: 0.1) at the time to see joints in Blendyn to scale
  • adding the following elements: Reference, StaticRefNode, DynamicRefNode, AxialRot, DeformDisp, RodJoint, DistJoint, RevHinge, SphereHinge
  • MBIntList and MBIntAutoList to ease the definition of multiple variables -- example:
MBIntList({'R':100},'!')
MBIntAutoList(['A'],200,'!j')
MBIntAutoList(['AjR'],201,'!')

One I know which of the proposed changes you accept I will update the README and provide an example file.

Merge request reports

Loading