Search in sources :

Example 21 with ControlPanel

use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.

the class TorusWrapTest method createControlPanel.

private void createControlPanel(MechModel mech) {
    ControlPanel panel = new ControlPanel("options", "");
    panel.addWidget(mech, "integrator");
    panel.addWidget(mech, "maxStepSize");
    panel.addWidget(mech, "gravity");
    panel.addWidget(mech, "multiPointSprings/spring:drawKnots");
    panel.addWidget(mech, "multiPointSprings/spring:drawABPoints");
    panel.addWidget(mech, "multiPointSprings/spring:wrapDamping");
    panel.addWidget(mech, "multiPointSprings/spring:maxWrapIterations");
    addControlPanel(panel);
    Main.getMain().arrangeControlPanels(this);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Example 22 with ControlPanel

use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.

the class TwoStrandWrapBase method createControlPanel.

private void createControlPanel(MechModel mech) {
    ControlPanel panel = new ControlPanel("options", "");
    panel.addWidget(mech, "integrator");
    panel.addWidget(mech, "maxStepSize");
    panel.addWidget(mech, "gravity");
    panel.addWidget(mech, "multiPointSprings/spring:drawKnots");
    panel.addWidget(mech, "multiPointSprings/spring:drawABPoints");
    panel.addWidget(mech, "multiPointSprings/spring:wrapDamping");
    panel.addWidget(mech, "multiPointSprings/spring:maxWrapIterations");
    addControlPanel(panel);
    Main.getMain().arrangeControlPanels(this);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Example 23 with ControlPanel

use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.

the class CylinderWrapping method createControlPanel.

private void createControlPanel(MultiPointSpring spring) {
    ControlPanel panel = new ControlPanel("options", "");
    panel.addWidget(this, "models/mechMod:integrator");
    panel.addWidget(this, "models/mechMod:maxStepSize");
    panel.addWidget(this, "models/mechMod:gravity");
    panel.addWidget(spring, "drawKnots");
    panel.addWidget(spring, "drawABPoints");
    addControlPanel(panel);
    Main.getMain().arrangeControlPanels(this);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Example 24 with ControlPanel

use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.

the class RigidBodyCollision method build.

public void build(String[] args) throws IOException {
    try {
        mechmod = new MechModel();
        mechmod.setMaxStepSize(0.005);
        boxes = new ArrayList<RigidBody>();
        table = new RigidBody("table");
        table.setDynamic(false);
        table.setMesh(new PolygonalMesh(new File(rbpath + "box.obj")), null);
        AffineTransform3d trans = new AffineTransform3d();
        trans.setIdentity();
        trans.applyScaling(4, 2, 0.5);
        table.transformGeometry(trans);
        table.setPose(new RigidTransform3d(new Vector3d(0, 0, 0.8077474533228615), new AxisAngle()));
        table.setInertia(SpatialInertia.createBoxInertia(1, 1, 1, 1));
        mechmod.addRigidBody(table);
        boxes.add(table);
        if (wireFrame) {
            setWireFrame(table);
        }
        // middle box in pile
        box0 = new RigidBody("box0");
        box0.setMesh(new PolygonalMesh(new File(rbpath + "box.obj")), null);
        trans.setIdentity();
        trans.applyScaling(0.5, 0.5, 0.5);
        box0.transformGeometry(trans);
        box0.setInertia(SpatialInertia.createBoxInertia(4, 1, 1, 1));
        addBox(box0, Color.GREEN);
        if (wireFrame) {
            setWireFrame(box0);
        }
        // long thin box, bottom of pile
        box1 = new RigidBody("box1");
        box1.setMesh(new PolygonalMesh(new File(rbpath + "box.obj")), null);
        trans.setIdentity();
        trans.applyScaling(0.6, 0.1, 1.9);
        box1.transformGeometry(trans);
        box1.setInertia(SpatialInertia.createBoxInertia(1, 1, 0.1, 4));
        addBox(box1, Color.YELLOW);
        if (wireFrame) {
            setWireFrame(box1);
        }
        // left hand box falling on unsupported end of
        box2 = new RigidBody("box2");
        // box1
        box2.setMesh(new PolygonalMesh(new File(rbpath + "box.obj")), null);
        trans.setIdentity();
        trans.applyScaling(0.5, 0.5, 0.5);
        box2.transformGeometry(trans);
        box2.setInertia(SpatialInertia.createBoxInertia(20, 1, 1, 1));
        addBox(box2, Color.BLUE);
        if (wireFrame) {
            setWireFrame(box2);
        }
        // top box in pile
        box3 = new RigidBody("box3");
        box3.setMesh(new PolygonalMesh(new File(rbpath + "box.obj")), null);
        trans.setIdentity();
        trans.applyScaling(0.4, 0.4, 0.4);
        box3.transformGeometry(trans);
        box3.setInertia(SpatialInertia.createBoxInertia(0.5, 0.5, 0.5, 4));
        addBox(box3, Color.CYAN);
        // box3.getMesh().name = "box3";
        if (wireFrame) {
            setWireFrame(box3);
        }
        // solo box off to the right.
        box4 = new RigidBody("box4");
        box4.setMesh(new PolygonalMesh(new File(rbpath + "box.obj")), null);
        trans.setIdentity();
        trans.applyScaling(0.6, 0.6, 0.3);
        box4.transformGeometry(trans);
        box4.setInertia(SpatialInertia.createBoxInertia(0.5, 0.5, 0.5, 4));
        box4.setPose(new RigidTransform3d(new Vector3d(1, 0.0, 5), new AxisAngle(0, 0, 0, 0)));
        addBox(box4, Color.RED);
        // box4.getMesh().name = "box4";
        if (wireFrame) {
            setWireFrame(box4);
        }
        mechmod.setDefaultCollisionBehavior(true, 0.05);
        reset();
        addModel(mechmod);
        ControlPanel panel = new ControlPanel();
        panel.addWidget(mechmod, "integrator");
        panel.addWidget(mechmod, "maxStepSize");
        addControlPanel(panel);
        Main.getMain().arrangeControlPanels(this);
        CollisionManager cm = mechmod.getCollisionManager();
        RenderProps.setVisible(cm, true);
        RenderProps.setLineWidth(cm, 3);
        RenderProps.setLineColor(cm, Color.RED);
        cm.setDrawContactNormals(true);
        // addBreakPoint (0.74);
        for (int i = 1; i <= 10; i++) {
            addWayPoint(0.1 * i);
        }
    // setWaypointChecking (true);
    } catch (IOException e) {
        throw e;
    }
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) IOException(java.io.IOException) PolygonalMesh(maspack.geometry.PolygonalMesh) MechModel(artisynth.core.mechmodels.MechModel) AxisAngle(maspack.matrix.AxisAngle) CollisionManager(artisynth.core.mechmodels.CollisionManager) Vector3d(maspack.matrix.Vector3d) ControlPanel(artisynth.core.gui.ControlPanel) RigidBody(artisynth.core.mechmodels.RigidBody) File(java.io.File) AffineTransform3d(maspack.matrix.AffineTransform3d)

Example 25 with ControlPanel

use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.

the class SkinDemo method addPanel.

public void addPanel() {
    // JFrame frame = driver.getFrame();
    panel = new ControlPanel("Muscle Control", "");
    panel.addWidget("Activation", model, "axialSprings/muscle:excitation", 0.0, 1.0);
    panel.addWidget("alpha", this, "alpha");
    panel.pack();
    panel.setVisible(true);
    // java.awt.Point loc = frame.getLocation();
    // panel.setLocation(loc.x + frame.getWidth(), loc.y);
    addControlPanel(panel);
    Main.getMain().arrangeControlPanels(this);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Aggregations

ControlPanel (artisynth.core.gui.ControlPanel)35 FemControlPanel (artisynth.core.gui.FemControlPanel)10 Point (artisynth.core.mechmodels.Point)3 File (java.io.File)3 IOException (java.io.IOException)3 InternalErrorException (maspack.util.InternalErrorException)3 LabeledComponentBase (maspack.widgets.LabeledComponentBase)3 CollisionManager (artisynth.core.mechmodels.CollisionManager)2 MechModel (artisynth.core.mechmodels.MechModel)2 RigidBody (artisynth.core.mechmodels.RigidBody)2 WayPoint (artisynth.core.probes.WayPoint)2 RootModel (artisynth.core.workspace.RootModel)2 BooleanSelector (maspack.widgets.BooleanSelector)2 Main (artisynth.core.driver.Main)1 FemModel3d (artisynth.core.femmodels.FemModel3d)1 FemMuscleModel (artisynth.core.femmodels.FemMuscleModel)1 MuscleBundle (artisynth.core.femmodels.MuscleBundle)1 LinearAxialMuscle (artisynth.core.materials.LinearAxialMuscle)1 AxialSpring (artisynth.core.mechmodels.AxialSpring)1 Muscle (artisynth.core.mechmodels.Muscle)1