/** * Generate a plausible new shape from the scaling vector. The scaling * vector is constrained by the underlying {@link Constraint} before being * used to generate the model. * * @param scaling * scaling vector. * @return a new shape */ public PointList generateNewShape(double[] scaling) { final PointList newShape = new PointList(); final double[] pts = pc.generate(constraint.apply(scaling, pc.getEigenValues())); for (int i = 0; i < pts.length; i += 2) { final float x = (float) pts[i]; final float y = (float) pts[i + 1]; newShape.points.add(new Point2dImpl(x, y)); } return newShape; }