Package geomss.geom.nurbs
Class NurbsSurface
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractSurface<NurbsSurface>
-
- geomss.geom.nurbs.NurbsSurface
-
- All Implemented Interfaces:
GeomElement<NurbsSurface>
,ParametricGeometry<NurbsSurface>
,Surface<NurbsSurface>
,Transformable<NurbsSurface>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
- Direct Known Subclasses:
BasicNurbsSurface
,NurbsSurfaceTrans
public abstract class NurbsSurface extends AbstractSurface<NurbsSurface>
The interface and implementation in common to all NURBS surfaces.Modified by: Joseph A. Huwaldt
- Version:
- January 31, 2017
- Author:
- Joseph A. Huwaldt, Date: June 14, 2010
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractSurface
GTOL
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Constructor Summary
Constructors Constructor Description NurbsSurface()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ControlPointNet
getControlPoints()
Return a matrix or network of control points for this surface.abstract int
getNumberOfColumns()
Return the control point matrix size in the t-direction (across the columns of control points).abstract int
getNumberOfRows()
Return the control point matrix size in the s-direction (down a column of control points).Curve
getS0Curve()
Return the S=0 Boundary for this surface as a NURBS curve.Curve
getS1Curve()
Return the S=1 Boundary for this surface as a NURBS curve.BasicNurbsCurve
getSCurve(int index)
Return the S-curve with the specified index from this surface as a NURBS curve.abstract int
getSDegree()
Return the s-degree of the NURBS surface.abstract KnotVector
getSKnotVector()
Return the s-direction knot vector of this surface.Curve
getT0Curve()
Return the T=0 Boundary for this surface as a NURBS curve.Curve
getT1Curve()
Return the T=1 Boundary for this surface as a NURBS curve.BasicNurbsCurve
getTCurve(int index)
Return the T-curve with the specified index from this surface as a NURBS curve.abstract int
getTDegree()
Return the t-degree of the NURBS surface.abstract KnotVector
getTKnotVector()
Return the t-direction knot vector of this surface.NurbsSurfaceTrans
getTransformed(GTransform transform)
Returns transformed version of this element.BasicNurbsSurface
insertSKnot(double s, int r)
Create and return a newNURBS surface
that is geometrically identical to this one but with a new knot inserted at the specified parametric S-location.BasicNurbsSurface
insertTKnot(double t, int r)
Create and return a newNURBS surface
that is geometrically identical to this one but with a new knot inserted at the specified parametric T-location.boolean
isDegenerate(Parameter<javax.measure.quantity.Length> tol)
Returntrue
if this surface is degenerate (i.e.: has area less than the specified tolerance squared).boolean
isPlanar(Parameter<javax.measure.quantity.Length> tol)
Returntrue
if this surface is planar orfalse
if it is not.boolean
isValid()
Returntrue
if this NurbsSurface contains valid and finite numerical components.NurbsSurface
mergeSKnotVector(Float64Vector Um)
Return aNURBS surface
that is geometrically identical to this one but with the specified list of knots merged into it's S-knot vector.NurbsSurface
mergeTKnotVector(Float64Vector Um)
Return aNURBS surface
that is geometrically identical to this one but with the specified list of knots merged into it's T-knot vector.BasicNurbsSurface
refineSKnotVector(double[] newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's S-knot vector.BasicNurbsSurface
refineSKnotVector(Float64Vector newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's S-knot vector.BasicNurbsSurface
refineTKnotVector(double[] newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's T-knot vector.BasicNurbsSurface
refineTKnotVector(Float64Vector newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's T-knot vector.NurbsSurface
removeSKnot(int index, int numRemovals, Parameter<javax.measure.quantity.Length> tolerance)
Attempts to remove the knot in the S-direction with the specified index from this NURBS surface the specified number of times.NurbsSurface
removeTKnot(int index, int numRemovals, Parameter<javax.measure.quantity.Length> tolerance)
Attempts to remove the knot in the T-direction with the specified index from this NURBS surface the specified number of times.NurbsSurface
reverseS()
Return a new surface that is identical to this one, but with the S-parameterization reversed.NurbsSurface
reverseT()
Return a new surface that is identical to this one, but with the T-parameterization reversed.GeomList<NurbsSurface>
splitAtS(double s)
Split thisNurbsSurface
at the specified parametric S-position returning a list containing two new surfaces (a lower surface with smaller S-parametric positions than "s" and an upper surface with larger S-parametric positions).GeomList<NurbsSurface>
splitAtT(double t)
Split thisNurbsSurface
at the specified parametric T-position returning a list containing two new surfaces (a lower surface with smaller T-parametric positions than "t" and an upper surface with larger T-parametric positions).NurbsSurface
toNurbs()
Return a NURBS surface representation of this surface.NurbsSurface
toNurbs(Parameter<javax.measure.quantity.Length> tol)
Return a NURBS surface representation of this surface to within the specified tolerance.javolution.text.Text
toText()
Returns the text representation of this geometry element that consists of the name followed by the control point values, followed by the knot vectors.NurbsSurface
transpose()
Return a new surface that is identical to this one but with the transpose of the parameterization of this surface.-
Methods inherited from class geomss.geom.AbstractSurface
extractGrid, getArea, getArea, getArea, getClosest, getClosest, getClosest, getClosest, getClosest, getClosest, getCurve, getDerivatives, getFarthest, getFarthest, getFarthest, getGaussianCurvature, getGaussianCurvature, getLimitPoint, getMeanCurvature, getMeanCurvature, getNormal, getNormal, getParDimension, getPoint, getPoint, getRealPoint, getSCurve, getSDerivative, getSDerivative, getSDerivatives, getSDerivatives, getSDerivatives, getTangentPlane, getTangentPlane, getTCurve, getTDerivative, getTDerivative, getTDerivatives, getTDerivatives, getTDerivatives, getTwistVector, getVolume, getVolume, getVolume, gridToTolerance, intersect, intersect, intersect, intersect, intersect, isPlanar, splitAtS, splitAtT
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, equals, getAllUserData, getID, getName, getUserData, hashCode, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, copyToReal, getAllUserData, getBoundsMax, getBoundsMin, getID, getName, getPhyDimension, getUnit, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size
-
Methods inherited from interface geomss.geom.Surface
copy, getRealPoint, getTwistVector, to, toDimension
-
-
-
-
Constructor Detail
-
NurbsSurface
public NurbsSurface()
-
-
Method Detail
-
getControlPoints
public abstract ControlPointNet getControlPoints()
Return a matrix or network of control points for this surface.- Returns:
- the ordered control points
-
getNumberOfRows
public abstract int getNumberOfRows()
Return the control point matrix size in the s-direction (down a column of control points).- Returns:
- The control point matrix size in the s-direction
-
getNumberOfColumns
public abstract int getNumberOfColumns()
Return the control point matrix size in the t-direction (across the columns of control points).- Returns:
- The control point matrix size in the t-direction
-
getSKnotVector
public abstract KnotVector getSKnotVector()
Return the s-direction knot vector of this surface.- Returns:
- The s-knot vector.
-
getTKnotVector
public abstract KnotVector getTKnotVector()
Return the t-direction knot vector of this surface.- Returns:
- The t-knot vector.
-
getSDegree
public abstract int getSDegree()
Return the s-degree of the NURBS surface.- Returns:
- s-degree of surface
-
getTDegree
public abstract int getTDegree()
Return the t-degree of the NURBS surface.- Returns:
- t-degree of surface
-
transpose
public NurbsSurface transpose()
Return a new surface that is identical to this one but with the transpose of the parameterization of this surface. The S and T directions will be swapped.- Specified by:
transpose
in interfaceSurface<NurbsSurface>
- Overrides:
transpose
in classAbstractSurface<NurbsSurface>
- Returns:
- A new surface that is identical to this one but with the transpose of the parameterization of this surface.
-
reverseS
public NurbsSurface reverseS()
Return a new surface that is identical to this one, but with the S-parameterization reversed.- Returns:
- A new surface that is identical to this one, but with the S-parameterization reversed.
- See Also:
reverseT()
-
reverseT
public NurbsSurface reverseT()
Return a new surface that is identical to this one, but with the T-parameterization reversed.- Returns:
- A new surface that is identical to this one, but with the T-parameterization reversed.
- See Also:
reverseS()
-
splitAtS
public GeomList<NurbsSurface> splitAtS(double s)
Split thisNurbsSurface
at the specified parametric S-position returning a list containing two new surfaces (a lower surface with smaller S-parametric positions than "s" and an upper surface with larger S-parametric positions).- Parameters:
s
- The S-parametric position where this surface should be split (must not be 0 or 1!).- Returns:
- A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
-
splitAtT
public GeomList<NurbsSurface> splitAtT(double t)
Split thisNurbsSurface
at the specified parametric T-position returning a list containing two new surfaces (a lower surface with smaller T-parametric positions than "t" and an upper surface with larger T-parametric positions).- Parameters:
t
- The T-parametric position where this surface should be split (must not be 0 or 1!).- Returns:
- A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
-
getT0Curve
public Curve getT0Curve()
Return the T=0 Boundary for this surface as a NURBS curve.- Returns:
- The T=0 Boundary for this surface as a NURBS curve.
-
getT1Curve
public Curve getT1Curve()
Return the T=1 Boundary for this surface as a NURBS curve.- Returns:
- The T=1 Boundary for this surface as a NURBS curve.
-
getS0Curve
public Curve getS0Curve()
Return the S=0 Boundary for this surface as a NURBS curve.- Returns:
- The S=0 Boundary for this surface as a NURBS curve.
-
getS1Curve
public Curve getS1Curve()
Return the S=1 Boundary for this surface as a NURBS curve.- Returns:
- The S=1 Boundary for this surface as a NURBS curve.
-
getSCurve
public BasicNurbsCurve getSCurve(int index)
Return the S-curve with the specified index from this surface as a NURBS curve.- Parameters:
index
- The T-index for the curve to return from 0 to getNumberOfColumns()-1.- Returns:
- The
BasicNurbsCurve
built from the specified column in the ControlPointNet.
-
getTCurve
public BasicNurbsCurve getTCurve(int index)
Return the T-curve with the specified index from this surface as a NURBS curve.- Parameters:
index
- The S-index for the curve to return from 0 to getNumberOfRows()-1.- Returns:
- The
BasicNurbsCurve
built from the specified row in the ControlPointNet.
-
insertSKnot
public BasicNurbsSurface insertSKnot(double s, int r)
Create and return a newNURBS surface
that is geometrically identical to this one but with a new knot inserted at the specified parametric S-location. The parameterization of the new surface is identical to this one, but the new surface will have a new knot at the specified s-location and a new set of control points.- Parameters:
s
- The parametric s-position where the new knot should be inserted from 0 to 1.r
- The number of times that a knot should be inserted at the specified position.- Returns:
- A new NURBS surface that is identical to this one, but with a new knot inserted in the specified parametric s-position.
-
insertTKnot
public BasicNurbsSurface insertTKnot(double t, int r)
Create and return a newNURBS surface
that is geometrically identical to this one but with a new knot inserted at the specified parametric T-location. The parameterization of the new surface is identical to this one, but the new surface will have a new knot at the specified T-location and a new set of control points.- Parameters:
t
- The parametric T-position where the new knot should be inserted from 0 to 1.r
- The number of times that a knot should be inserted at the specified position.- Returns:
- A new NURBS surface that is identical to this one, but with new knots inserted in the specified parametric T-position.
-
mergeSKnotVector
public NurbsSurface mergeSKnotVector(Float64Vector Um)
Return aNURBS surface
that is geometrically identical to this one but with the specified list of knots merged into it's S-knot vector. The parameterization of the new surface is identical to this surface, but the new surface will have any new knots at the specified locations added and a new set of control points. If the input knot list matches the knot list in the S direction of this surface, then this surface is returned.- Parameters:
Um
- The knot vector to merge with this surface's S-knot vector.- Returns:
- A NURBS surface that is identical to this one, but with the merger of the input knot vector and this surface's S-knot vector.
-
mergeTKnotVector
public NurbsSurface mergeTKnotVector(Float64Vector Um)
Return aNURBS surface
that is geometrically identical to this one but with the specified list of knots merged into it's T-knot vector. The parameterization of the new surface is identical to this surface, but the new surface will have any new knots at the specified locations added and a new set of control points. If the input knot list matches the knot list in the T direction of this surface, then this surface is returned.- Parameters:
Um
- The knot vector to merge with this surface's T-knot vector. May not be null.- Returns:
- A NURBS surface that is identical to this one, but with the merger of the input knot vector and this surface's T knot vector.
-
refineSKnotVector
public BasicNurbsSurface refineSKnotVector(double[] newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's S-knot vector. The parameterization of the new surface is identical to this surface, but the new surface will have the new knots at the specified locations in the S-direction and a new set of control points. This is more efficient than repeatedly calling insertSKnot() for multiple knot insertions.- Parameters:
newKnots
- The parametric S-locations where the knots are to be inserted. May not be null.- Returns:
- A new NURBS surface that is identical to this one, but with the new knots inserted at the specified locations in the parametric S-direction.
-
refineSKnotVector
public BasicNurbsSurface refineSKnotVector(Float64Vector newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's S-knot vector. The parameterization of the new surface is identical to this surface, but the new surface will have the new knots at the specified locations in the S-direction and a new set of control points. This is more efficient than repeatedly calling insertSKnot() for multiple knot insertions.- Parameters:
newKnots
- The parametric S-locations where the knots are to be inserted. May not be null.- Returns:
- A new NURBS surface that is identical to this one, but with the new knots inserted at the specified locations in the parametric S-direction.
-
refineTKnotVector
public BasicNurbsSurface refineTKnotVector(double[] newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's T-knot vector. The parameterization of the new surface is identical to this surface, but the new surface will have the new knots at the specified locations in the T-direction and a new set of control points. This is more efficient than repeatedly calling insertTKnot() for multiple knot insertions.- Parameters:
newKnots
- The parametric T-locations where the knots are to be inserted. May not be null.- Returns:
- A new NURBS surface that is identical to this one, but with the new knots inserted at the specified locations in the parametric T-direction.
-
refineTKnotVector
public BasicNurbsSurface refineTKnotVector(Float64Vector newKnots)
Create and return a newNURBS surface
that is geometrically identical to this one but with the specified list of knots inserted into it's T-knot vector. The parameterization of the new surface is identical to this surface, but the new surface will have the new knots at the specified locations in the T-direction and a new set of control points. This is more efficient than repeatedly calling insertTKnot() for multiple knot insertions.- Parameters:
newKnots
- The parametric T-locations where the knots are to be inserted. May not be null.- Returns:
- A new NURBS surface that is identical to this one, but with the new knots inserted at the specified locations in the parametric T-direction.
-
removeSKnot
public NurbsSurface removeSKnot(int index, int numRemovals, Parameter<javax.measure.quantity.Length> tolerance)
Attempts to remove the knot in the S-direction with the specified index from this NURBS surface the specified number of times. If the knot can not be removed without changing the shape of the surface, then a reference to this surface is returned:if (srf == srf.removeKnot(...)) { no knots removed }
.- Parameters:
index
- The index of the knot to be removed (degree + 1 ≤ index < knot vector length - degree).numRemovals
- The number of times that the knot at "index" should be removed (1 ≤ num ≤ multiplicity of the knot). If numRemovals is > multiplicity of the knot, then numRemovals is set to the multiplicity of the knot.tolerance
- The knot(s) specified will be removed as long as the deviation of the surface is everywhere less than this tolerance. May not be null.- Returns:
- A new NURBS surface that is identical to this one (to within the specified tolerance), but with the specified knot in the S-direction removed or a reference to this surface if the knot could not be removed.
-
removeTKnot
public NurbsSurface removeTKnot(int index, int numRemovals, Parameter<javax.measure.quantity.Length> tolerance)
Attempts to remove the knot in the T-direction with the specified index from this NURBS surface the specified number of times. If the knot can not be removed without changing the shape of the surface, then a reference to this surface is returned:if (srf == srf.removeKnot(...)) { no knots removed }
.- Parameters:
index
- The index of the knot to be removed (degree + 1 ≤ index < knot vector length - degree).numRemovals
- The number of times that the knot at "index" should be removed (1 ≤ num ≤ multiplicity of the knot). If numRemovals is > multiplicity of the knot, then numRemovals is set to the multiplicity of the knot.tolerance
- The knot(s) specified will be removed as long as the deviation of the surface is everywhere less than this tolerance. May not be null.- Returns:
- A new NURBS surface that is identical to this one (to within the specified tolerance), but with the specified knot in the T-direction removed or a reference to this surface if the knot could not be removed.
-
getTransformed
public NurbsSurfaceTrans getTransformed(GTransform transform)
Returns transformed version of this element. The returned object implementsGeomTransform
and contains this element as a child.- Parameters:
transform
- The transformation to apply to this geometry. May not be null.- Returns:
- A new triangle that is identical to this one with the specified transformation applied.
- Throws:
DimensionException
- if this point is not 3D.
-
toNurbs
public NurbsSurface toNurbs(Parameter<javax.measure.quantity.Length> tol)
Return a NURBS surface representation of this surface to within the specified tolerance. This implementation returns a reference to this surface itself since it is already a NURBS surface and the tolerance parameter is ignored.- Parameters:
tol
- Ignored. May passnull
.- Returns:
- A reference to this NURBS surface is returned.
-
toNurbs
public NurbsSurface toNurbs()
Return a NURBS surface representation of this surface. An exact representation is returned.- Returns:
- A reference to this NURBS surface is returned.
-
isValid
public boolean isValid()
Returntrue
if this NurbsSurface contains valid and finite numerical components. A value offalse
will be returned if any of the control point values or knots are NaN or Inf.- Returns:
- true if this NurbsSurface contains valid and finite numerical components.
-
isDegenerate
public boolean isDegenerate(Parameter<javax.measure.quantity.Length> tol)
Returntrue
if this surface is degenerate (i.e.: has area less than the specified tolerance squared).- Specified by:
isDegenerate
in interfaceParametricGeometry<NurbsSurface>
- Specified by:
isDegenerate
in interfaceSurface<NurbsSurface>
- Overrides:
isDegenerate
in classAbstractSurface<NurbsSurface>
- Parameters:
tol
- The tolerance for determining if this surface is degenerate. May not be null.- Returns:
- true if this surface is degenerate.
-
isPlanar
public boolean isPlanar(Parameter<javax.measure.quantity.Length> tol)
Returntrue
if this surface is planar orfalse
if it is not.- Specified by:
isPlanar
in interfaceSurface<NurbsSurface>
- Overrides:
isPlanar
in classAbstractSurface<NurbsSurface>
- Parameters:
tol
- The geometric tolerance to use in determining if the surface is planar. May not be null.- Returns:
- true if this surface is planar.
-
toText
public javolution.text.Text toText()
Returns the text representation of this geometry element that consists of the name followed by the control point values, followed by the knot vectors.- Specified by:
toText
in interfaceGeomElement<NurbsSurface>
- Overrides:
toText
in classAbstractGeomElement<NurbsSurface>
- Returns:
- the text representation of this geometry element.
-
-