Package toxi.geom

Class BezierCurve3D

java.lang.Object
toxi.geom.BezierCurve3D

public class BezierCurve3D extends Object
Standard multi-segment bezier curve implementation with optional automatic handle alignment between segments. Also provides curve tangent calculation feature. Can be used to create closed curves. Usage of this class is very similar to Spline3D.
  • Constructor Details

    • BezierCurve3D

      public BezierCurve3D()
    • BezierCurve3D

      public BezierCurve3D(List<Vec3D> points)
  • Method Details

    • computePointInSegment

      public static Vec3D computePointInSegment(Vec3D a, Vec3D b, Vec3D c, Vec3D d, float t)
    • computeTangentInSegment

      public static Vec3D computeTangentInSegment(Vec3D a, Vec3D b, Vec3D c, Vec3D d, float t)
    • add

      public BezierCurve3D add(Vec3D p)
    • alignAllHandles

      public void alignAllHandles()
    • alignHandlesForPoint

      public void alignHandlesForPoint(int id)
    • isClosed

      public boolean isClosed()
      Returns:
      true, if the curve is closed. I.e. the first and last control point coincide.
    • toLineStrip3D

      public LineStrip3D toLineStrip3D(int res)
      Computes a list of intermediate curve points for all segments. For each curve segment the given number of points will be produced.
      Parameters:
      res - number of points per segment
      Returns:
      list of Vec3Ds