Package geomss.geom
Class LoftedSurface
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractSurface<LoftedSurface>
-
- geomss.geom.LoftedSurface
-
- All Implemented Interfaces:
GeomElement<LoftedSurface>
,GeometryList<LoftedSurface,Curve>
,ParametricGeometry<LoftedSurface>
,Surface<LoftedSurface>
,Transformable<LoftedSurface>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.lang.Iterable<Curve>
,java.util.Collection<Curve>
,java.util.List<Curve>
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
public class LoftedSurface extends AbstractSurface<LoftedSurface> implements GeometryList<LoftedSurface,Curve>
Represents a "lofted" or "skinned" surface defined from a list of definingcurves
that each define a cross-section of the surface. Each curve defines the local parameterization in the "s" direction and the spacing between them defines the parameterization in the "t" direction. Any number of curves may be added to a lofted surface, but all curves must have the same physical dimensions.Modified by: Joseph A. Huwaldt
- Version:
- February 16, 2025
- Author:
- Joseph A. Huwaldt, Date: June 24, 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 void
add(int index, Curve value)
Inserts the specifiedCurve
at the specified position in this list.boolean
add(int index, Curve... array)
Inserts all of theCurve
objects in the specified list of arguments into this list at the specified position.boolean
add(Curve value)
Appends the specifiedCurve
to the end of this surface's list of curves.boolean
add(Curve... array)
Appends all of the elements in the specified list of arguments to this geometry element list.boolean
addAll(int index, Curve[] arr)
Inserts all of theCurve
objects in the specified array into this list at the specified position.boolean
addAll(int index, java.util.Collection<? extends Curve> c)
Inserts all of the curves in the specified collection into this surface at the specified position.boolean
addAll(Curve[] arr)
Appends all of the curves in the specified array to this LoftedSurface.boolean
addAll(java.util.Collection<? extends Curve> c)
Adds all of the curves in the specified collection to this surface.void
clear()
Removes all of the curves from this surface.boolean
contains(java.lang.Object o)
Returns true if this collection contains the specified element.boolean
containsAll(java.util.Collection<?> c)
Returns true if this collection contains all of the elements in the specified collection.boolean
containsGeometry()
Returnstrue
if this list actually contains any curves andfalse
if this list is empty.LoftedSurface
copy()
Returns a copy of thisLoftedSurface
instanceallocated
by the calling thread (possibly on the stack).LoftedSurface
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 list ofCurve
objects for equality.Curve
get(int index)
Returns the Curve at the specified position in this surface's list of curves.Curve
get(java.lang.String name)
Returns theCurve
with the specified name from this list.GeomList<Curve>
getAll()
Returns an newGeomList
with the elements in this list.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).Curve
getFirst()
Returns the first curve from this surface's list of curves.int
getIndexFromName(java.lang.String name)
Return the index to the 1st Curve in this list with the specified name.Curve
getLast()
Returns the last curve from this surface's list of curves.int
getPhyDimension()
Returns the number of physical dimensions of the geometry element.LoftedSurface
getRange(int first, int last)
Returns the range of Curves in this surface from the specified start and ending indexes as a new LoftedSurface.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<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
.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.int
getTDegree()
Return the degree of the surface in the t-direction (across the defining curves).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
.LoftedSurface
getTransformed(GTransform transform)
Returns a 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 first curve in this list is stated.int
hashCode()
Returns the hash code for thisLoftedSurface
.int
indexOf(java.lang.Object element)
Returns the index in this list of the first occurrence of the specified element, or -1 if the list does not contain this element.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
isEmpty()
Returnstrue
if this collection contains no elements.boolean
isValid()
Returntrue
if this LoftedSurface contains valid and finite numerical components.java.util.Iterator<Curve>
iterator()
Returns an iterator over the curves in this surface's list of curves.int
lastIndexOf(java.lang.Object element)
Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.java.util.ListIterator<Curve>
listIterator()
Returns a list iterator over the curves in this surface.java.util.ListIterator<Curve>
listIterator(int index)
Returns a list iterator from the specified position.static LoftedSurface
newInstance(int q)
Returns a new, empty, preallocated or recycledLoftedSurface
instance (on the stack when executing in aStackContext
), that can store a list ofCurve
objects.static LoftedSurface
newInstance(java.lang.String name, int q)
Returns a new, empty, preallocated or recycledLoftedSurface
instance (on the stack when executing in aStackContext
) with the specified name, that can store a list ofCurve
objects.static void
recycle(LoftedSurface instance)
Recycles a case instance immediately (on the stack when executing in a StackContext).Curve
remove(int index)
Removes the curve at the specified position in this surface's list of curves.boolean
remove(java.lang.Object o)
Removes a single instance of the specified element from this collection, if it is present.Curve
remove(java.lang.String name)
Removes the curve with the specified name from this list.boolean
removeAll(java.util.Collection<?> c)
Removes from this list all the elements that are contained in the specified collection.void
reset()
Resets the internal state of this object to its default values.boolean
retainAll(java.util.Collection<?> c)
Retains only the elements in this list that are contained in the specified collection.LoftedSurface
reverse()
Returns an newLoftedSurface
with the curves in this surface in reverse order.LoftedSurface
reverseS()
Return a new surface that is identical to this one, but with the S-parameterization reversed.LoftedSurface
reverseT()
Return a new surface that is identical to this one, but with the T-parameterization reversed.Curve
set(int index, Curve element)
Replaces the Curve at the specified position in this surface's list of curves with the specified element.int
size()
Returns the number of elements in this surface (the number of defining curves that make up this surface).GeomList<LoftedSurface>
splitAtS(double s)
Split thisLoftedSurface
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<LoftedSurface>
splitAtT(double t)
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).java.util.List<Curve>
subList(int fromIndex, int toIndex)
Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.LoftedSurface
to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this surface but stated in the specified unit.Curve[]
toArray()
Returns an array containing all of the elements in this collection.<T> T[]
toArray(T[] a)
Returns an array containing all of the elements in this collection.LoftedSurface
toDimension(int newDim)
Return the equivalent of this surface converted to the specified number of physical dimensions.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.LoftedSurface
transpose()
Return a new surface that is identical to this one but with the transpose of the parameterization of this surface.java.util.List<Curve>
unmodifiableList()
Returns an unmodifiable list view of the curves in this surface.static LoftedSurface
valueOf(int q, Curve... curves)
Return a LoftedSurface made up of theCurve
objects in the specified array.static LoftedSurface
valueOf(int q, java.util.Collection<? extends Curve> curves)
Return a LoftedSurface made up of theCurve
objects in the specified collection.static LoftedSurface
valueOf(java.lang.String name, int q, Curve... curves)
Return a LoftedSurface made up of theCurve
objects in the specified array.static LoftedSurface
valueOf(java.lang.String name, int q, java.util.Collection<? extends Curve> curves)
Return a LoftedSurface made up of theCurve
objects in the specified collection.-
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, isPlanar, splitAtS, splitAtT
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getID, getLimitPoint, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
-
-
-
-
Method Detail
-
newInstance
public static LoftedSurface newInstance(int q)
Returns a new, empty, preallocated or recycledLoftedSurface
instance (on the stack when executing in aStackContext
), that can store a list ofCurve
objects. The list is initially empty and therefore the surface is initially undefined.- Parameters:
q
- The degree of the surface across the defining curves (in the "t" direction).- Returns:
- A new empty LoftedSurface.
-
newInstance
public static LoftedSurface newInstance(java.lang.String name, int q)
Returns a new, empty, preallocated or recycledLoftedSurface
instance (on the stack when executing in aStackContext
) with the specified name, that can store a list ofCurve
objects. The list is initially empty and therefore the surface is initially undefined.- Parameters:
name
- The name to be assigned to this surface (may benull
).q
- The degree of the surface across the defining curves (in the "t" direction).- Returns:
- A new empty LoftedSurface.
-
valueOf
public static LoftedSurface valueOf(java.lang.String name, int q, java.util.Collection<? extends Curve> curves)
Return a LoftedSurface made up of theCurve
objects in the specified collection.- Parameters:
name
- The name to be assigned to this surface (may benull
).q
- The degree of the surface across the defining curves (in the "t" direction).curves
- A collection of curves that define the surface. May not be null.- Returns:
- A new LoftedSurface made up of the curves in the specified collection.
-
valueOf
public static LoftedSurface valueOf(int q, java.util.Collection<? extends Curve> curves)
Return a LoftedSurface made up of theCurve
objects in the specified collection.- Parameters:
q
- The degree of the surface across the defining curves (in the "t" direction).curves
- A collection of curves that define the surface. May not be null.- Returns:
- A new LoftedSurface made up of the curves in the specified collection.
-
valueOf
public static LoftedSurface valueOf(java.lang.String name, int q, Curve... curves)
Return a LoftedSurface made up of theCurve
objects in the specified array.- Parameters:
name
- The name to be assigned to this surface (may benull
).q
- The degree of the surface across the defining curves (in the "t" direction).curves
- An array of curves that define the surface. May not be null.- Returns:
- A new LoftedSurface made up of the curves in the specified array.
-
valueOf
public static LoftedSurface valueOf(int q, Curve... curves)
Return a LoftedSurface made up of theCurve
objects in the specified array.- Parameters:
q
- The degree of the surface across the defining curves (in the "t" direction).curves
- An array of curves that define the surface. May not be null.- Returns:
- A new LoftedSurface made up of the curves in the specified array.
-
getTDegree
public int getTDegree()
Return the degree of the surface in the t-direction (across the defining curves).- Returns:
- degree of surface in t-direction
-
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<LoftedSurface>
- 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 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<LoftedSurface>
- 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<LoftedSurface>
- 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<LoftedSurface>
- 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.
-
getT0Curve
public Curve getT0Curve()
Return the T=0 Boundary for this surface as a curve.- Specified by:
getT0Curve
in interfaceSurface<LoftedSurface>
- Returns:
- The T=0 Boundary for this surface as a curve.
-
getT1Curve
public Curve getT1Curve()
Return the T=1 Boundary for this surface as a curve.- Specified by:
getT1Curve
in interfaceSurface<LoftedSurface>
- Returns:
- The T=1 Boundary for this surface as a curve.
-
getS0Curve
public Curve getS0Curve()
Return the S=0 Boundary for this surface as a curve.- Specified by:
getS0Curve
in interfaceSurface<LoftedSurface>
- Returns:
- The S=0 Boundary for this surface as a curve.
-
getS1Curve
public Curve getS1Curve()
Return the S=1 Boundary for this surface as a curve.- Specified by:
getS1Curve
in interfaceSurface<LoftedSurface>
- Returns:
- The S=1 Boundary for this surface as a curve.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element. This implementation always returns the physical dimension of the underlyingCurve
objects or 0 if this list has no Curve objects in it.- Specified by:
getPhyDimension
in interfaceGeomElement<LoftedSurface>
- Returns:
- The number of physical dimensions of the geometry element.
-
unmodifiableList
public java.util.List<Curve> unmodifiableList()
Returns an unmodifiable list view of the curves in this surface. Attempts to modify the returned collection result in an UnsupportedOperationException being thrown.- Specified by:
unmodifiableList
in interfaceGeometryList<LoftedSurface,Curve>
- Returns:
- the unmodifiable view over this list of curves.
-
isEmpty
public boolean isEmpty()
Returnstrue
if this collection contains no elements.
-
containsGeometry
public boolean containsGeometry()
Returnstrue
if this list actually contains any curves andfalse
if this list is empty.- Specified by:
containsGeometry
in interfaceGeometryList<LoftedSurface,Curve>
- Returns:
- true if this list actually contains geometry.
-
size
public int size()
Returns the number of elements in this surface (the number of defining curves that make up this surface). If the surface contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.- Specified by:
size
in interfacejava.util.Collection<Curve>
- Specified by:
size
in interfaceGeomElement<LoftedSurface>
- Specified by:
size
in interfacejava.util.List<Curve>
- Returns:
- the number of elements in this list of curves.
-
get
public Curve get(int index)
Returns the Curve at the specified position in this surface's list of curves.- Specified by:
get
in interfacejava.util.List<Curve>
- Parameters:
index
- index of element to return (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).- Returns:
- the Curve at the specified position in this surface.
- Throws:
java.lang.IndexOutOfBoundsException
- if the given index is out of range:index > size()
-
getFirst
public Curve getFirst()
Returns the first curve from this surface's list of curves.- Specified by:
getFirst
in interfaceGeometryList<LoftedSurface,Curve>
- Returns:
- the first curve in this list.
-
getLast
public Curve getLast()
Returns the last curve from this surface's list of curves.- Specified by:
getLast
in interfaceGeometryList<LoftedSurface,Curve>
- Returns:
- the last curve in this list.
-
getRange
public LoftedSurface getRange(int first, int last)
Returns the range of Curves in this surface from the specified start and ending indexes as a new LoftedSurface.- Specified by:
getRange
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
first
- index of the first element to return (0 returns the 1st element, -1 returns the last, etc).last
- index of the last element to return (0 returns the 1st element, -1 returns the last, etc).- Returns:
- A LoftedSurface made up of the curves in the given range from this surface.
- Throws:
java.lang.IndexOutOfBoundsException
- if the given index is out of range:index ≥ size()
-
get
public Curve get(java.lang.String name)
Returns theCurve
with the specified name from this list.- Specified by:
get
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
name
- The name of the curve we are looking for in the list.- Returns:
- The curve matching the specified name. If the specified element name
isn't found in the list, then
null
is returned.
-
subList
public java.util.List<Curve> subList(int fromIndex, int toIndex)
Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list. This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of values from a list:list.subList(from, to).clear();
Similar idioms may be constructed forindexOf
andlastIndexOf
, and all of the algorithms in theCollections
class can be applied to a subList. The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list (structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results).- Specified by:
subList
in interfacejava.util.List<Curve>
- Parameters:
fromIndex
- low endpoint (inclusive) of the subList.toIndex
- high endpoint (exclusive) of the subList.- Returns:
- a view of the specified range within this list.
- Throws:
java.lang.IndexOutOfBoundsException
- if the given index is out of range:index > size()
-
getAll
public GeomList<Curve> getAll()
Returns an newGeomList
with the elements in this list.- Specified by:
getAll
in interfaceGeometryList<LoftedSurface,Curve>
- Returns:
- A new GeomList with the elements in this list.
-
reverse
public LoftedSurface reverse()
Returns an newLoftedSurface
with the curves in this surface in reverse order. This is identical to "reverseT()".- Specified by:
reverse
in interfaceGeometryList<LoftedSurface,Curve>
- Returns:
- A new LoftedSurface with the curves in this surface in reverse order.
- See Also:
reverseT()
-
indexOf
public int indexOf(java.lang.Object element)
Returns the index in this list of the first occurrence of the specified element, or -1 if the list does not contain this element.- Specified by:
indexOf
in interfacejava.util.List<Curve>
- Parameters:
element
- The element to search for.- Returns:
- the index in this List of the first occurrence of the specified element, or -1 if the List does not contain this element.
-
lastIndexOf
public int lastIndexOf(java.lang.Object element)
Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.- Specified by:
lastIndexOf
in interfacejava.util.List<Curve>
- Parameters:
element
- The element to search for.- Returns:
- the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.
-
contains
public boolean contains(java.lang.Object o)
Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
Returns true if this collection contains all of the elements in the specified collection.
-
getIndexFromName
public int getIndexFromName(java.lang.String name)
Return the index to the 1st Curve in this list with the specified name.- Specified by:
getIndexFromName
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
name
- The name of the Curve to find in this list- Returns:
- The index to the named Curve or -1 if it is not found.
-
add
public void add(int index, Curve value)
Inserts the specifiedCurve
at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). Null values are ignored. The input value must have the same physical dimensions as the other items in this list, or an exception is thrown.Note: If this method is used concurrent access must be synchronized (the table is not thread-safe).
- Specified by:
add
in interfacejava.util.List<Curve>
- Parameters:
index
- the index at which the specified element is to be inserted. (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).value
- the element to be inserted. May not be null.- Throws:
java.lang.IndexOutOfBoundsException
- ifindex > size()
DimensionException
- if the input value dimensions are different from this list's dimensions.
-
add
public boolean add(Curve value)
Appends the specifiedCurve
to the end of this surface's list of curves. Null values are ignored. The input value must have the same physical dimensions as the other items in this list, or an exception is thrown.Note: If this method is used concurrent access must be synchronized (the table is not thread-safe).
- Specified by:
add
in interfacejava.util.Collection<Curve>
- Specified by:
add
in interfacejava.util.List<Curve>
- Parameters:
value
- the curve to be appended to this list. May not be null.- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
add
public boolean add(Curve... array)
Appends all of the elements in the specified list of arguments to this geometry element list. The input values must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
add
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
array
- elements to be inserted into this collection. May not be null.- Returns:
true
if this collection changed as a result of the call.- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
add
public boolean add(int index, Curve... array)
Inserts all of theCurve
objects in the specified list of arguments into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are appeared in the array. The input values must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
add
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
index
- index at which to insert first element from the specified array.array
- elements to be inserted into this collection. May not be null.- Returns:
true
if this collection changed as a result of the call.- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
addAll
public boolean addAll(java.util.Collection<? extends Curve> c)
Adds all of the curves in the specified collection to this surface. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty. The input elements must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
addAll
in interfacejava.util.Collection<Curve>
- Specified by:
addAll
in interfacejava.util.List<Curve>
- Parameters:
c
- curves to be inserted into this surface. May not be null.- Returns:
true
if this surface changed as a result of the call- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
addAll
public boolean addAll(int index, java.util.Collection<? extends Curve> c)
Inserts all of the curves in the specified collection into this surface at the specified position. Shifts the curve currently at that position (if any) and any subsequent curves to the right (increases their indices). The new curves will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. Note that this will occur if the specified collection is this list, and it's nonempty. The input elements must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
addAll
in interfacejava.util.List<Curve>
- Parameters:
index
- index at which to insert first curve from the specified collection.c
- curves to be inserted into this collection. May not be null.- Returns:
true
if this surface changed as a result of the call- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
addAll
public boolean addAll(Curve[] arr)
Appends all of the curves in the specified array to this LoftedSurface. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. The input array elements must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
addAll
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
arr
- curves to be appended onto this collection. May not be null.- Returns:
true
if this collection changed as a result of the call.- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
addAll
public boolean addAll(int index, Curve[] arr)
Inserts all of theCurve
objects in the specified array into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The input array elements must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
addAll
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
index
- index at which to insert first element from the specified array.arr
- elements to be inserted into this collection. May not be null.- Returns:
true
if this collection changed as a result of the call.- Throws:
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
set
public Curve set(int index, Curve element)
Replaces the Curve at the specified position in this surface's list of curves with the specified element. Null elements are ignored. The input element must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
set
in interfacejava.util.List<Curve>
- Parameters:
index
- The index of the element to replace (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).element
- The curve to be stored at the specified position. May not be null.- Returns:
- The curve previously at the specified position in this list.
- Throws:
java.lang.IndexOutOfBoundsException
- - ifindex > size()
DimensionException
- if the input element's dimensions are different from this list's dimensions.
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
Removes from this list all the elements that are contained in the specified collection.
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all the elements that are not contained in the specified collection.
-
remove
public boolean remove(java.lang.Object o)
Removes a single instance of the specified element from this collection, if it is present. More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).
-
remove
public Curve remove(int index)
Removes the curve at the specified position in this surface's list of curves. Shifts any subsequent curves to the left (subtracts one from their indices). Returns the curve that was removed from the list.- Specified by:
remove
in interfacejava.util.List<Curve>
- Parameters:
index
- the index of the curve to remove. (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).- Returns:
- the curve previously at the specified position.
-
remove
public Curve remove(java.lang.String name)
Removes the curve with the specified name from this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.- Specified by:
remove
in interfaceGeometryList<LoftedSurface,Curve>
- Parameters:
name
- the name of the element to remove.- Returns:
- the element previously at the specified position.
-
clear
public void clear()
Removes all of the curves from this surface. The surface will be empty and undefined after this call returns.
-
iterator
public java.util.Iterator<Curve> iterator()
Returns an iterator over the curves in this surface's list of curves.
-
listIterator
public java.util.ListIterator<Curve> listIterator()
Returns a list iterator over the curves in this surface.- Specified by:
listIterator
in interfacejava.util.List<Curve>
- Returns:
- an iterator over this list values.
-
listIterator
public java.util.ListIterator<Curve> listIterator(int index)
Returns a list iterator from the specified position.- Specified by:
listIterator
in interfacejava.util.List<Curve>
- Parameters:
index
- the index of first value to be returned from the list iterator (by a call to the next method).- Returns:
- a list iterator of the values in this list starting at the specified position in this list.
-
toArray
public Curve[] toArray()
Returns an array containing all of the elements in this collection.
-
toArray
public <T> T[] toArray(T[] a)
Returns an array containing all of the elements in this collection. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.- Specified by:
toArray
in interfacejava.util.Collection<Curve>
- Specified by:
toArray
in interfacejava.util.List<Curve>
- Type Parameters:
T
- The type of elements in this LoftedSurface (curve type).- Parameters:
a
- the array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same type is allocated for this purpose.- Returns:
- an array containing the elements of the collection.
-
reverseT
public LoftedSurface reverseT()
Return a new surface that is identical to this one, but with the T-parameterization reversed. This is identical to "reverse()".- Specified by:
reverseT
in interfaceSurface<LoftedSurface>
- Returns:
- A new surface that is identical to this one, but with the T-parameterization reversed.
- See Also:
reverse()
,reverseS()
-
reverseS
public LoftedSurface reverseS()
Return a new surface that is identical to this one, but with the S-parameterization reversed.- Specified by:
reverseS
in interfaceSurface<LoftedSurface>
- Returns:
- A new surface that is identical to this one, but with the S-parameterization reversed.
- See Also:
reverseT()
-
transpose
public LoftedSurface 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<LoftedSurface>
- Overrides:
transpose
in classAbstractSurface<LoftedSurface>
- Returns:
- A new surface that is identical to this one but with the transpose of the parameterization of this surface.
- See Also:
reverseT()
,reverseS()
-
splitAtS
public GeomList<LoftedSurface> splitAtS(double s)
Split thisLoftedSurface
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). This method splits all the defining section curves to create two new lofted surfaces.- Specified by:
splitAtS
in interfaceSurface<LoftedSurface>
- 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<LoftedSurface> splitAtT(double t)
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). This method interpolates a new defining section at "t" and uses the defining sections below it and above it to create two new lofted surfaces.- Specified by:
splitAtT
in interfaceSurface<LoftedSurface>
- 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.
-
toNurbs
public NurbsSurface toNurbs(Parameter<javax.measure.quantity.Length> tol)
Return a NURBS surface representation of this surface to within the specified tolerance. If the curves making up this surface are NURBS curves, then the resulting NURBS surface is an exact representation of this surface (and tol is ignored). However, if any of the member curves are not NURBS curves, then tol is used to make a NURBS approximation of that curve (and this surface).- Specified by:
toNurbs
in interfaceSurface<LoftedSurface>
- Parameters:
tol
- The greatest possible difference between this surface and the NURBS representation returned. May not be null.- Returns:
- A NURBS surface that represents this surface to within the specified tolerance.
-
isValid
public boolean isValid()
Returntrue
if this LoftedSurface contains valid and finite numerical components. A value offalse
will be returned if any of the member curves are not valid.- Specified by:
isValid
in interfaceGeomElement<LoftedSurface>
- Returns:
- true if this LoftedSurface 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<LoftedSurface>
- Specified by:
isDegenerate
in interfaceSurface<LoftedSurface>
- Overrides:
isDegenerate
in classAbstractSurface<LoftedSurface>
- Parameters:
tol
- The tolerance for determining if this surface is degenerate. May not be null.- Returns:
- true if this surface is degenerate (i.e.: has area less than the specified tolerance squared).
-
copy
public LoftedSurface copy()
Returns a copy of thisLoftedSurface
instanceallocated
by the calling thread (possibly on the stack).- Specified by:
copy
in interfaceGeomElement<LoftedSurface>
- Specified by:
copy
in interfaceParametricGeometry<LoftedSurface>
- Specified by:
copy
in interfaceSurface<LoftedSurface>
- Returns:
- an identical and independent copy of this object.
-
copyToReal
public LoftedSurface copyToReal()
Return a copy of this object with any transformations or subranges removed (applied).- Specified by:
copyToReal
in interfaceGeomElement<LoftedSurface>
- Returns:
- A copy of this object with any transformations or subranges removed.
-
getTransformed
public LoftedSurface getTransformed(GTransform transform)
Returns a transformed version of this element. The returned list of objects implementGeomTransform
and contains transformed versions of the contents of this list as children.- Specified by:
getTransformed
in interfaceTransformable<LoftedSurface>
- Parameters:
transform
- The transformation to apply to this geometry. May not be null.- Returns:
- A new LoftedSurface that is identical to this one with the specified transformation applied to member curves.
- Throws:
DimensionException
- if this surface is not 3D.
-
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<LoftedSurface>
- Returns:
- The minimum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException
- if this list contains no geometry.
-
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<LoftedSurface>
- Returns:
- The maximum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException
- if this list contains no elements.
-
getUnit
public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the first curve in this list is stated. If the list contains no curves, then the default unit is returned.- Specified by:
getUnit
in interfaceGeomElement<LoftedSurface>
- Returns:
- The unit in which the first curve in this surface is stated or the default unit if this surface has no defining curves.
-
to
public LoftedSurface 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<LoftedSurface>
- Specified by:
to
in interfaceGeometryList<LoftedSurface,Curve>
- Specified by:
to
in interfaceParametricGeometry<LoftedSurface>
- Specified by:
to
in interfaceSurface<LoftedSurface>
- 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 LoftedSurface toDimension(int newDim)
Return the equivalent of this surface converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this element is simply returned.- Specified by:
toDimension
in interfaceGeomElement<LoftedSurface>
- Specified by:
toDimension
in interfaceGeometryList<LoftedSurface,Curve>
- Specified by:
toDimension
in interfaceParametricGeometry<LoftedSurface>
- Specified by:
toDimension
in interfaceSurface<LoftedSurface>
- Parameters:
newDim
- The dimension of the surface to return.- Returns:
- This surface converted to the new dimensions.
-
equals
public boolean equals(java.lang.Object obj)
Compares the specified object with this list ofCurve
objects for equality. Returns true if and only if both collections are of the same type and both collections contain equal elements in the same order.- Specified by:
equals
in interfacejava.util.Collection<Curve>
- Specified by:
equals
in interfacejava.util.List<Curve>
- Overrides:
equals
in classAbstractGeomElement<LoftedSurface>
- Parameters:
obj
- the object to compare with.- Returns:
true
if this list is identical to that list;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code for thisLoftedSurface
.- Specified by:
hashCode
in interfacejava.util.Collection<Curve>
- Specified by:
hashCode
in interfacejava.util.List<Curve>
- Overrides:
hashCode
in classAbstractGeomElement<LoftedSurface>
- Returns:
- the hash code value.
-
toText
public javolution.text.Text toText()
Returns the text representation of this geometry element.- Specified by:
toText
in interfaceGeomElement<LoftedSurface>
- Overrides:
toText
in classAbstractGeomElement<LoftedSurface>
- Returns:
- The text representation of this geometry element.
-
reset
public void reset()
Resets the internal state of this object to its default values. Subclasses that override this method must callsuper.reset();
to ensure that the state is reset properly.- Specified by:
reset
in interfacejavolution.lang.Reusable
- Overrides:
reset
in classAbstractGeomElement<LoftedSurface>
-
recycle
public static void recycle(LoftedSurface instance)
Recycles a case instance immediately (on the stack when executing in a StackContext).- Parameters:
instance
- The instance to be recycled.
-
-