Class AbstractSurface<T extends AbstractSurface>
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractSurface<T>
-
- Type Parameters:
T
- The sub-type of this AbstractSurface element.
- All Implemented Interfaces:
GeomElement<T>
,ParametricGeometry<T>
,Surface<T>
,Transformable<T>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
- Direct Known Subclasses:
LoftedSurface
,NurbsSurface
,SubrangeSurface
,TFISurface
public abstract class AbstractSurface<T extends AbstractSurface> extends AbstractGeomElement<T> implements Surface<T>
The interface and implementation in common to all surfaces.Modified by: Joseph A. Huwaldt
- Version:
- February 14, 2025
- Author:
- Joseph A. Huwaldt, Date: June 14, 2010
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
GTOL
Generic/default tolerance for use in root finders, etc.-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Constructor Summary
Constructors Constructor Description AbstractSurface()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PointArray<SubrangePoint>
extractGrid(GridRule gridRule, java.util.List<java.lang.Double> bottomSpacing, java.util.List<java.lang.Double> topSpacing, java.util.List<java.lang.Double> leftSpacing, java.util.List<java.lang.Double> rightSpacing)
Return an array of SubrangePoint objects that are gridded onto the surface using the specified spacings and gridding rule.Parameter<javax.measure.quantity.Area>
getArea(double eps)
Return the surface area of this entire surface.Parameter<javax.measure.quantity.Area>
getArea(double s1, double t1, double s2, double t2, double eps)
Return the surface area of a portion of this surface.Parameter<javax.measure.quantity.Area>
getArea(GeomPoint st1, GeomPoint st2, double eps)
Return the surface area of a portion of this surface.PointString<SubrangePoint>
getClosest(Curve curve, double tol)
Returns the closest points (giving the minimum distance) between this surface and the specified curve.SubrangePoint
getClosest(GeomPlane plane, double tol)
Returns the closest point (giving the minimum distance) between this surface and the specified plane.SubrangePoint
getClosest(GeomPoint point, double tol)
Returns the closest point on this surface to the specified point.SubrangePoint
getClosest(GeomPoint point, double nearS, double nearT, double tol)
Returns the closest point on this surface to the specified point near the specified parametric position.PointString<SubrangePoint>
getClosest(Surface surface, double tol)
Returns the closest points (giving the minimum distance) between this surface and the specified surface.PointArray<SubrangePoint>
getClosest(java.util.List<? extends java.util.List<GeomPoint>> points, double tol)
Returns the array of closest points on this surface to the specified array (list of lists) of points.SubrangeCurve
getCurve(Curve pcrv)
Return a subrange curve on the surface for the given parametric position curve.java.util.List<java.util.List<Vector<javax.measure.quantity.Length>>>
getDerivatives(GeomPoint st, int grade)
Calculate all the derivatives from0
tograde
with respect to parametric position(s) on a parametric object for the given parametric position on the object,d^{grade}p(s)/d^{grade}s
.SubrangePoint
getFarthest(GeomPoint point, double tol)
Returns the farthest point on this surface from the specified point.SubrangePoint
getFarthest(GeomPoint point, double nearS, double nearT, double tol)
Returns the farthest point on this surface from the specified point near the specified parametric position on the surface.PointArray<SubrangePoint>
getFarthest(java.util.List<? extends java.util.List<GeomPoint>> points, double tol)
Returns the array of farthest points on this surface from the specified array (list of lists) of points.Parameter
getGaussianCurvature(double s, double t)
Returns the Gaussian Curvature for this surface at the given parametric position (s,t) on this surface.Parameter
getGaussianCurvature(GeomPoint st)
Returns the Gaussian Curvature for this surface at the given parametric position (s,t) on this surface.SubrangePoint
getLimitPoint(int dim, boolean max, double tol)
Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this surface.Parameter
getMeanCurvature(double s, double t)
Returns the Mean Curvature for this surface at the given parametric position (s,t) on this surface.Parameter
getMeanCurvature(GeomPoint st)
Returns the Mean Curvature for this surface at the given parametric position (s,t) on this surface.Vector<javax.measure.quantity.Dimensionless>
getNormal(double s, double t)
Return the at least 3D normal vector for this surface at the given parametric position (s,t) on this surface.Vector<javax.measure.quantity.Dimensionless>
getNormal(GeomPoint st)
Return the normal vector for this surface at the given parametric position (s,t) on this surface.int
getParDimension()
Returns the number of parametric dimensions of the geometry element.SubrangePoint
getPoint(double s, double t)
Return a subrange point on the surface for the given parametric position on the surface.SubrangePoint
getPoint(GeomPoint st)
Return a subrange point on the surface for the given parametric position on the surface.Point
getRealPoint(GeomPoint st)
Calculate a point on the surface for the given parametric position on the surface.SubrangeCurve
getSCurve(double s)
Return a subrange curve at a constant parametric s-value.Vector<javax.measure.quantity.Length>
getSDerivative(double s, double t, int grade)
Calculate a derivative with respect to parametric s-distance of the given grade on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}s
.Vector<javax.measure.quantity.Length>
getSDerivative(GeomPoint st, int grade)
Calculate a derivative with respect to parametric s-distance of the given grade on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}s
.java.util.List<Vector<javax.measure.quantity.Length>>
getSDerivatives(double s, double t, int grade)
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
.abstract 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
.java.util.List<Vector<javax.measure.quantity.Length>>
getSDerivatives(GeomPoint st, int grade)
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
.Plane
getTangentPlane(double s, double t)
Return the tangent plane to this surface at the given parametric position (s,t) on this surface.Plane
getTangentPlane(GeomPoint st)
Return the tangent plane to this surface at the given parametric position (s,t) on this surface.SubrangeCurve
getTCurve(double t)
Return a subrange curve at a constant parametric t-value.Vector<javax.measure.quantity.Length>
getTDerivative(double s, double t, int grade)
Calculate a derivative with respect to parametric t-distance of the given grade on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}t
.Vector<javax.measure.quantity.Length>
getTDerivative(GeomPoint st, int grade)
Calculate a derivative with respect to parametric t-distance of the given grade on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}t
.java.util.List<Vector<javax.measure.quantity.Length>>
getTDerivatives(double s, double t, int grade)
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
.abstract 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
.java.util.List<Vector<javax.measure.quantity.Length>>
getTDerivatives(GeomPoint st, int grade)
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
.Vector<javax.measure.quantity.Length>
getTwistVector(GeomPoint st)
Calculate the twist vector (d^2P/(ds*dt) = d(dP/ds)/dt) for this surface at the specified position on this surface.Parameter<javax.measure.quantity.Volume>
getVolume(double eps)
Return the enclosed volume of this entire surface.Parameter<javax.measure.quantity.Volume>
getVolume(double s1, double t1, double s2, double t2, double eps)
Return the enclosed volume of a portion of this surface.Parameter<javax.measure.quantity.Volume>
getVolume(GeomPoint st1, GeomPoint st2, double eps)
Return the enclosed volume of a portion of this surface.PointArray<SubrangePoint>
gridToTolerance(Parameter<javax.measure.quantity.Length> tol)
Return an array of points that are gridded onto the surface with the number of points and spacing chosen to result in straight line segments between the points that have mid-points that are all within the specified tolerance of this surface.GeomList<PointString<SubrangePoint>>
intersect(Curve curve, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between a curve and this surface.GeomList<SubrangeCurve>
intersect(GeomPlane plane, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between an infinite plane and this surface.PointString<SubrangePoint>
intersect(GeomPoint L0, GeomVector Ldir, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between an infinite line and this surface.GeomList<PointString<SubrangePoint>>
intersect(LineSegment line, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between a line segment and this surface.GeomList<GeomList<SubrangeCurve>>
intersect(Surface surface, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between another surface and this surface.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(double epsFT, double epsELT)
Returntrue
if this surface is planar orfalse
if it is not.boolean
isPlanar(Parameter<javax.measure.quantity.Length> tol)
Returntrue
if this surface is planar orfalse
if it is not.GeomList<T>
splitAtS(GeomPoint st)
Split this surface 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<T>
splitAtT(GeomPoint st)
Split this surface 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).T
transpose()
Always throws UnsupportedOperationException as this method is not supported for this object type! Subclasses that do support transpose() should override this method.-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, equals, getAllUserData, getID, getName, getUserData, hashCode, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString, toText
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, copyToReal, getAllUserData, getBoundsMax, getBoundsMin, getID, getName, getPhyDimension, getUnit, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
-
Methods inherited from interface geomss.geom.Surface
copy, getRealPoint, getS0Curve, getS1Curve, getT0Curve, getT1Curve, getTwistVector, reverseS, reverseT, splitAtS, splitAtT, to, toDimension, toNurbs
-
Methods inherited from interface geomss.geom.Transformable
getTransformed
-
-
-
-
Field Detail
-
GTOL
public static final double GTOL
Generic/default tolerance for use in root finders, etc.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractSurface
public AbstractSurface()
-
-
Method Detail
-
getParDimension
public int getParDimension()
Returns the number of parametric dimensions of the geometry element. This implementation always returns 2.- Specified by:
getParDimension
in interfaceGeomElement<T extends AbstractSurface>
- Returns:
- The number of parametric dimensions of this geometry element.
-
transpose
public T transpose()
Always throws UnsupportedOperationException as this method is not supported for this object type! Subclasses that do support transpose() should override this method.- Specified by:
transpose
in interfaceSurface<T extends AbstractSurface>
- Returns:
- A new surface, identical to this one, but with the transpose of the parameterization.
- Throws:
java.lang.UnsupportedOperationException
- as this method is not supported on this object type.
-
splitAtS
public GeomList<T> splitAtS(GeomPoint st)
Split this surface 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).- Specified by:
splitAtS
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The S-parametric position where this surface should be split (must not be 0 or 1!). Must be a 2-dimensional point with each value in the range 0 to 1, only the 1st value is used. Units are ignored. May not be null.- Returns:
- A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
-
splitAtT
public GeomList<T> splitAtT(GeomPoint st)
Split this surface 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).- Specified by:
splitAtT
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The T-parametric position where this surface should be split (must not be 0 or 1!). Must be a 2-dimensional point with each value in the range 0 to 1, only the 2nd value is used. Units are ignored. May not be null.- Returns:
- A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
-
getPoint
public SubrangePoint getPoint(double s, double t)
Return a subrange point on the surface for the given parametric position on the surface.- Specified by:
getPoint
in interfaceSurface<T extends AbstractSurface>
- Parameters:
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).- Returns:
- The subrange point on the surface at the specified parameter values.
- Throws:
java.lang.IllegalArgumentException
- if there is any problem with the parameter values.
-
getPoint
public SubrangePoint getPoint(GeomPoint st)
Return a subrange point on the surface for the given parametric position on the surface.- Specified by:
getPoint
in interfaceParametricGeometry<T extends AbstractSurface>
- Specified by:
getPoint
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate a point for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- Returns:
- The subrange point on the surface at the specified parameter values.
- Throws:
java.lang.IllegalArgumentException
- if there is any problem with the parameter values.
-
getRealPoint
public Point getRealPoint(GeomPoint st)
Calculate a point on the surface for the given parametric position on the surface.- Specified by:
getRealPoint
in interfaceParametricGeometry<T extends AbstractSurface>
- Specified by:
getRealPoint
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate a point for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- 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.
-
getCurve
public SubrangeCurve getCurve(Curve pcrv)
Return a subrange curve on the surface for the given parametric position curve.- Specified by:
getCurve
in interfaceSurface<T extends AbstractSurface>
- Parameters:
pcrv
- A curve in parametric space indicating the parametric positions on the the surface represented by the subrange curve. Must be 2D with values between 0 and 1.- Returns:
- The subrange curve on the surface at the specified parametric curve positions.
-
getSCurve
public SubrangeCurve getSCurve(double s)
Return a subrange curve at a constant parametric s-value.- Specified by:
getSCurve
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s
- The parametric s-position to extract a subrange curve.- Returns:
- The subrange curve on the surface at the specified s-value.
- Throws:
java.lang.IllegalArgumentException
- if there is any problem with the parameter value.
-
getTCurve
public SubrangeCurve getTCurve(double t)
Return a subrange curve at a constant parametric t-value.- Specified by:
getTCurve
in interfaceSurface<T extends AbstractSurface>
- Parameters:
t
- The parametric t-position to extract a subrange curve.- Returns:
- The subrange curve on the surface at the specified t-value.
- Throws:
java.lang.IllegalArgumentException
- if there is any problem with the parameter value.
-
getDerivatives
public java.util.List<java.util.List<Vector<javax.measure.quantity.Length>>> getDerivatives(GeomPoint st, int grade)
Calculate all the derivatives from0
tograde
with respect to parametric position(s) on a parametric object for the given parametric position on the object,d^{grade}p(s)/d^{grade}s
.Example:
1st derivative (grade = 1), this returns[p(s), dp(s)/ds]
;
2nd derivative (grade = 2), this returns[p(s), dp(s)/ds, d^2p(s)/d^2s]
; etc.- Specified by:
getDerivatives
in interfaceParametricGeometry<T extends AbstractSurface>
- Specified by:
getDerivatives
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the derivatives for. Must match the parametric dimension of this parametric surface and have each value in the range 0 to 1.0. Units are ignored.grade
- The maximum grade to calculate the derivatives for (1=1st derivative, 2=2nd derivative, etc)- Returns:
- A list of lists of derivatives (one list for each parametric dimension). Each list contains derivatives up to the specified grade at the specified parametric position. Example: for a surface list element 0 is the array of derivatives in the 1st parametric dimension (s), then 2nd list element is the array of derivatives in the 2nd parametric dimension (t).
- Throws:
java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are invalid.
-
getSDerivatives
public java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives(GeomPoint st, int grade)
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 interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the derivatives for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.grade
- The maximum grade to calculate the derivatives for (1=1st derivative, 2=2nd derivative, etc)- 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.
-
getSDerivatives
public java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives(double s, double t, int grade)
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 interfaceSurface<T extends AbstractSurface>
- 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)- 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.
-
getSDerivatives
public abstract 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.- 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(GeomPoint st, int grade)
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 interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the derivatives for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.grade
- The maximum grade to calculate the derivatives for (1=1st derivative, 2=2nd derivative, etc)- 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.
-
getTDerivatives
public java.util.List<Vector<javax.measure.quantity.Length>> getTDerivatives(double s, double t, int grade)
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 interfaceSurface<T extends AbstractSurface>
- 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)- 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.
-
getTDerivatives
public abstract 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.- 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.
-
getSDerivative
public Vector<javax.measure.quantity.Length> getSDerivative(GeomPoint st, int grade)
Calculate a derivative with respect to parametric s-distance of the given grade 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 returnsdp(s,t)/ds
;
2nd derivative (grade = 2), this returnsd^2p(s,t)/d^2s
; etc.- Specified by:
getSDerivative
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the derivative for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.grade
- The grade to calculate the derivative for (1=1st derivative, 2=2nd derivative, etc)- Returns:
- The specified s-derivative of the surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are invalid.
-
getSDerivative
public Vector<javax.measure.quantity.Length> getSDerivative(double s, double t, int grade)
Calculate a derivative with respect to parametric s-distance of the given grade 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 returnsdp(s,t)/ds
;
2nd derivative (grade = 2), this returnsd^2p(s,t)/d^2s
; etc.- Specified by:
getSDerivative
in interfaceSurface<T extends AbstractSurface>
- 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 grade to calculate the derivative for (1=1st derivative, 2=2nd derivative, etc)- Returns:
- The specified s-derivative of the surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are invalid.
-
getTDerivative
public Vector<javax.measure.quantity.Length> getTDerivative(GeomPoint st, int grade)
Calculate a derivative with respect to parametric t-distance of the given grade 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 returnsdp(s,t)/dt
;
2nd derivative (grade = 2), this returnsd^2p(s,t)/d^2t
; etc.- Specified by:
getTDerivative
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the derivative for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.grade
- The grade to calculate the derivative for (1=1st derivative, 2=2nd derivative, etc)- Returns:
- The specified t-derivative of the surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the grade is < 0 or the parameter values are invalid.
-
getTDerivative
public Vector<javax.measure.quantity.Length> getTDerivative(double s, double t, int grade)
Calculate a derivative with respect to parametric t-distance of the given grade 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 returnsdp(s,t)/dt
;
2nd derivative (grade = 2), this returnsd^2p(s,t)/d^2t
; etc.- Specified by:
getTDerivative
in interfaceSurface<T extends AbstractSurface>
- 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 grade to calculate the derivative for (1=1st derivative, 2=2nd derivative, etc)- Returns:
- The specified t-derivative 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(GeomPoint st)
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<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the twist vector for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- Returns:
- The twist vector of this surface at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException
- if the parameter values are invalid.
-
getNormal
public Vector<javax.measure.quantity.Dimensionless> getNormal(double s, double t)
Return the at least 3D normal vector for this surface at the given parametric position (s,t) on this surface.- Specified by:
getNormal
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate normal for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate normal for (0.0 to 1.0 inclusive).- Returns:
- The at least 3D normal vector of the surface at the specified parametric position.
-
getNormal
public Vector<javax.measure.quantity.Dimensionless> getNormal(GeomPoint st)
Return the normal vector for this surface at the given parametric position (s,t) on this surface.- Specified by:
getNormal
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the normal for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- Returns:
- The normal vector of the surface at the specified parametric position.
-
getTangentPlane
public Plane getTangentPlane(double s, double t)
Return the tangent plane to this surface at the given parametric position (s,t) on this surface.- Specified by:
getTangentPlane
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate tangent plane for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate tangent plane for (0.0 to 1.0 inclusive).- Returns:
- The tangent plane of the surface at the specified parametric position.
-
getTangentPlane
public Plane getTangentPlane(GeomPoint st)
Return the tangent plane to this surface at the given parametric position (s,t) on this surface.- Specified by:
getTangentPlane
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the tangent plane for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- Returns:
- The tangent plane of the surface at the specified parametric position.
-
getGaussianCurvature
public Parameter getGaussianCurvature(double s, double t)
Returns the Gaussian Curvature for this surface at the given parametric position (s,t) on this surface.- Specified by:
getGaussianCurvature
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate curvature for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate curvature for (0.0 to 1.0 inclusive).- Returns:
- The Gaussian curvature of the surface at the specified parametric position in units of 1/Length^2.
-
getGaussianCurvature
public Parameter getGaussianCurvature(GeomPoint st)
Returns the Gaussian Curvature for this surface at the given parametric position (s,t) on this surface.- Specified by:
getGaussianCurvature
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the curvature for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- Returns:
- The Gaussian curvature of the surface at the specified parametric position in units of 1/Length^2.
-
getMeanCurvature
public Parameter getMeanCurvature(GeomPoint st)
Returns the Mean Curvature for this surface at the given parametric position (s,t) on this surface.- Specified by:
getMeanCurvature
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st
- The parametric position to calculate the curvature for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.- Returns:
- The Mean curvature of the surface at the specified parametric position in units of 1/Length.
-
getMeanCurvature
public Parameter getMeanCurvature(double s, double t)
Returns the Mean Curvature for this surface at the given parametric position (s,t) on this surface.- Specified by:
getMeanCurvature
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s
- 1st parametric dimension distance to calculate curvature for (0.0 to 1.0 inclusive).t
- 2nd parametric dimension distance to calculate curvature for (0.0 to 1.0 inclusive).- Returns:
- The Mean curvature of the surface at the specified parametric position in units of 1/Length.
-
getArea
public Parameter<javax.measure.quantity.Area> getArea(double eps)
Return the surface area of this entire surface.- Specified by:
getArea
in interfaceSurface<T extends AbstractSurface>
- Parameters:
eps
- The desired fractional accuracy on the surface area.- Returns:
- the surface area of this surface.
-
getArea
public Parameter<javax.measure.quantity.Area> getArea(GeomPoint st1, GeomPoint st2, double eps)
Return the surface area of a portion of this surface.- Specified by:
getArea
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st1
- The starting parametric position to calculate the area for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.st2
- The ending parametric position to calculate the area for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.eps
- The desired fractional accuracy on the surface area.- Returns:
- the surface area of a portion of this surface.
-
getArea
public Parameter<javax.measure.quantity.Area> getArea(double s1, double t1, double s2, double t2, double eps)
Return the surface area of a portion of this surface.- Specified by:
getArea
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s1
- The starting 1st parametric dimension distance to calculate area for (0.0 to 1.0 inclusive).t1
- The starting 2nd parametric dimension distance to calculate area for (0.0 to 1.0 inclusive).s2
- The ending 1st parametric dimension distance to calculate area for (0.0 to 1.0 inclusive).t2
- The ending 2nd parametric dimension distance to calculate area for (0.0 to 1.0 inclusive).eps
- The desired fractional accuracy on the surface area.- Returns:
- the surface area of a portion of this surface.
-
getVolume
public Parameter<javax.measure.quantity.Volume> getVolume(double eps)
Return the enclosed volume of this entire surface.- Specified by:
getVolume
in interfaceSurface<T extends AbstractSurface>
- Parameters:
eps
- The desired fractional accuracy on the enclosed volume.- Returns:
- the enclosed volume of this surface.
-
getVolume
public Parameter<javax.measure.quantity.Volume> getVolume(GeomPoint st1, GeomPoint st2, double eps)
Return the enclosed volume of a portion of this surface.- Specified by:
getVolume
in interfaceSurface<T extends AbstractSurface>
- Parameters:
st1
- The starting parametric position to calculate the volume for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.st2
- The ending parametric position to calculate the volume for. Must be a 2-dimensional point with each value in the range 0 to 1.0. Units are ignored.eps
- The desired fractional accuracy on the enclosed volume.- Returns:
- the enclosed volume of a portion of this surface.
-
getVolume
public Parameter<javax.measure.quantity.Volume> getVolume(double s1, double t1, double s2, double t2, double eps)
Return the enclosed volume of a portion of this surface.- Specified by:
getVolume
in interfaceSurface<T extends AbstractSurface>
- Parameters:
s1
- The starting 1st parametric dimension distance to calculate volume for (0.0 to 1.0 inclusive).t1
- The starting 2nd parametric dimension distance to calculate volume for (0.0 to 1.0 inclusive).s2
- The ending 1st parametric dimension distance to calculate volume for (0.0 to 1.0 inclusive).t2
- The ending 2nd parametric dimension distance to calculate volume for (0.0 to 1.0 inclusive).eps
- The desired fractional accuracy on the enclosed volume.- Returns:
- the enclosed volume of a portion of this surface.
-
extractGrid
public PointArray<SubrangePoint> extractGrid(GridRule gridRule, java.util.List<java.lang.Double> bottomSpacing, java.util.List<java.lang.Double> topSpacing, java.util.List<java.lang.Double> leftSpacing, java.util.List<java.lang.Double> rightSpacing)
Return an array of SubrangePoint objects that are gridded onto the surface using the specified spacings and gridding rule.gridRule
specifies whether the subdivision spacing is applied with respect to arc-length in real space or parameter space. If the spacing is arc-length, then the values are interpreted as fractions of the arc length of the edge curves from 0 to 1.- Specified by:
extractGrid
in interfaceSurface<T extends AbstractSurface>
- Parameters:
gridRule
- Specifies whether the subdivision spacing is applied with respect to arc-length in real space or parameter space. May not be null.bottomSpacing
- A list of values used to define the subdivision spacing along the T=0 parametric boundary of the surface. May not be null.topSpacing
- An optional list of values used to define the subdivision spacing along the T=1 parametric boundary of the surface. Ifnull
is passed, the bottomSpacing is used for the top. If topSpacing is provided, then it must have the same number of values as the bottomSpacing.leftSpacing
- A list of values used to define the subdivision spacing along the S=0 parametric boundary of the surface. May not be null.rightSpacing
- An optional list of values used to define the subdivision spacing along the S=1 parametric boundary of the surface. Ifnull
is passed, the leftSpacing is used for the right. If rightSpacing is provided, then it must have the same number of values as the leftSpacing.- Returns:
- An array of SubrangePoint objects gridded onto the surface at the specified parametric positions.
-
gridToTolerance
public PointArray<SubrangePoint> gridToTolerance(Parameter<javax.measure.quantity.Length> tol)
Return an array of points that are gridded onto the surface with the number of points and spacing chosen to result in straight line segments between the points that have mid-points that are all within the specified tolerance of this surface.- Specified by:
gridToTolerance
in interfaceSurface<T extends AbstractSurface>
- Parameters:
tol
- The maximum distance that a straight line between gridded points may deviate from this surface. May not be null or zero.- Returns:
- An array of subrange points gridded onto the surface.
-
getClosest
public SubrangePoint getClosest(GeomPoint point, double tol)
Returns the closest point on this surface to the specified point.- Specified by:
getClosest
in interfaceParametricGeometry<T extends AbstractSurface>
- Specified by:
getClosest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
point
- The point to find the closest point on this surface to. May not be null.tol
- Fractional tolerance to refine the distance to.- Returns:
- The
SubrangePoint
on this surface that is closest to the specified point.
-
getClosest
public SubrangePoint getClosest(GeomPoint point, double nearS, double nearT, double tol)
Returns the closest point on this surface to the specified point near the specified parametric position.- Specified by:
getClosest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
point
- The point to find the closest point on this surface to. May not be null.nearS
- The parametric s-position where the search for the closest point should begin.nearT
- The parametric t-position where the search for the closest point should begin.tol
- Fractional tolerance to refine the distance to.- Returns:
- The
SubrangePoint
on this surface that is closest to the specified point near the specified parametric position.
-
getClosest
public PointArray<SubrangePoint> getClosest(java.util.List<? extends java.util.List<GeomPoint>> points, double tol)
Returns the array of closest points on this surface to the specified array (list of lists) of points.- Specified by:
getClosest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
points
- A list of lists of points to find the closest point on this surface to. May not be null.tol
- Fractional tolerance to refine the distance to.- Returns:
- The
PointArray
ofSubrangePoint
on this surface that is closest to the specified list of lists of points.
-
getFarthest
public SubrangePoint getFarthest(GeomPoint point, double tol)
Returns the farthest point on this surface from the specified point.- Specified by:
getFarthest
in interfaceParametricGeometry<T extends AbstractSurface>
- Specified by:
getFarthest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
point
- The point to find the farthest point on this surface from. May not be null.tol
- Fractional tolerance to refine the distance to.- Returns:
- The
SubrangePoint
on this surface that is farthest from the specified point.
-
getFarthest
public SubrangePoint getFarthest(GeomPoint point, double nearS, double nearT, double tol)
Returns the farthest point on this surface from the specified point near the specified parametric position on the surface.- Specified by:
getFarthest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
point
- The point to find the farthest point on this surface from. May not be null.nearS
- The parametric s-position where the search for the closest point should begin.nearT
- The parametric t-position where the search for the closest point should begin.tol
- Fractional tolerance to refine the distance to.- Returns:
- The
SubrangePoint
on this surface that is farthest from the specified point.
-
getFarthest
public PointArray<SubrangePoint> getFarthest(java.util.List<? extends java.util.List<GeomPoint>> points, double tol)
Returns the array of farthest points on this surface from the specified array (list of lists) of points.- Specified by:
getFarthest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
points
- A list of lists of points to find the farthest point on this surface from. May not be null.tol
- Fractional tolerance to refine the distance to.- Returns:
- The
PointArray
ofSubrangePoint
on this surface that is farthest from the specified list of lists of points.
-
getClosest
public PointString<SubrangePoint> getClosest(Curve curve, double tol)
Returns the closest points (giving the minimum distance) between this surface and the specified curve. If the specified curve intersects this surface, then the 1st intersection found is returned (not all the intersections are found and there is no guarantee about which intersection will be returned). If the specified curve is parallel to this surface (all points are equidistant away), then any point between this surface and the specified curve could be returned as the "closest".- Specified by:
getClosest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
curve
- The curve to find the closest points between this surface and that curve on. May not be null.tol
- Fractional tolerance (in parameter space) to refine the point position to.- Returns:
- A list containing two SubrangePoint objects that represent the closest point on this surface (index 0) and the closest point on the specified curve (index 1).
-
getClosest
public PointString<SubrangePoint> getClosest(Surface surface, double tol)
Returns the closest points (giving the minimum distance) between this surface and the specified surface. If the specified surface intersects this surface, then the 1st intersection found is returned (not all the intersections are found and there is no guarantee about which intersection will be returned). If the specified surface is parallel to this surface (all points are equidistant away), then any point between this surface and the specified surface could be returned as the "closest".- Specified by:
getClosest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
surface
- The surface to find the closest points between this surface and that surface on. May not be null.tol
- Fractional tolerance (in parameter space) to refine the point position to.- Returns:
- A list containing two SubrangePoint objects that represent the closest point on this surface (index 0) and the closest point on the specified surface (index 1).
-
getClosest
public SubrangePoint getClosest(GeomPlane plane, double tol)
Returns the closest point (giving the minimum distance) between this surface and the specified plane. If the specified plane intersects this surface, then the 1st intersection found is returned (not all the intersections are found and there is no guarantee about which intersection will be returned). If the specified plane is parallel to this surface (all points are equidistant away), then any point between this surface and the specified plane could be returned as the "closest".- Specified by:
getClosest
in interfaceSurface<T extends AbstractSurface>
- Parameters:
plane
- The plane to find the closest points between this surface and that plane on. May not be null.tol
- Fractional tolerance (in parameter space) to refine the point position to.- Returns:
- A SubrangePoint that represent the closest point on this surface to the specified plane.
-
getLimitPoint
public SubrangePoint getLimitPoint(int dim, boolean max, double tol)
Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this surface. This is more accurate thangetBoundsMax()
&getBoundsMin()
, but also typically takes longer to compute.- Specified by:
getLimitPoint
in interfaceGeomElement<T extends AbstractSurface>
- Parameters:
dim
- An index indicating the dimension to find the min/max point for (0=X, 1=Y, 2=Z, etc).max
- Set totrue
to return the maximum value,false
to return the minimum.tol
- Fractional tolerance (in parameter space) to refine the min/max point position to.- Returns:
- The point found on this surface that is the min or max in the specified coordinate direction.
- See Also:
GeomElement.getBoundsMin()
,GeomElement.getBoundsMax()
-
intersect
public PointString<SubrangePoint> intersect(GeomPoint L0, GeomVector Ldir, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between an infinite line and this surface.- Specified by:
intersect
in interfaceSurface<T extends AbstractSurface>
- Parameters:
L0
- A point on the line (origin of the line). May not be null.Ldir
- The direction vector for the line (does not have to be a unit vector). May not be null.tol
- Tolerance (in physical space) to refine the point positions to. May not be null.- Returns:
- A PointString containing zero or more subrange points made by the intersection of this surface with the specified infinite line. If no intersection is found, an empty PointString is returned.
-
intersect
public GeomList<PointString<SubrangePoint>> intersect(LineSegment line, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between a line segment and this surface.- Specified by:
intersect
in interfaceSurface<T extends AbstractSurface>
- Parameters:
line
- A line segment to intersect with this surface. May not be null.tol
- Tolerance (in physical space) to refine the point positions to. May not be null.- Returns:
- A list containing two PointString instances each containing zero or more subrange points, on this surface and the input line segment respectively, made by the intersection of this surface with the specified line segment. If no intersections are found a list of two empty PointStrings are returned.
-
intersect
public GeomList<PointString<SubrangePoint>> intersect(Curve curve, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between a curve and this surface.- Specified by:
intersect
in interfaceSurface<T extends AbstractSurface>
- Parameters:
curve
- The curve to intersect with this surface. May not be null.tol
- Tolerance (in physical space) to refine the point positions to. May not be null.- Returns:
- A list containing two PointString instances each containing zero or more subrange points, on this surface and the input curve respectively, made by the intersection of this surface with the specified curve. If no intersections are found a list of two empty PointStrings are returned.
-
intersect
public GeomList<SubrangeCurve> intersect(GeomPlane plane, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between an infinite plane and this surface.- Specified by:
intersect
in interfaceSurface<T extends AbstractSurface>
- Parameters:
plane
- The infinite plane to intersect with this surface. May not be null.tol
- Tolerance (in physical space) to refine the point positions to. May not be null.- Returns:
- A PointString containing zero or more subrange points made by the intersection of this surface with the specified infinite plane. If no intersection is found, an empty PointString is returned.
-
intersect
public GeomList<GeomList<SubrangeCurve>> intersect(Surface surface, Parameter<javax.measure.quantity.Length> tol)
Return the intersections between another surface and this surface.- Specified by:
intersect
in interfaceSurface<T extends AbstractSurface>
- Parameters:
surface
- A surface to intersect with this surface. May not be null.tol
- Tolerance (in physical space) to refine the point positions to. May not be null.- Returns:
- A list containing two lists of SubrangeCurve objects. Each list contains zero or more subrange curves, on this surface and the input surface respectively, made by the intersection of this surface with the specified surface. If no intersections are found a list of two empty lists is returned.
-
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<T extends AbstractSurface>
- Specified by:
isDegenerate
in interfaceSurface<T extends AbstractSurface>
- 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<T extends AbstractSurface>
- 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.
-
isPlanar
public boolean isPlanar(double epsFT, double epsELT)
Returntrue
if this surface is planar orfalse
if it is not.- Specified by:
isPlanar
in interfaceSurface<T extends AbstractSurface>
- Parameters:
epsFT
- Flatness tolerance (cosine of the angle allowable between normal vectors).epsELT
- Edge linearity tolerance (cosine of the angle allowable between edge vectors).- Returns:
- true if this surface is planar.
-
-