Package toxi.geom.nurbs
Class BasicNurbsSurface
java.lang.Object
toxi.geom.nurbs.BasicNurbsSurface
- All Implemented Interfaces:
NurbsSurface
A Basic NurbsSurface implementation.
- Version:
- 1.2
- Author:
- sg
-
Constructor Summary
ConstructorsConstructorDescriptionBasicNurbsSurface(ControlNet cps, float[] uK, float[] vK, int p, int q) Create a Nurbs Surface from the givenControlNetand the knot values of degree p in u direction and of degree q in v direction.BasicNurbsSurface(ControlNet net, KnotVector u, KnotVector v) Create a Nurbs form the Controlnet and the two Knot vectors. -
Method Summary
Modifier and TypeMethodDescriptionGet the Contol points of the NurbsSurfaceintGet the degree in u directionfloat[]Get the knot values in u directionintGet the degree in v directionfloat[]Get the knot values in v directionpointOnSurface(double u, double v) pointOnSurface(float u, float v) Calculate point on surface for the given u and v valuespointOnSurface(float u, float v, Vec3D out) Calculate point on surface for the given u and v valuesVec4D[][][][]surfaceDerivCpts(int d, int r1, int r2, int s1, int s2) Computes control points of dth derivative
Piegel, L.
-
Constructor Details
-
BasicNurbsSurface
public BasicNurbsSurface(ControlNet cps, float[] uK, float[] vK, int p, int q) throws IllegalArgumentException Create a Nurbs Surface from the givenControlNetand the knot values of degree p in u direction and of degree q in v direction.- Parameters:
cps- ControlNet of the NurbsuK- Knot values in u directionvK- Knot values in v directionp- degree in u directionq- degree in v direction- Throws:
IllegalArgumentException
-
BasicNurbsSurface
public BasicNurbsSurface(ControlNet net, KnotVector u, KnotVector v) throws IllegalArgumentException Create a Nurbs form the Controlnet and the two Knot vectors.- Parameters:
net- Contorl net of Nurbsu- KnotVector in u directionv- KnotVector in v direction- Throws:
IllegalArgumentException
-
-
Method Details
-
getControlNet
Description copied from interface:NurbsSurfaceGet the Contol points of the NurbsSurface- Specified by:
getControlNetin interfaceNurbsSurface- Returns:
- ControlNet of the Nurbs
-
getUDegree
public int getUDegree()Description copied from interface:NurbsSurfaceGet the degree in u direction- Specified by:
getUDegreein interfaceNurbsSurface- Returns:
- degree in u direction
-
getUKnots
public float[] getUKnots()Description copied from interface:NurbsSurfaceGet the knot values in u direction- Specified by:
getUKnotsin interfaceNurbsSurface- Returns:
- knot values in u direction
-
getUKnotVector
- Specified by:
getUKnotVectorin interfaceNurbsSurface
-
getVDegree
public int getVDegree()Description copied from interface:NurbsSurfaceGet the degree in v direction- Specified by:
getVDegreein interfaceNurbsSurface- Returns:
- degree in v direction
-
getVKnots
public float[] getVKnots()Description copied from interface:NurbsSurfaceGet the knot values in v direction- Specified by:
getVKnotsin interfaceNurbsSurface- Returns:
- knot values in v direction
-
getVKnotVector
- Specified by:
getVKnotVectorin interfaceNurbsSurface
-
pointOnSurface
- Specified by:
pointOnSurfacein interfaceNurbsSurface
-
pointOnSurface
Description copied from interface:NurbsSurfaceCalculate point on surface for the given u and v values- Specified by:
pointOnSurfacein interfaceNurbsSurface- Parameters:
u- u value to caculate point fromv- v value to caculate point from- Returns:
- calculated point
-
pointOnSurface
Description copied from interface:NurbsSurfaceCalculate point on surface for the given u and v values- Specified by:
pointOnSurfacein interfaceNurbsSurface- Parameters:
u- u value to caculate point fromv- v value to caculate point fromout- point to place result in.
-
surfaceDerivCpts
Description copied from interface:NurbsSurfaceComputes control points of dth derivative
Piegel, L. The Nurbs Book, Algorithm A3.7 -> Page 114- Specified by:
surfaceDerivCptsin interfaceNurbsSurface- Parameters:
d- - dth derivative (0<=k+l<=d)r1- - from control point (u direction; 0 for all control points)r2- - to control point (u direction; n for all control points)s1- - from control point (v direction; 0 for all control points)s2- - to control point (v direction; n for all control points)- Returns:
- ControlPoint4f[k][l][i][j] i,jth control point, differentiated k
times
with respect to u and l times with respect to v
-