DiscoverLearnDocumentationGet OpenPLXSearch Contact

MachineModeling/Actuators/Linear/Traits/RigidCylinderPart.openplx

RigidCylinderPart

trait RigidCylinderPart:
    .doc: """
    A trait for upgrading a rigid body to
    one of the two parts of a Linear Cylinder Actuator.
    """
    connector is Physics3D.Interactions.MateConnector:
        main_axis: Math.Vec3.Y_AXIS()
        normal: Math.Vec3.X_AXIS()
    internal_connector is Physics3D.Interactions.MateConnector:
        main_axis: Math.Vec3.Z_AXIS()
        normal: Math.Vec3.X_AXIS()
    length is Real
    diameter is Real
    cylinder is Physics3D.Geometries.Cylinder:
        height: length
        radius: diameter * 0.5
        local_transform:
            rotation: Math.Quat.from_to(Math.Vec3.Y_AXIS(), Math.Vec3.Z_AXIS())
            position: Math.Vec3.from_xyz(0, 0, length * 0.5)

OpenPLX is a work in progress. This draft version will evolve with user feedback and experience. We welcome your input and collaboration.
X