Class BezierCubic3d

java.lang.Object
org.djutils.draw.curve.Bezier3d
org.djutils.draw.curve.BezierCubic3d
All Implemented Interfaces:
Curve<DirectedPoint3d,Direction3d,Point3d,Flattener3d,PolyLine3d>, Curve3d, Flattener.FlattableCurve<Point3d,Direction3d>

public class BezierCubic3d extends Bezier3d implements Curve3d
Continuous definition of a cubic Bézier curves in 3d. This extends from the more general Bezier as certain methods are applied to calculate e.g. the roots, that are specific to cubic Bézier curves. With such information this class can also specify information to be a Curve.

Copyright (c) 2023-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • BezierCubic3d

      public BezierCubic3d(Point3d start, Point3d control1, Point3d control2, Point3d end)
      Create a cubic Bézier curve.
      Parameters:
      start - start point.
      control1 - first intermediate shape point.
      control2 - second intermediate shape point.
      end - end point.
      Throws:
      NullPointerException - when start, control1, control2, or end is null
    • BezierCubic3d

      public BezierCubic3d(Point3d[] points)
      Create a cubic Bézier curve.
      Parameters:
      points - array containing four Point2d objects
      Throws:
      NullPointerException - when points is null, or contains a null value
      IllegalArgumentException - when length of points is not equal to 4
    • BezierCubic3d

      public BezierCubic3d(Ray3d start, Ray3d end)
      Approximate a cubic Bézier curve from start to end with two generated control points at half the distance between start and end.
      Parameters:
      start - the start point and start direction of the Bézier curve
      end - the end point and end direction of the Bézier curve
      Throws:
      NullPointerException - when start, or end is null
      IllegalArgumentException - when start and end are at the same location
    • BezierCubic3d

      public BezierCubic3d(Ray3d start, Ray3d end, double shape)
      Approximate a cubic Bézier curve from start to end with two generated control points at half the distance between start and end.
      Parameters:
      start - the start point and start direction of the Bézier curve
      end - the end point and end direction of the Bézier curve
      shape - 1 = control points at half the distance between start and end, > 1 results in a pointier shape, < 1 results in a flatter shape, value should be above 0 and finite
      Throws:
      NullPointerException - when start, or end is null
      IllegalArgumentException - when start and end are at the same location, shape ≤ 0, shape is NaN, or infinite
    • BezierCubic3d

      public BezierCubic3d(Ray3d start, Ray3d end, double shape, boolean weighted)
      Approximate a cubic Bézier curve from start to end with two generated control points at half the distance between start and end.
      Parameters:
      start - the start point and start direction of the Bézier curve
      end - the end point and end direction of the Bézier curve
      shape - 1 = control points at half the distance between start and end, > 1 results in a pointier shape, < 1 results in a flatter shape, value should be above 0 and finite
      weighted - control point distance relates to distance to projected point on extended line from other end
      Throws:
      NullPointerException - when start, or end is null
      IllegalArgumentException - when start and end are at the same location, shape ≤ 0, shape is NaN, or infinite
  • Method Details