Package geomss.geom

Class TFISurface

  • All Implemented Interfaces:
    GeomElement<TFISurface>, ParametricGeometry<TFISurface>, Surface<TFISurface>, Transformable<TFISurface>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, javolution.lang.Reusable, javolution.xml.XMLSerializable

    public class TFISurface
    extends AbstractSurface<TFISurface>
    Represents a bi-linearly blended transfinite interpolation (TFI) or Coons patch surface defined from four boundary curves. The boundary curves must meet at each of the 4 corners of the patch. It is assumed that all the input curves are oriented in an appropriate direction and order to create the desired TFI surface.

    Modified by: Joseph A. Huwaldt

    Version:
    October 29, 2017
    Author:
    Joseph A. Huwaldt, Date: April 17, 2013
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        public static TFISurface newInstance​(Curve s0,
                                             Curve t0,
                                             Curve s1,
                                             Curve t1)
        Return a TFISurface made up of the specified boundary Curve objects. It is assumed that the boundary curves are ordered properly and that the end points are coincident. No check for this is made.
        Parameters:
        s0 - The curve that serves as the s=0 boundary of this surface. May not be null.
        t0 - The curve that serves as the t=0 boundary of this surface. May not be null.
        s1 - The curve that serves as the s=1 boundary of this surface. May not be null.
        t1 - The curve that serves as the t=1 boundary of this surface. May not be null.
        Returns:
        The TFISurface with the specified boundary curves.
      • newInstance

        public static TFISurface newInstance​(java.lang.String name,
                                             Curve s0,
                                             Curve t0,
                                             Curve s1,
                                             Curve t1)
        Return a TFISurface made up of the specified boundary Curve objects. It is assumed that the boundary curves are ordered properly and that the end points are coincident. No check for this is made.
        Parameters:
        name - The name to be assigned to this surface (may be null).
        s0 - The curve that serves as the s=0 boundary of this surface. May not be null.
        t0 - The curve that serves as the t=0 boundary of this surface. May not be null.
        s1 - The curve that serves as the s=1 boundary of this surface. May not be null.
        t1 - The curve that serves as the t=1 boundary of this surface. May not be null.
        Returns:
        The TFISurface with the specified boundary curves.
      • getPhyDimension

        public int getPhyDimension()
        Returns the number of physical dimensions of the geometry element. This implementation always returns the physical dimension of the underlying Curve objects.
        Returns:
        The number of physical dimensions of the geometry element.
      • toDimension

        public TFISurface 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.
        Parameters:
        newDim - The dimension of the surface to return.
        Returns:
        This surface converted to the new dimensions.
      • size

        public int size()
        Returns the number of child-elements that make up this geometry element. This implementation always returns 4 for the four boundary curves.
        Returns:
        The number of child-elements that make up this geometry element.
      • getRealPoint

        public Point getRealPoint​(double s,
                                  double t)
        Calculate a point on the surface for the given parametric position on the surface.
        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 from 0 to grade with respect to parametric s-position on the surface for the given parametric position on the surface, d^{grade}p(s,t)/d^{grade}s.

        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 class AbstractSurface<TFISurface>
        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 - Pass true for properly scaled derivatives or false if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.
        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 from 0 to grade with respect to parametric t-position on the surface for the given parametric position on the surface, d^{grade}p(s,t)/d^{grade}t.

        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 class AbstractSurface<TFISurface>
        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 - Pass true for properly scaled derivatives or false if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.
        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.
        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.
      • reverseS

        public TFISurface reverseS()
        Return a new surface that is identical to this one, but with the S-parameterization reversed.
        Returns:
        A new surface that is identical to this one, but with the S-parameterization reversed.
        See Also:
        reverseT()
      • reverseT

        public TFISurface reverseT()
        Return a new surface that is identical to this one, but with the T-parameterization reversed.
        Returns:
        A new surface that is identical to this one, but with the T-parameterization reversed.
        See Also:
        reverseS()
      • splitAtS

        public GeomList<TFISurfacesplitAtS​(double s)
        Split this SubrangeSurface at the specified parametric S-position returning a list containing two new surfaces (a lower surface with smaller S-parametric positions than "s" and an upper surface with larger S-parametric positions).
        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<TFISurfacesplitAtT​(double t)
        Split this SubrangeSurface at the specified parametric T-position returning a list containing two new surfaces (a lower surface with smaller T-parametric positions than "t" and an upper surface with larger T-parametric positions).
        Parameters:
        t - The T-parametric position where this surface should be split (must not be 0 or 1!).
        Returns:
        A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
      • getT0Curve

        public Curve getT0Curve()
        Return the T=0 Boundary for this surface as a curve.
        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.
        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.
        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.
        Returns:
        The S=1 Boundary for this surface as a curve.
      • getTransformed

        public TFISurface getTransformed​(GTransform transform)
        Returns transformed version of this element. The returned object implements GeomTransform and contains this element as a child.
        Parameters:
        transform - The transformation to apply to this geometry. May not be null.
        Returns:
        A new triangle that is identical to this one with the specified transformation applied.
        Throws:
        DimensionException - if this point is not 3D.
      • 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).
        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).
        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 this surface is stated.
        Returns:
        The unit in which this surface is stated.
      • to

        public TFISurface 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.
        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.
      • 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).
        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()
        Return true if this TFISurface contains valid and finite numerical components. A value of false will be returned if any of the member curves are not valid.
        Returns:
        true if this TFISurface contains valid and finite numerical components.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares the specified object with this TIFSurface for equality. Returns true if and only if both surfaces are of the same type and both contain the same boundary curves in the same order.
        Overrides:
        equals in class AbstractGeomElement<TFISurface>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this surface is identical to that surface; false otherwise.
      • copyToReal

        public TFISurface copyToReal()
        Return a copy of this object with any transformations or subranges removed (applied).
        Returns:
        A copy of this object with any transformations or subranges removed.
      • copy

        public TFISurface copy()
        Returns a copy of this TFISurface instance allocated by the calling thread (possibly on the stack).
        Returns:
        an identical and independent copy of this object.
      • recycle

        public static void recycle​(TFISurface instance)
        Recycles a case instance immediately (on the stack when executing in a StackContext).
        Parameters:
        instance - The instance to be recycled.