use of com.xenoage.utils.math.geom.ConvexHull in project Zong by Xenoage.
the class DefaultCurvedLineStrategy method computeCurvedLine.
@Override
public CubicBezierCurve computeCurvedLine(List<Point2f> points, VSide side) {
ConvexHull convexHull = ConvexHull.create(points, side);
List<QuadraticCurve> quadCurves = QuadraticCurvesTools.computeOverConvexHull(convexHull, ENDPOINT_TOLERANCE_LP, ENDPOINT_TOLERANCE_LP);
QuadraticCurve bestQuadCurve = QuadraticCurvesTools.getBestCurve(quadCurves, convexHull);
CubicBezierCurve bestBezierCurve = BezierCurveTools.computeBezierFrom(bestQuadCurve, points.get(0).x, points.get(points.size() - 1).x);
bestBezierCurve = BezierCurveTools.correctBezier(bestBezierCurve, side);
return bestBezierCurve;
}
Aggregations