Search in sources :

Example 1 with PointFrameAttachment

use of artisynth.core.mechmodels.PointFrameAttachment in project artisynth_core by artisynth.

the class FemBeamWithBlock method build.

public void build(String[] args) throws IOException {
    // Build simple FemBeam
    super.build(args);
    // Create a rigid block and move to the side of FEM
    RigidBody block = RigidBody.createBox("block", width / 2, 1.2 * width, 1.2 * width, 2 * density);
    mech.addRigidBody(block);
    block.setPose(new RigidTransform3d(length / 2 + width / 4, 0, 0));
    // Attach right-side nodes to rigid block
    for (FemNode3d node : fem.getNodes()) {
        if (node.getPosition().x >= length / 2 - EPS) {
            mech.addAttachment(new PointFrameAttachment(block, node));
        }
    }
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) FemNode3d(artisynth.core.femmodels.FemNode3d) RigidBody(artisynth.core.mechmodels.RigidBody) PointFrameAttachment(artisynth.core.mechmodels.PointFrameAttachment)

Aggregations

FemNode3d (artisynth.core.femmodels.FemNode3d)1 PointFrameAttachment (artisynth.core.mechmodels.PointFrameAttachment)1 RigidBody (artisynth.core.mechmodels.RigidBody)1 RigidTransform3d (maspack.matrix.RigidTransform3d)1