Search in sources :

Example 21 with MuscleBundle

use of artisynth.core.femmodels.MuscleBundle in project artisynth_core by artisynth.

the class HydrostatInvDemo method addInverseController.

protected void addInverseController() {
    trackingController = new TrackingController(mech, "tcon");
    for (ModelComponent comp : hydro.createTargetList()) {
        trackingController.addMotionTarget((MotionTargetComponent) comp);
    }
    if (useBundlesForInverse) {
        for (MuscleBundle b : hydro.getMuscleBundles()) {
            trackingController.addExciter(b);
            Color exColor = b.getRenderProps().getLineColor();
            b.setExcitationColor(exColor);
            RenderProps.setLineColor(b, Color.WHITE);
        }
    } else {
        for (ExcitationComponent exciter : hydro.getMuscleExciters()) {
            trackingController.addExciter(exciter);
        }
    }
    trackingController.addL2RegularizationTerm(100 * 100);
    trackingController.setProbeDuration(5.0);
    trackingController.setProbeUpdateInterval(stepsize);
    trackingController.createProbesAndPanel(this);
    addController(trackingController);
}
Also used : MuscleBundle(artisynth.core.femmodels.MuscleBundle) ModelComponent(artisynth.core.modelbase.ModelComponent) Color(java.awt.Color) ExcitationComponent(artisynth.core.mechmodels.ExcitationComponent) TrackingController(artisynth.core.inverse.TrackingController)

Example 22 with MuscleBundle

use of artisynth.core.femmodels.MuscleBundle in project artisynth_core by artisynth.

the class FemMuscleDemo method createBundle.

protected MuscleBundle createBundle(String name, List<FemElement3d> elems) {
    MuscleBundle bundle = new MuscleBundle(name);
    if (elems != null) {
        for (FemElement3d e : elems) {
            MuscleElementDesc desc = new MuscleElementDesc();
            desc.setElement(e);
            desc.setDirection(Vector3d.X_UNIT);
            bundle.addElement(desc);
        }
    }
    return bundle;
}
Also used : MuscleBundle(artisynth.core.femmodels.MuscleBundle) FemElement3d(artisynth.core.femmodels.FemElement3d) MuscleElementDesc(artisynth.core.femmodels.MuscleElementDesc)

Example 23 with MuscleBundle

use of artisynth.core.femmodels.MuscleBundle in project artisynth_core by artisynth.

the class HydrostatModel method addTubeMuscles.

public void addTubeMuscles() {
    // createTubeHelixMuscles();
    for (TubeAxis a : TubeAxis.values()) {
        MuscleBundle b = new MuscleBundle(a.name().toLowerCase());
        addMuscleBundle(b);
        createTubeMuscles(a, b);
    }
    if (simpleMuscleGroupingsP) {
        addSimpleTubeExciters();
        colorExciters(new String[] { "radial", "circ", "long_s", "long_i" }, false);
    } else {
        addTubeExciters();
        colorExciters(new String[] { "long_rp", "long_rm", "long_ra", "long_lp", "long_lm", "long_la", "long_sp", "long_sm", "long_sa", "long_ip", "long_im", "long_ia", "radial_a", "radial_p", "circ_a", "circ_p" }, false);
    }
}
Also used : MuscleBundle(artisynth.core.femmodels.MuscleBundle)

Example 24 with MuscleBundle

use of artisynth.core.femmodels.MuscleBundle in project artisynth_core by artisynth.

the class HydrostatModel method addBeamMuscles.

public void addBeamMuscles() {
    if (useExcitersP) {
        for (Axis a : Axis.values()) {
            MuscleBundle b = new MuscleBundle(a.getDirName());
            addMuscleBundle(b);
            createMuscles(a, b);
        }
        if (simpleMuscleGroupingsP) {
            addSimpleExciters();
            // colorBundles (new String[]{"vert","horz"}, false);
            colorExciters(new String[] { "vert", "horz", "long_s", "long_i" }, false);
        } else {
            addExciters();
            colorExciters(new String[] { "long_rp", "long_rm", "long_ra", "long_lp", "long_lm", "long_la", "long_sp", "long_sm", "long_sa", "long_ip", "long_im", "long_ia", "vert_a", "vert_p", "horz_a", "horz_p" }, false);
        // "vert_a", "vert_m", "vert_p", "horz_a", "horz_m", "horz_p"});
        }
    } else {
        for (Axis a : Axis.values()) createMuscles(a, a.getDirName());
        addBundles();
        if (useFullAnteriorPosteriorMuscles) {
            colorBundles(new String[] { "long_rp", "long_rm", "long_ra", "long_lp", "long_lm", "long_la", "long_sp", "long_sm", "long_sa", "long_ip", "long_im", "long_ia", "vert_a", "vert_am", "vert_ma", "vert_m", "vert_mp", "vert_pm", "vert_p", "vert_fixed", "horz_a", "horz_am", "horz_ma", "horz_m", "horz_mp", "horz_pm", "horz_p", "horz_fixed" }, false);
        } else {
            colorBundles(new String[] { "long_rp", "long_rm", "long_ra", "long_lp", "long_lm", "long_la", "long_sp", "long_sm", "long_sa", "long_ip", "long_im", "long_ia", "vert_a", "vert_p", "horz_a", "horz_p" }, false);
        }
    }
}
Also used : MuscleBundle(artisynth.core.femmodels.MuscleBundle)

Example 25 with MuscleBundle

use of artisynth.core.femmodels.MuscleBundle in project artisynth_core by artisynth.

the class SpongeDemo method addControls.

protected void addControls(ControlPanel panel) {
    FemControlPanel.addMuscleControls(panel, sponge, sponge);
    panel.addWidget(sponge, "profile");
    if (sponge.getMuscleBundles().size() > 0) {
        ComponentList<MuscleBundle> muscles = ((SpongeModel) sponge).getMuscleBundles();
        for (int i = 0; i < muscles.size(); ++i) {
            // sponge.getMuscleList().get(i).setName(String.valueOf(i));
            DoubleFieldSlider slider = (DoubleFieldSlider) panel.addWidget("excitation [N]", sponge, "bundles/" + i + ":excitation", 0, 1);
            slider.setRoundingTolerance(0.001);
            int idx = i % NumericProbePanel.colorList.length;
            slider.getLabel().setForeground(NumericProbePanel.colorList[idx]);
        }
    }
    panel.addWidget(new JSeparator());
    panel.addWidget("gang 0-2", sponge, "exciters/gang:excitation");
    panel.addWidget("all muscles", sponge, "exciters/all:excitation");
}
Also used : MuscleBundle(artisynth.core.femmodels.MuscleBundle) Point(java.awt.Point) JSeparator(javax.swing.JSeparator) DoubleFieldSlider(maspack.widgets.DoubleFieldSlider)

Aggregations

MuscleBundle (artisynth.core.femmodels.MuscleBundle)25 Muscle (artisynth.core.mechmodels.Muscle)6 FemElement3d (artisynth.core.femmodels.FemElement3d)4 ConstantAxialMuscle (artisynth.core.materials.ConstantAxialMuscle)4 Point3d (maspack.matrix.Point3d)4 FemMuscleModel (artisynth.core.femmodels.FemMuscleModel)3 Point (artisynth.core.mechmodels.Point)3 Color (java.awt.Color)3 DoubleFieldSlider (maspack.widgets.DoubleFieldSlider)3 TrackingController (artisynth.core.inverse.TrackingController)2 SimpleForceMuscle (artisynth.core.materials.SimpleForceMuscle)2 MuscleExciter (artisynth.core.mechmodels.MuscleExciter)2 Point (java.awt.Point)2 LinkedList (java.util.LinkedList)2 RenderProps (maspack.render.RenderProps)2 FemMarker (artisynth.core.femmodels.FemMarker)1 FemMeshComp (artisynth.core.femmodels.FemMeshComp)1 FemNode (artisynth.core.femmodels.FemNode)1 FemNode3d (artisynth.core.femmodels.FemNode3d)1 MuscleElementDesc (artisynth.core.femmodels.MuscleElementDesc)1