Shapes 3D  3.0
 All Classes Functions Variables Pages
shapes3d.path.BSpline3D Class Reference
Inheritance diagram for shapes3d.path.BSpline3D:

Public Member Functions

 BSpline3D (float[] x, float[] y, int nbrSlices)
 
 BSpline3D (float[] x, float[] y, float[] z, int nbrSlices)
 
 BSpline3D (List< PVector > knots, int nbrSlices)
 
 BSpline3D (List< PVector > knots, int nbrSlices, PathOrthogonal ortho)
 
 BSpline3D (PVector[] knots, int nbrSlices)
 
 BSpline3D (PVector[] knots, int nbrSlices, PathOrthogonal ortho)
 
PVector point (float t)
 
PVector tangent (float t)
 
- Public Member Functions inherited from shapes3d.path.AbstractPath
int nbrSlices ()
 
PVector tangent (float t)
 
PVector orthogonal (float t)
 
boolean isOpenPath ()
 

Protected Attributes

BCurve3D[] bcurve3d
 
float[] tMax
 
float[] tLength
 
- Protected Attributes inherited from shapes3d.path.AbstractPath
final int DEFAULT_NBR_SLICES = 100
 
final int nbrSlices
 
boolean pathIsOpen = true
 

Additional Inherited Members

- Public Attributes inherited from shapes3d.path.AbstractPath
PathOrthogonal orthoCalculator = null
 
- Public Attributes inherited from shapes3d.utils.SConstants
int WIRE = 0x00000011
 
int SOLID = 0x00000012
 
int TEXTURE = 0x00000014
 
int DRAWALL = WIRE | SOLID | TEXTURE
 
int WHITE = 0xFFFFFFFF
 
int BLACK = 0xFF000000
 
int GREY = 0xFFC0C0C0
 
int RED = 0xFFFF0000
 
int GREEN = 0xFF00FF00
 
int BLUE = 0xFF0000FF
 
int YELLOW = 0xFFFFFF00
 
int PURPLE = 0xFFFF00FF
 
int CYAN = 0xFF00FFFF
 
int ORANGE = 0xFFFFC000
 
int CW = 1
 
int CCW = 2
 
int ALL = 0b11111111
 
int BOTTOM = 0b00000001
 
int TOP = 0b00000010
 
int FRONT = 0b00000100
 
int BACK = 0b00001000
 
int LEFT = 0b00010000
 
int RIGHT = 0b00100000
 
int BODY = 0b00000001
 
int END0 = 0b00000010
 
int END1 = 0b00000100
 
float ONE_DEG_T = (float) (Math.PI / 180.0)
 
PathOrthogonal ORTHO_X = new PathOrthogonal.PathNormalX()
 
PathOrthogonal ORTHO_Y = new PathOrthogonal.PathNormalY()
 
PathOrthogonal ORTHO_Z = new PathOrthogonal.PathNormalZ()
 
PathOrthogonal ORTHO_A = new PathOrthogonal.PathNormalAMC()
 
TransformUV ROT_0 = TransformUV.ROT0
 
TransformUV ROT_90 = TransformUV.ROT90
 
TransformUV ROT_180 = TransformUV.ROT180
 
TransformUV ROT_270 = TransformUV.ROT270
 
TransformUV FLIP_H = TransformUV.FLIPH
 
TransformUV FLIP_V = TransformUV.FLIPV
 
Rotation ROTATION_ZERO = new Rotation()
 
int T_BOX = 0x1001
 
int T_DOME = 0x1002
 
int T_CONE = 0x1003
 
int T_ELLIPSOID = 0x1004
 
int T_EXTRUSION = 0x1005
 
int T_LATHESTOCK = 0x1006
 
int T_MD2 = 0x1007
 
int T_SKYBOX = 0x1008
 
int T_SKYDOME = 0x1009
 
int T_TERRAIN = 0x100A
 
int T_TUBE = 0x100B
 
int C_LATHESURFACE = 0x2001
 
int C_OVAL = 0x2002
 
int C_POLYGON = 0x2003
 
int P_BCURVE2D = 0x3001
 
int P_BCURVE3D = 0x3002
 
int P_BSPLINE2D = 0x3003
 
int P_BSPLINE3D = 0x3004
 
int P_LINEAR = 0x3005
 
int P_LISSAJOUS = 0x3006
 
int P_RING = 0x3007
 
int P_SPIRAL = 0x3008
 
- Protected Member Functions inherited from shapes3d.path.AbstractPath
 AbstractPath ()
 
 AbstractPath (int nbrSlices)
 

Detailed Description

This class defines a Bezier spline in 3D space that passes through a set of given points (called knots). It can also be used in 2D space by using z=0 when creating the knots.

The curve between each pair of points is a cubic Bezier curve and the controls points are calculated to give a smooth transition along the spline.

The position along the spline can be found using a parametric variable in the range ≥0 and ≤1

Based on source code found on the Internet and modified by the author to work directly with Processing. The URL for the original code has been lost).

Author
Peter Lager

Constructor & Destructor Documentation

shapes3d.path.BSpline3D.BSpline3D ( float[]  x,
float[]  y,
int  nbrSlices 
)

Creates a Bezier spline using two arrays for the x and y positions for each control point (z = 0).
If the arrays passed to this constructor differ in length the extra in the longer array are ignored.

Parameters
xarray of the x values of the control point positions
yarray of the y values of the control point positions
nbrSlicesthe number of slices along the curve's length Creates a Bezier spline using three arrays for the x, y and z positions for each control point.
If the arrays passed to this constructor differ in length the extra in the longer array are ignored.
xarray of the x values of the control point positions
yarray of the y values of the control point positions
zarray of the z values of the control point positions
nbrSlicesthe number of slices along the curve's length Create a Bezier spline that passes through the specified positions
knotslist of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
orthothe orthogonal calculator to use Create a Bezier spline that passes through the specified positions
knotslist of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
orthothe orthogonal calculator to use Create a Bezier spline that passes through the specified positions
knotsarray of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path Create a Bezier spline that passes through the specified positions
knotsarray of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
orthothe orthogonal calculator to use Creates a Bezier spline using two arrays for the x and y positions for each control point (z = 0).
If the arrays passed to this constructor differ in length the extra in the longer array are ignored.
xarray of the x values of the control point positions
yarray of the y values of the control point positions
nbrSlicesthe number of slices along the curve's length
shapes3d.path.BSpline3D.BSpline3D ( float[]  x,
float[]  y,
float[]  z,
int  nbrSlices 
)

Creates a Bezier spline using three arrays for the x, y and z positions for each control point.
If the arrays passed to this constructor differ in length the extra in the longer array are ignored.

Parameters
xarray of the x values of the control point positions
yarray of the y values of the control point positions
zarray of the z values of the control point positions
nbrSlicesthe number of slices along the curve's length
shapes3d.path.BSpline3D.BSpline3D ( List< PVector >  knots,
int  nbrSlices 
)

Create a Bezier spline that passes through the specified positions

Parameters
knotslist of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
orthothe orthogonal calculator to use
shapes3d.path.BSpline3D.BSpline3D ( List< PVector >  knots,
int  nbrSlices,
PathOrthogonal  ortho 
)

Create a Bezier spline that passes through the specified positions

Parameters
knotslist of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
orthothe orthogonal calculator to use
shapes3d.path.BSpline3D.BSpline3D ( PVector[]  knots,
int  nbrSlices 
)

Create a Bezier spline that passes through the specified positions

Parameters
knotsarray of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
shapes3d.path.BSpline3D.BSpline3D ( PVector[]  knots,
int  nbrSlices,
PathOrthogonal  ortho 
)

Create a Bezier spline that passes through the specified positions

Parameters
knotsarray of PVectors defining the spline.
nbrSlicesthe number of slices along the length of the path
orthothe orthogonal calculator to use

Member Function Documentation

PVector shapes3d.path.BSpline3D.point ( float  t)
virtual

Method defines the function V = pos(t) where t is in the range ≥0.0 and ≤1.0

Parameters
tparametric value ≥0.0 and ≤1.0
Returns
a PVector giving the x,y,z coordinates at a position t

Implements shapes3d.path.AbstractPath.

PVector shapes3d.path.BSpline3D.tangent ( float  t)

Method defines the function V = tangent(t) where t is in the range≥0.0 and ≤1.0

Parameters
tparametric value ≥0.0 and ≤1.0
Returns
a PVector giving the x,y,z coordinates of the tangent at position t

Implements shapes3d.path.Path.


The documentation for this class was generated from the following file: