Package geomss.geom.nurbs
Class NurbsSurfaceTrans
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractSurface<NurbsSurface>
-
- geomss.geom.nurbs.NurbsSurface
-
- geomss.geom.nurbs.NurbsSurfaceTrans
-
- All Implemented Interfaces:
GeomElement<NurbsSurface>
,GeomTransform<NurbsSurface>
,ParametricGeometry<NurbsSurface>
,Surface<NurbsSurface>
,Transformable<NurbsSurface>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
public final class NurbsSurfaceTrans extends NurbsSurface implements GeomTransform<NurbsSurface>
AGeomTransform
object that refers to aNurbsSurface
object and masquerades as a NurbsSurface object itself.Modified by: Joseph A. Huwaldt
- Version:
- November 28, 2015
- 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NurbsSurfaceTrans
copy()
Returns a copy of this NurbsSurfaceTrans instanceallocated
by the calling thread (possibly on the stack).NurbsSurface
copyToReal()
Return a copy of the child object transformed by this transformation.boolean
equals(java.lang.Object obj)
Compares this NurbsSurfaceTrans against the specified object for strict equality.Point
getBoundsMax()
Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).Point
getBoundsMin()
Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).NurbsSurface
getChild()
Returns the child object transformed by this transform element.ControlPointNet
getControlPoints()
Return a matrix or network of control points for this surface.int
getNumberOfColumns()
Return the control point matrix size in the t-direction (across the columns of control points).int
getNumberOfRows()
Return the control point matrix size in the s-direction (down a column of control points).int
getPhyDimension()
Returns the number of physical dimensions of the geometry element.Point
getRealPoint(double s, double t)
Calculate a point on the surface for the given parametric position on the surface.int
getSDegree()
Return the s-degree of the NURBS surface.java.util.List<Vector<javax.measure.quantity.Length>>
getSDerivatives(double s, double t, int grade, boolean scaled)
Calculate all the derivatives from0
tograde
with respect to parametric s-position on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}s
.KnotVector
getSKnotVector()
Return the s-direction knot vector of this surface.int
getTDegree()
Return the t-degree of the NURBS surface.java.util.List<Vector<javax.measure.quantity.Length>>
getTDerivatives(double s, double t, int grade, boolean scaled)
Calculate all the derivatives from0
tograde
with respect to parametric t-position on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}t
.KnotVector
getTKnotVector()
Return the t-direction knot vector of this surface.GTransform
getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform objects below this one.GTransform
getTransform()
Returns the transformation represented by this transformation element.NurbsSurfaceTrans
getTransformed(GTransform transform)
Returns transformed version of this element.Vector<javax.measure.quantity.Length>
getTwistVector(double s, double t)
Calculate the twist vector (d^2P/(ds*dt) = d(dP/ds)/dt) for this surface at the specified position on this surface.javax.measure.unit.Unit<javax.measure.quantity.Length>
getUnit()
Returns the unit in which the control points in this curve are stated.int
hashCode()
Returns the hash code for this parameter.static NurbsSurfaceTrans
newInstance(NurbsSurface child, GTransform transform)
static void
recycle(NurbsSurfaceTrans instance)
Recycles aNurbsSurfaceTrans
instance immediately (on the stack when executing in a StackContext).void
setTransform(GTransform transform)
Sets the transformation represented by this transformation element.int
size()
Returns the number of child-elements that make up this geometry element.NurbsSurfaceTrans
to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this surface but stated in the specified unit.NurbsSurfaceTrans
toDimension(int newDim)
Return the equivalent of this surface converted to the specified number of physical dimensions.-
Methods inherited from class geomss.geom.nurbs.NurbsSurface
getS0Curve, getS1Curve, getSCurve, getT0Curve, getT1Curve, getTCurve, insertSKnot, insertTKnot, isDegenerate, isPlanar, isValid, mergeSKnotVector, mergeTKnotVector, refineSKnotVector, refineSKnotVector, refineTKnotVector, refineTKnotVector, removeSKnot, removeTKnot, reverseS, reverseT, splitAtS, splitAtT, toNurbs, toNurbs, toText, transpose
-
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, getTangentPlane, getTangentPlane, getTCurve, getTDerivative, getTDerivative, 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, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getID, getLimitPoint, getName, getParDimension, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, toText
-
-
-
-
Method Detail
-
newInstance
public static NurbsSurfaceTrans newInstance(NurbsSurface child, GTransform transform)
- Parameters:
child
- The NurbsSurface that is the child of this transform element (may not benull
).transform
- The transform held by this transform element (may not benull
).- Returns:
- the transform element having the specified values.
-
getTransform
public GTransform getTransform()
Returns the transformation represented by this transformation element.- Specified by:
getTransform
in interfaceGeomTransform<NurbsSurface>
- Returns:
- The transformation represented by this transformation element.
-
getTotalTransform
public GTransform getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform objects below this one.- Specified by:
getTotalTransform
in interfaceGeomTransform<NurbsSurface>
- Returns:
- The total transformation represented by an entire chain of GeomTransform objects below this one.
-
setTransform
public void setTransform(GTransform transform)
Sets the transformation represented by this transformation element.- Specified by:
setTransform
in interfaceGeomTransform<NurbsSurface>
- Parameters:
transform
- The transform to set this transform element to (may not benull
).
-
getChild
public NurbsSurface getChild()
Returns the child object transformed by this transform element.- Specified by:
getChild
in interfaceGeomTransform<NurbsSurface>
- Returns:
- The child object transformed by this transform element.
-
copyToReal
public NurbsSurface copyToReal()
Return a copy of the child object transformed by this transformation.- Specified by:
copyToReal
in interfaceGeomElement<NurbsSurface>
- Specified by:
copyToReal
in interfaceGeomTransform<NurbsSurface>
- Returns:
- A copy of the child object transformed by this transformation.
-
size
public int size()
Returns the number of child-elements that make up this geometry element. This implementation returns the number of control points in the child NURBS surface.- Specified by:
size
in interfaceGeomElement<NurbsSurface>
- Returns:
- The number of child-elements that make up this geometry element.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element.- Specified by:
getPhyDimension
in interfaceGeomElement<NurbsSurface>
- Returns:
- The number of physical dimensions of this geometry element.
-
getControlPoints
public ControlPointNet getControlPoints()
Return a matrix or network of control points for this surface.- Specified by:
getControlPoints
in classNurbsSurface
- Returns:
- the ordered control points
-
getNumberOfRows
public int getNumberOfRows()
Return the control point matrix size in the s-direction (down a column of control points).- Specified by:
getNumberOfRows
in classNurbsSurface
- Returns:
- The control point matrix size in the s-direction.
-
getNumberOfColumns
public int getNumberOfColumns()
Return the control point matrix size in the t-direction (across the columns of control points).- Specified by:
getNumberOfColumns
in classNurbsSurface
- Returns:
- The control point matrix size in the t-direction.
-
getSKnotVector
public KnotVector getSKnotVector()
Return the s-direction knot vector of this surface.- Specified by:
getSKnotVector
in classNurbsSurface
- Returns:
- The s-knot vector.
-
getTKnotVector
public KnotVector getTKnotVector()
Return the t-direction knot vector of this surface.- Specified by:
getTKnotVector
in classNurbsSurface
- Returns:
- The t-knot vector.
-
getSDegree
public int getSDegree()
Return the s-degree of the NURBS surface.- Specified by:
getSDegree
in classNurbsSurface
- Returns:
- s-degree of surface
-
getTDegree
public int getTDegree()
Return the t-degree of the NURBS surface.- Specified by:
getTDegree
in classNurbsSurface
- Returns:
- t-degree of surface
-
getRealPoint
public Point getRealPoint(double s, double t)
Calculate a point on the surface for the given parametric position on the surface.- Specified by:
getRealPoint
in interfaceSurface<NurbsSurface>
- Parameters:
s
- 1st parametric dimension distance to get the point for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to get the point for (0.0 to 1.0 inclusive).- Returns:
- The calculated point on the surface at the specified parameter values.
- Throws:
java.lang.IllegalArgumentException
- if there is any problem with the parameter values.
-
getSDerivatives
public java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives(double s, double t, int grade, boolean scaled)
Calculate all the derivatives from0
tograde
with respect to parametric s-position on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}s
.Example:
1st derivative (grade = 1), this returns[p(s,t), dp(s,t)/ds]
;
2nd derivative (grade = 2), this returns[p(s,t), dp(s,t)/ds, d^2p(s,t)/d^2s]
; etc.- Specified by:
getSDerivatives
in classAbstractSurface<NurbsSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).grade
- The maximum grade to calculate the u-derivatives for (1=1st derivative, 2=2nd derivative, etc)scaled
- Passtrue
for properly scaled derivatives orfalse
if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.- Returns:
- A list of s-derivatives up to the specified grade of the surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are invalid.
-
getTDerivatives
public java.util.List<Vector<javax.measure.quantity.Length>> getTDerivatives(double s, double t, int grade, boolean scaled)
Calculate all the derivatives from0
tograde
with respect to parametric t-position on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}t
.Example:
1st derivative (grade = 1), this returns[p(s,t), dp(s,t)/dt]
;
2nd derivative (grade = 2), this returns[p(s,t), dp(s,t)/dt, d^2p(s,t)/d^2t]
; etc.- Specified by:
getTDerivatives
in classAbstractSurface<NurbsSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).grade
- The maximum grade to calculate the v-derivatives for (1=1st derivative, 2=2nd derivative, etc)scaled
- Passtrue
for properly scaled derivatives orfalse
if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.- Returns:
- A list of t-derivatives up to the specified grade of the surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are invalid.
-
getTwistVector
public Vector<javax.measure.quantity.Length> getTwistVector(double s, double t)
Calculate the twist vector (d^2P/(ds*dt) = d(dP/ds)/dt) for this surface at the specified position on this surface.- Specified by:
getTwistVector
in interfaceSurface<NurbsSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate twist vector for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate twist vector for (0.0 to 1.0 inclusive).- Returns:
- The twist vector of this surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the parameter values are invalid.
-
getBoundsMin
public Point getBoundsMin()
Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).- Specified by:
getBoundsMin
in interfaceGeomElement<NurbsSurface>
- Returns:
- The minimum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException
- if this list contains no elements.
-
getBoundsMax
public Point getBoundsMax()
Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).- Specified by:
getBoundsMax
in interfaceGeomElement<NurbsSurface>
- Returns:
- The maximum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException
- if this list contains no elements.
-
getTransformed
public NurbsSurfaceTrans getTransformed(GTransform transform)
Returns transformed version of this element. The returned object implementsGeomTransform
and contains this element as a child.- Specified by:
getTransformed
in interfaceTransformable<NurbsSurface>
- Overrides:
getTransformed
in classNurbsSurface
- 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.
-
getUnit
public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the control points in this curve are stated.- Specified by:
getUnit
in interfaceGeomElement<NurbsSurface>
- Returns:
- The unit in which the geometry in this element are stated.
-
to
public NurbsSurfaceTrans to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit) throws javax.measure.converter.ConversionException
Returns the equivalent to this surface but stated in the specified unit.- Specified by:
to
in interfaceGeomElement<NurbsSurface>
- Specified by:
to
in interfaceParametricGeometry<NurbsSurface>
- Specified by:
to
in interfaceSurface<NurbsSurface>
- Parameters:
unit
- the length unit of the surface to be returned. May not be null.- Returns:
- an equivalent to this surface but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException
- if the the input unit is not a length unit.
-
toDimension
public NurbsSurfaceTrans toDimension(int newDim)
Return the equivalent of this surface converted to the specified number of physical dimensions. This implementation will throw an exception if the specified dimension is anything other than 3.- Specified by:
toDimension
in interfaceGeomElement<NurbsSurface>
- Specified by:
toDimension
in interfaceParametricGeometry<NurbsSurface>
- Specified by:
toDimension
in interfaceSurface<NurbsSurface>
- Parameters:
newDim
- The dimension of the surface to return. MUST equal 3.- Returns:
- The equivalent of this surface converted to the new dimensions.
- Throws:
java.lang.IllegalArgumentException
- if the new dimension is anything other than 3.
-
copy
public NurbsSurfaceTrans copy()
Returns a copy of this NurbsSurfaceTrans instanceallocated
by the calling thread (possibly on the stack).- Specified by:
copy
in interfaceGeomElement<NurbsSurface>
- Specified by:
copy
in interfaceParametricGeometry<NurbsSurface>
- Specified by:
copy
in interfaceSurface<NurbsSurface>
- Returns:
- an identical and independent copy of this point.
-
equals
public boolean equals(java.lang.Object obj)
Compares this NurbsSurfaceTrans against the specified object for strict equality.- Overrides:
equals
in classAbstractGeomElement<NurbsSurface>
- Parameters:
obj
- the object to compare with.- Returns:
true
if this transform is identical to that transform;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code for this parameter.- Overrides:
hashCode
in classAbstractGeomElement<NurbsSurface>
- Returns:
- the hash code value.
-
recycle
public static void recycle(NurbsSurfaceTrans instance)
Recycles aNurbsSurfaceTrans
instance immediately (on the stack when executing in a StackContext).- Parameters:
instance
- The instance to be recycled.
-
-