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);
}
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;
}
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);
}
}
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);
}
}
}
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");
}
Aggregations