use of maspack.geometry.DelaunayInterpolator in project artisynth_core by artisynth.
the class MuscleBundle method getFibreRestDistanceInterpolator.
public DelaunayInterpolator getFibreRestDistanceInterpolator() {
if (myFibres.size() == 0) {
return null;
}
Point3d pos1 = new Point3d();
Point3d pos2 = new Point3d();
Point3d loc = new Point3d();
Point3d[] muscleLocs = new Point3d[myFibres.size()];
for (int i = 0; i < myFibres.size(); i++) {
Muscle fibre = myFibres.get(i);
getRestPosition(pos1, fibre.getFirstPoint());
getRestPosition(pos2, fibre.getSecondPoint());
loc.add(pos2, pos1);
loc.scale(1 / 2.0);
muscleLocs[i] = new Point3d(loc);
}
DelaunayInterpolator interpolator = new DelaunayInterpolator();
interpolator.setPoints(muscleLocs);
return interpolator;
}
Aggregations