Package toxi.geom.nurbs
Class NurbsCreator
java.lang.Object
toxi.geom.nurbs.NurbsCreator
This class offers some static methods to create NurbsSurfaces and NurbsCurves
from diffrent inputs.
- Version:
- 1.0
- Author:
- sg
-
Method Summary
Modifier and TypeMethodDescriptionstatic NurbsCurve
Create an Arc.static NurbsCurve
createFullCircleQuad7
(Origin3D o, float r) Create a full-circle NurbsCurve around the given Origin with radius r.static NurbsCurve
createFullCircleQuad9
(Origin3D o, float r) Create a full-circle NurbsCurve around the given Origin with radius r.static NurbsSurface
createRevolvedSurface
(Axis3D a, NurbsCurve curve, double theta) Create a revolved NurbsSurface from the given NurbsCurve around the given axis whith the angle theta.static NurbsSurface
createRevolvedSurface
(Axis3D a, NurbsCurve curve, double thetaStart, double thetaEnd) Create a revolved NurbsSurface from the given NurbsCurve around the given axis whith the angle theta.static NurbsCurve
createSemiCircle
(Origin3D o, float r) Create a semi-circle NurbsCurve around the given Origin with radius r.static NurbsSurface
createSwungSurface
(NurbsCurve proj, NurbsCurve traj, float alpha) Creates aNurbsSurface
by swinging a profileNurbsCurve
in the XZ plane around a trajectory curve in the XY plane.static NurbsSurface
extrudeCurve
(NurbsCurve curve, Vec3D extrude) Perform a linear extrusion of the givenNurbsCurve
along the supplied vector to produce a newNurbsSurface
.static NurbsCurve
globalCurveInterpolation
(Vec3D[] points, int degree) Interpolates a NurbCurve form the given Points using a global interpolation technique.static NurbsSurface
globalSurfaceInterpolation
(Vec3D[][] points, int uDegrees, int vDegrees) Interpolates a NurbsSurface from the given points using a gloabl interpolation technique.
-
Method Details
-
createArc
Create an Arc.- Parameters:
o
- Origin to creat arc aroundr
- Radius of the arc.thetaStart
- Start angle of the arc in radiansthetaEnd
- End angle of the arc in radians. If end angle is smaller than start angle, the end angle is increased by 2*PI.- Returns:
- A NurbsCurve for the Arc.
-
createFullCircleQuad7
Create a full-circle NurbsCurve around the given Origin with radius r. The NurbsCurve has controlpolygon which has 7 controlpoints and the shape of quadrat.- Parameters:
o
- Origin to create the full-circle aroundr
- Radius of the full-circle- Returns:
- A NurbsCurve for a full-circle
-
createFullCircleQuad9
Create a full-circle NurbsCurve around the given Origin with radius r. The NurbsCurve has controlpolygon which has 9 controlpoints and the shape of quadrat.- Parameters:
o
- Origin to create the full-circle aroundr
- Radius of the full-circle- Returns:
- A NurbsCurve for a full-circle
-
createRevolvedSurface
Create a revolved NurbsSurface from the given NurbsCurve around the given axis whith the angle theta.- Parameters:
a
- Axis to revolve around.curve
- NurbsCurve to revolvetheta
- Angle to revolve- Returns:
- The revolved NurbsSurface
-
createRevolvedSurface
public static NurbsSurface createRevolvedSurface(Axis3D a, NurbsCurve curve, double thetaStart, double thetaEnd) Create a revolved NurbsSurface from the given NurbsCurve around the given axis whith the angle theta.- Parameters:
a
- Axis to revolve around.curve
- NurbsCurve to revolvethetaStart
- Angle to start revolutionthetaEnd
- Angle to end revolution- Returns:
- The revolved NurbsSurface
-
createSemiCircle
Create a semi-circle NurbsCurve around the given Origin with radius r.- Parameters:
o
- Origin to create semi-circle around.r
- Radius of the semi-circle- Returns:
- A NurbsCurve for a semi-circle
-
createSwungSurface
Creates aNurbsSurface
by swinging a profileNurbsCurve
in the XZ plane around a trajectory curve in the XY plane. Both curves MUST be offset from the major axes (i.e. their control points should have non-zero coordinates for the Y coordinates of the profile curve and the Z coordinates of the trajectory).- Parameters:
proj
- profile curve in XZtraj
- trajectory curve in XYalpha
- scale factor- Returns:
- 3D NURBS surface
-
extrudeCurve
Perform a linear extrusion of the givenNurbsCurve
along the supplied vector to produce a newNurbsSurface
. The extrusion length is the length of the vector given.- Parameters:
curve
- NURBS curve instanceextrude
- a extrusion vector- Returns:
- a NurbsSurface.
-
globalCurveInterpolation
public static NurbsCurve globalCurveInterpolation(Vec3D[] points, int degree) throws InterpolationException Interpolates a NurbCurve form the given Points using a global interpolation technique.- Parameters:
points
- Points to interpolatedegree
- degree of the interpolated NurbsCurve- Returns:
- A NurbsCurve interpolating the given Points
- Throws:
InterpolationException
- thrown if interpolation failed or is not possible.
-
globalSurfaceInterpolation
public static NurbsSurface globalSurfaceInterpolation(Vec3D[][] points, int uDegrees, int vDegrees) throws InterpolationException Interpolates a NurbsSurface from the given points using a gloabl interpolation technique.- Parameters:
points
- Points arranged in a net (matrix) to interpolateuDegrees
- degree in u directionvDegrees
- degree in v direction- Returns:
- A NurbsSurface interpolating the given points.
- Throws:
InterpolationException
- thrown if interpolation failed or is not possible.
-