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
ConstructorDescriptionBasicNurbsSurface
(ControlNet cps, float[] uK, float[] vK, int p, int q) Create a Nurbs Surface from the givenControlNet
and 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 NurbsSurfaceint
Get the degree in u directionfloat[]
Get the knot values in u directionint
Get 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 givenControlNet
and 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:NurbsSurface
Get the Contol points of the NurbsSurface- Specified by:
getControlNet
in interfaceNurbsSurface
- Returns:
- ControlNet of the Nurbs
-
getUDegree
public int getUDegree()Description copied from interface:NurbsSurface
Get the degree in u direction- Specified by:
getUDegree
in interfaceNurbsSurface
- Returns:
- degree in u direction
-
getUKnots
public float[] getUKnots()Description copied from interface:NurbsSurface
Get the knot values in u direction- Specified by:
getUKnots
in interfaceNurbsSurface
- Returns:
- knot values in u direction
-
getUKnotVector
- Specified by:
getUKnotVector
in interfaceNurbsSurface
-
getVDegree
public int getVDegree()Description copied from interface:NurbsSurface
Get the degree in v direction- Specified by:
getVDegree
in interfaceNurbsSurface
- Returns:
- degree in v direction
-
getVKnots
public float[] getVKnots()Description copied from interface:NurbsSurface
Get the knot values in v direction- Specified by:
getVKnots
in interfaceNurbsSurface
- Returns:
- knot values in v direction
-
getVKnotVector
- Specified by:
getVKnotVector
in interfaceNurbsSurface
-
pointOnSurface
- Specified by:
pointOnSurface
in interfaceNurbsSurface
-
pointOnSurface
Description copied from interface:NurbsSurface
Calculate point on surface for the given u and v values- Specified by:
pointOnSurface
in interfaceNurbsSurface
- Parameters:
u
- u value to caculate point fromv
- v value to caculate point from- Returns:
- calculated point
-
pointOnSurface
Description copied from interface:NurbsSurface
Calculate point on surface for the given u and v values- Specified by:
pointOnSurface
in 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:NurbsSurface
Computes control points of dth derivative
Piegel, L. The Nurbs Book, Algorithm A3.7 -> Page 114- Specified by:
surfaceDerivCpts
in 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
-