Package org.djutils.draw.curve
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>
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 Summary
ConstructorsConstructorDescriptionBezierCubic3d
(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.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.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.BezierCubic3d
(Point3d[] points) Create a cubic Bézier curve.BezierCubic3d
(Point3d start, Point3d control1, Point3d control2, Point3d end) Create a cubic Bézier curve. -
Method Summary
Methods inherited from class org.djutils.draw.curve.Bezier3d
derivative, equals, getPoint, getX, getY, getZ, hashCode, length, size, toPolyLine, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.draw.curve.Curve
getKnots, getPoint, toPolyLine
Methods inherited from interface org.djutils.draw.curve.Curve3d
getDirection, getEndDirection, getEndPoint, getStartDirection, getStartPoint
Methods inherited from interface org.djutils.draw.curve.Flattener.FlattableCurve
getPoint
-
Constructor Details
-
BezierCubic3d
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
- whenstart
,control1
,control2
, orend
isnull
-
BezierCubic3d
Create a cubic Bézier curve.- Parameters:
points
- array containing four Point2d objects- Throws:
NullPointerException
- whenpoints
isnull
, or contains anull
valueIllegalArgumentException
- when length ofpoints
is not equal to4
-
BezierCubic3d
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 curveend
- the end point and end direction of the Bézier curve- Throws:
NullPointerException
- whenstart
, orend
isnull
IllegalArgumentException
- whenstart
andend
are at the same location
-
BezierCubic3d
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 curveend
- the end point and end direction of the Bézier curveshape
- 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
- whenstart
, orend
isnull
IllegalArgumentException
- whenstart
andend
are at the same location,shape ≤ 0
,shape
isNaN
, or infinite
-
BezierCubic3d
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 curveend
- the end point and end direction of the Bézier curveshape
- 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 finiteweighted
- control point distance relates to distance to projected point on extended line from other end- Throws:
NullPointerException
- whenstart
, orend
isnull
IllegalArgumentException
- whenstart
andend
are at the same location,shape ≤ 0
,shape
isNaN
, or infinite
-
-
Method Details
-
getLength
public double getLength()Description copied from interface:Curve
Return the length of this Curve.- Specified by:
getLength
in interfaceCurve<DirectedPoint3d,
Direction3d, Point3d, Flattener3d, PolyLine3d> - Overrides:
getLength
in classBezier3d
- Returns:
- length of this Curve
-