Class CubicCurveToQuadCurves

java.lang.Object
org.jhotdraw8.geom.CubicCurveToQuadCurves

public class CubicCurveToQuadCurves extends Object
Approximates a cubic Bézier curve with quadratic Bézier curves.

References:

Proc. ACM Comput. Graph. Interact. Tech., Vol. 3, No. 2, Article 16. Publication date: August 2020. Quadratic Approximation of Cubic Curves. NGHIA TRUONG, University of Utah, CEM YUKSEL, University of Utah, LARRY SEILER, Facebook Reality Labs. Copyright 2020 held by the owner/author(s). Publication rights licensed to ACM.
ttnghia.github.io
  • Constructor Details

    • CubicCurveToQuadCurves

      public CubicCurveToQuadCurves()
  • Method Details

    • approximateCubicCurve

      public int approximateCubicCurve(double[] p, int offsetP, double[] q, int offsetQ, double tolerance)
      Approximates a cubic curve with up to 8 quadratic curves.
      Parameters:
      p - the points of the cubic curve
      offsetP - the index of the first point in p
      q - the points of the quadratic curves (on output, must space for up to 8*6=48 coords).
      offsetQ - the index of the first point in q
      Returns:
      the number of quadratic curves