public class SubrangeSurface extends AbstractSurface<SubrangeSurface> implements Subrange<Surface>
Surface
that is defined by a set of four 2D boundary
curves that define the 4 parametric edges of the trimmed surface on the child surface.
Modified by: Joseph A. Huwaldt
GTOL
RESOURCES
Modifier and Type | Method and Description |
---|---|
SubrangeSurface |
copy()
Returns a copy of this
SubrangeSurface instance
allocated by the calling thread
(possibly on the stack). |
SubrangeSurface |
copyToReal()
Return a copy of this object with any transformations or subranges removed
(applied).
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this
SubrangeSurface for 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).
|
ParametricGeometry |
getChild()
Returns the child object this point is subranged onto.
|
Surface |
getParPosition()
Returns a 2D surface in parametric space which maps this surface's parametric
positions to the child surface.
|
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.
|
Curve |
getS0Curve()
Return the S=0 Boundary for this surface as a curve.
|
Curve |
getS1Curve()
Return the S=1 Boundary for this surface as a curve.
|
java.util.List<Vector<Length>> |
getSDerivatives(double s,
double t,
int grade,
boolean scaled)
Calculate all the derivatives from
0 to grade 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 . |
Curve |
getT0Curve()
Return the T=0 Boundary for this surface as a curve.
|
Curve |
getT1Curve()
Return the T=1 Boundary for this surface as a curve.
|
java.util.List<Vector<Length>> |
getTDerivatives(double s,
double t,
int grade,
boolean scaled)
Calculate all the derivatives from
0 to grade 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 . |
SubrangeSurface |
getTransformed(GTransform transform)
Returns transformed version of this element.
|
Vector<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.
|
Unit<Length> |
getUnit()
Returns the unit in which this surface is stated.
|
int |
hashCode()
Returns the hash code for this
SubrangeSurface . |
boolean |
isDegenerate(Parameter<Length> tol)
Return
true if this surface is degenerate (i.e.: has area less than
the specified tolerance squared). |
boolean |
isValid()
Return
true if this SubrangeSurface contains valid and finite
numerical components. |
static SubrangeSurface |
newInstance(Surface child,
Curve s0,
Curve t0,
Curve s1,
Curve t1,
double tol)
Returns a
SubrangeSurface instance referring to the specified
Surface and the supplied boundary location curves in parametric space. |
static SubrangeSurface |
newInstance(Surface child,
double s0,
double t0,
double s1,
double t1)
Returns a SubrangeSurface on the surface
child that covers the range
of parametric positions from s0,t0 to s1,t1 . |
static SubrangeSurface |
newInstance(Surface child,
Surface par)
Returns a
SubrangeSurface instance referring to the specified
Surface and the supplied 2D surface in parametric space which maps the
SubrangeSurface to the child Surface. |
static void |
recycle(SubrangeSurface instance)
Recycles a SubrangeSurface instance immediately (on the stack when executing in a
StackContext).
|
SubrangeSurface |
reverseS()
Return a new surface that is identical to this one, but with the S-parameterization
reversed.
|
SubrangeSurface |
reverseT()
Return a new surface that is identical to this one, but with the T-parameterization
reversed.
|
void |
setParPosition(Surface par)
Sets the range of parametric positions on the child object that this surface refers
to.
|
int |
size()
Returns the number of child-elements that make up this geometry element.
|
GeomList<SubrangeSurface> |
splitAtS(double s)
Split this
SubrangeSurface 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<SubrangeSurface> |
splitAtT(double t)
Split this
SubrangeSurface 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). |
SubrangeSurface |
to(Unit<Length> unit)
Returns the equivalent to this surface but stated in the specified unit.
|
SubrangeSurface |
toDimension(int newDim)
Return the equivalent of this surface converted to the specified number of physical
dimensions.
|
NurbsSurface |
toNurbs(Parameter<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.
|
SubrangeSurface |
transpose()
Return a new surface that is identical to this one but with the transpose of the
parameterization of this surface.
|
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, isPlanar, splitAtS, splitAtT
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
addChangeListener, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
public static SubrangeSurface newInstance(Surface child, Surface par)
SubrangeSurface
instance referring to the specified
Surface
and the supplied 2D surface in parametric space which maps the
SubrangeSurface to the child Surface. The mapping surface in parametric space must
be in units of meters and be in the range 0,0 to 1,1.child
- The Surface
that this surface is subranged onto (may not be
null
).par
- A 2D surface in parametric space (between 0,0 and 1,1 in meters) that
maps the parametric positions from the subrange surface to the child
surface. If null
is passed, the full parametric boundary
of the child surface is used.DimensionException
- if the input parametric space surface does not have a
parametric dimension equal to 2.public static SubrangeSurface newInstance(Surface child, Curve s0, Curve t0, Curve s1, Curve t1, double tol)
SubrangeSurface
instance referring to the specified
Surface
and the supplied boundary location curves in parametric space. The
boundary curves in parametric space must be in units of meters and be in the range
0,0 to 1,1. The start points of the s0,t0 curves must be coincident. The start of
the s1 curve and end of the t0 curve must be coincident. The end of the s1 curve
and end of the t1 curve must be coincident. And, the end of the s0 curve and start
of the t1 curve must be coincident. The corner points of the parametric curves are
checked for proper coincidence.child
- The Surface
that this surface is subranged onto (may not be
null
).s0
- A 2D curve of the parametric position (between 0,0 and 1,1 in meters)
along each parametric dimension or a subrange curve on the child
surface that serves as the s=0 boundary for the subrange surface.t0
- A 2D curve of the parametric position (between 0,0 and 1,1 in meters)
along each parametric dimension or a subrange curve on the child
surface that serves as the t=0 boundary for the subrange surface.s1
- A 2D curve of the parametric position (between 0,0 and 1,1 in meters)
along each parametric dimension that serves as the s=1 boundary for
the subrange surface.t1
- A 2D curve of the parametric position (between 0,0 and 1,1 in meters)
along each parametric dimension or a subrange curve on the child
surface that serves as the t=1 boundary for the subrange surface.tol
- A tolerance (in parameter space) for how closely the corner points
must match.DimensionException
- if the input boundary curves are not subranges on child
and their parametric dimensions are not equal to 2.public static SubrangeSurface newInstance(Surface child, double s0, double t0, double s1, double t1)
child
that covers the range
of parametric positions from s0,t0
to s1,t1
.child
- The Surface
object that this surface is subranged onto (may
not be null
).s0
- The parametric position on the child surface that should form the s=0
edge of the subrange surface.t0
- The parametric position on the child surface that should form the t=0
edge of the subrange surface.s1
- The parametric position on the child surface that should form the s=1
edge of the subrange surface.t1
- The parametric position on the child surface that should form the t=1
edge of the subrange surface.public ParametricGeometry getChild()
public Surface getParPosition()
getParPosition
in interface Subrange<Surface>
public void setParPosition(Surface par)
setParPosition
in interface Subrange<Surface>
par
- The mapping of parametric positions (0,0 to 1,1) from this surface to
the child surface. May not be null.public int size()
size
in interface GeomElement<SubrangeSurface>
public Curve getT0Curve()
getT0Curve
in interface Surface<SubrangeSurface>
public Curve getT1Curve()
getT1Curve
in interface Surface<SubrangeSurface>
public Curve getS0Curve()
getS0Curve
in interface Surface<SubrangeSurface>
public Curve getS1Curve()
getS1Curve
in interface Surface<SubrangeSurface>
public Point getRealPoint(double s, double t)
getRealPoint
in interface Surface<SubrangeSurface>
s
- 1st parametric dimension distance to calculate a point for (0.0 to 1.0
inclusive).t
- 2nd parametric dimension distance to calculate a point for (0.0 to 1.0
inclusive).java.lang.IllegalArgumentException
- if there is any problem with the parameter values.public java.util.List<Vector<Length>> getSDerivatives(double s, double t, int grade, boolean scaled)
0
to grade
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.
getSDerivatives
in class AbstractSurface<SubrangeSurface>
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 uA-derivatives for (1=1st
derivative, 2=2nd derivative, etc)scaled
- Pass true
for properly scaled derivatives or
false
if the magnitude of the derivative vector is not
required -- this sometimes results in faster calculation times.java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are
invalid.public java.util.List<Vector<Length>> getTDerivatives(double s, double t, int grade, boolean scaled)
0
to grade
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.
getTDerivatives
in class AbstractSurface<SubrangeSurface>
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
- Pass true
for properly scaled derivatives or
false
if the magnitude of the derivative vector is not
required -- this sometimes results in faster calculation times.java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are
invalid.public Vector<Length> getTwistVector(double s, double t)
getTwistVector
in interface Surface<SubrangeSurface>
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).java.lang.IllegalArgumentException
- if the parameter values are invalid.public SubrangeSurface reverseS()
reverseS
in interface Surface<SubrangeSurface>
reverseT()
public SubrangeSurface reverseT()
reverseT
in interface Surface<SubrangeSurface>
reverseS()
public SubrangeSurface transpose()
transpose
in interface Surface<SubrangeSurface>
transpose
in class AbstractSurface<SubrangeSurface>
reverseT()
,
reverseS()
public GeomList<SubrangeSurface> splitAtS(double s)
SubrangeSurface
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).splitAtS
in interface Surface<SubrangeSurface>
s
- The S-parametric position where this surface should be split (must not be
0 or 1!).public GeomList<SubrangeSurface> splitAtT(double t)
SubrangeSurface
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).splitAtT
in interface Surface<SubrangeSurface>
t
- The T-parametric position where this surface should be split (must not be
0 or 1!).public SubrangeSurface getTransformed(GTransform transform)
GeomTransform
and contains this element as a child.getTransformed
in interface Transformable<SubrangeSurface>
transform
- The transformation to apply to this geometry. May not be null.DimensionException
- if this point is not 3D.public Point getBoundsMin()
getBoundsMin
in interface GeomElement<SubrangeSurface>
java.lang.IndexOutOfBoundsException
- if this list contains no elements.public Point getBoundsMax()
getBoundsMax
in interface GeomElement<SubrangeSurface>
java.lang.IndexOutOfBoundsException
- if this list contains no elements.public int getPhyDimension()
Surface
objects.getPhyDimension
in interface GeomElement<SubrangeSurface>
public SubrangeSurface toDimension(int newDim)
toDimension
in interface GeomElement<SubrangeSurface>
toDimension
in interface ParametricGeometry<SubrangeSurface>
toDimension
in interface Surface<SubrangeSurface>
newDim
- The dimension of the surface to return.public NurbsSurface toNurbs(Parameter<Length> tol)
toNurbs
in interface Surface<SubrangeSurface>
tol
- The greatest possible difference between this surface and the NURBS
representation returned. May not be null.public Unit<Length> getUnit()
getUnit
in interface GeomElement<SubrangeSurface>
public SubrangeSurface to(Unit<Length> unit) throws ConversionException
to
in interface GeomElement<SubrangeSurface>
to
in interface ParametricGeometry<SubrangeSurface>
to
in interface Surface<SubrangeSurface>
unit
- the length unit of the surface to be returned.ConversionException
- if the the input unit is not a length unit.public boolean isValid()
true
if this SubrangeSurface contains valid and finite
numerical components. A value of false
will be returned if any of the
member curves are not valid.isValid
in interface GeomElement<SubrangeSurface>
public boolean isDegenerate(Parameter<Length> tol)
true
if this surface is degenerate (i.e.: has area less than
the specified tolerance squared).isDegenerate
in interface ParametricGeometry<SubrangeSurface>
isDegenerate
in interface Surface<SubrangeSurface>
isDegenerate
in class AbstractSurface<SubrangeSurface>
tol
- The tolerance for determining if this surface is degenerate. May not be
null.public boolean equals(java.lang.Object obj)
SubrangeSurface
for equality.
Returns true if and only if both surfaces are of the same type, have the same child
surface, and both contain the same boundary curves in the same order.equals
in class AbstractGeomElement<SubrangeSurface>
obj
- the object to compare with.true
if this surface is identical to that surface;
false
otherwise.public int hashCode()
SubrangeSurface
.hashCode
in class AbstractGeomElement<SubrangeSurface>
public SubrangeSurface copyToReal()
copyToReal
in interface GeomElement<SubrangeSurface>
public SubrangeSurface copy()
SubrangeSurface
instance
allocated
by the calling thread
(possibly on the stack).copy
in interface GeomElement<SubrangeSurface>
copy
in interface ParametricGeometry<SubrangeSurface>
copy
in interface Surface<SubrangeSurface>
public javolution.text.Text toText()
toText
in interface GeomElement<SubrangeSurface>
toText
in class AbstractGeomElement<SubrangeSurface>
public static void recycle(SubrangeSurface instance)
instance
- The instance to be recycled.