Package geomss.geom

Class SubrangeSurface

    • Method Detail

      • newInstance

        public static SubrangeSurface newInstance​(Surface child,
                                                  Surface par)
        Returns a SubrangeSurface instance referring to the specified Surface and the supplied 2D surface in parametric space which maps the SubrangeSurface to the child Surface. The mapping surface in parametric space must be in units of meters and be in the range 0,0 to 1,1.
        Parameters:
        child - The Surface that this surface is subranged onto (may not be null).
        par - A 2D surface in parametric space (between 0,0 and 1,1 in meters) that maps the parametric positions from the subrange surface to the child surface. If null is passed, the full parametric boundary of the child surface is used.
        Returns:
        the subrange surface having the specified mapping to the child surface.
        Throws:
        DimensionException - if the input parametric space surface does not have a parametric dimension equal to 2.
      • newInstance

        public static SubrangeSurface newInstance​(Surface child,
                                                  Curve s0,
                                                  Curve t0,
                                                  Curve s1,
                                                  Curve t1,
                                                  double tol)
        Returns a SubrangeSurface instance referring to the specified Surface and the supplied boundary location curves in parametric space. The boundary curves in parametric space must be in units of meters and be in the range 0,0 to 1,1. The start points of the s0,t0 curves must be coincident. The start of the s1 curve and end of the t0 curve must be coincident. The end of the s1 curve and end of the t1 curve must be coincident. And, the end of the s0 curve and start of the t1 curve must be coincident. The corner points of the parametric curves are checked for proper coincidence.
        Parameters:
        child - The Surface that this surface is subranged onto (may not be null).
        s0 - A 2D curve of the parametric position (between 0,0 and 1,1 in meters) along each parametric dimension or a subrange curve on the child surface that serves as the s=0 boundary for the subrange surface.
        t0 - A 2D curve of the parametric position (between 0,0 and 1,1 in meters) along each parametric dimension or a subrange curve on the child surface that serves as the t=0 boundary for the subrange surface.
        s1 - A 2D curve of the parametric position (between 0,0 and 1,1 in meters) along each parametric dimension that serves as the s=1 boundary for the subrange surface.
        t1 - A 2D curve of the parametric position (between 0,0 and 1,1 in meters) along each parametric dimension or a subrange curve on the child surface that serves as the t=1 boundary for the subrange surface.
        tol - A tolerance (in parameter space) for how closely the corner points must match.
        Returns:
        the subrange surface having the specified boundary curves.
        Throws:
        DimensionException - if the input boundary curves are not subranges on child and their parametric dimensions are not equal to 2.
      • newInstance

        public static SubrangeSurface newInstance​(Surface child,
                                                  double s0,
                                                  double t0,
                                                  double s1,
                                                  double t1)
        Returns a SubrangeSurface on the surface child that covers the range of parametric positions from s0,t0 to s1,t1.
        Parameters:
        child - The Surface object that this surface is subranged onto (may not be null).
        s0 - The parametric position on the child surface that should form the s=0 edge of the subrange surface.
        t0 - The parametric position on the child surface that should form the t=0 edge of the subrange surface.
        s1 - The parametric position on the child surface that should form the s=1 edge of the subrange surface.
        t1 - The parametric position on the child surface that should form the t=1 edge of the subrange surface.
        Returns:
        the subrange surface having the specified range of parametric values on the child surface.
      • getParPosition

        public Surface getParPosition()
        Returns a 2D surface in parametric space which maps this surface's parametric positions to the child surface.
        Specified by:
        getParPosition in interface Subrange<Surface>
        Returns:
        A 2D surface in parametric space that maps this surface's parameters to the child surface.
      • setParPosition

        public void setParPosition​(Surface par)
        Sets the range of parametric positions on the child object that this surface refers to. The parametric surface must be 2D, in units of meters and be in the range 0,0 to 1,1.
        Specified by:
        setParPosition in interface Subrange<Surface>
        Parameters:
        par - The mapping of parametric positions (0,0 to 1,1) from this surface to the child surface. May not be null.
      • size

        public int size()
        Returns the number of child-elements that make up this geometry element. This implementation returns the size of the child object.
        Specified by:
        size in interface GeomElement<SubrangeSurface>
        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.
        Specified by:
        getRealPoint in interface Surface<SubrangeSurface>
        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<SubrangeSurface>
        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 uA-derivatives for (1=1st derivative, 2=2nd derivative, etc)
        scaled - Pass true for properly scaled derivatives or false if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.
        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<SubrangeSurface>
        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.
        Specified by:
        getTwistVector in interface Surface<SubrangeSurface>
        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 SubrangeSurface reverseS()
        Return a new surface that is identical to this one, but with the S-parameterization reversed.
        Specified by:
        reverseS in interface Surface<SubrangeSurface>
        Returns:
        A new surface that is identical to this one, but with the S-parameterization reversed.
        See Also:
        reverseT()
      • reverseT

        public SubrangeSurface reverseT()
        Return a new surface that is identical to this one, but with the T-parameterization reversed.
        Specified by:
        reverseT in interface Surface<SubrangeSurface>
        Returns:
        A new surface that is identical to this one, but with the T-parameterization reversed.
        See Also:
        reverseS()
      • splitAtS

        public GeomList<SubrangeSurfacesplitAtS​(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).
        Specified by:
        splitAtS in interface Surface<SubrangeSurface>
        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<SubrangeSurfacesplitAtT​(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).
        Specified by:
        splitAtT in interface Surface<SubrangeSurface>
        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.
      • 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 interface GeomElement<SubrangeSurface>
        Returns:
        The minimum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no elements.
      • getBoundsMax

        public Point getBoundsMax()
        Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).
        Specified by:
        getBoundsMax in interface GeomElement<SubrangeSurface>
        Returns:
        The maximum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no elements.
      • getPhyDimension

        public int getPhyDimension()
        Returns the number of physical dimensions of the geometry element. This implementation always returns the physical dimension of the underlying Surface objects.
        Specified by:
        getPhyDimension in interface GeomElement<SubrangeSurface>
        Returns:
        The number of physical dimensions of the geometry element.
      • toDimension

        public SubrangeSurface 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 interface GeomElement<SubrangeSurface>
        Specified by:
        toDimension in interface ParametricGeometry<SubrangeSurface>
        Specified by:
        toDimension in interface Surface<SubrangeSurface>
        Parameters:
        newDim - The dimension of the surface to return.
        Returns:
        The equivalent of this surface converted to the new dimensions.
      • toNurbs

        public NurbsSurface toNurbs​(Parameter<javax.measure.quantity.Length> tol)
        Return a NURBS surface representation of this surface to within the specified tolerance.
        Specified by:
        toNurbs in interface Surface<SubrangeSurface>
        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.
      • getUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
        Returns the unit in which this surface is stated.
        Specified by:
        getUnit in interface GeomElement<SubrangeSurface>
        Returns:
        The unit in which this surface is stated.
      • to

        public SubrangeSurface 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 interface GeomElement<SubrangeSurface>
        Specified by:
        to in interface ParametricGeometry<SubrangeSurface>
        Specified by:
        to in interface Surface<SubrangeSurface>
        Parameters:
        unit - the length unit of the surface to be returned.
        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.
      • isValid

        public boolean isValid()
        Return true if this SubrangeSurface contains valid and finite numerical components. A value of false will be returned if any of the member curves are not valid.
        Specified by:
        isValid in interface GeomElement<SubrangeSurface>
        Returns:
        true if this SubrangeSurface contains valid and finite numerical components.
      • equals

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

        public SubrangeSurface copyToReal()
        Return a copy of this object with any transformations or subranges removed (applied). This method is not yet implemented and current returns a new SubrangeSurface with the child surface and subrange curves copied to real.
        Specified by:
        copyToReal in interface GeomElement<SubrangeSurface>
        Returns:
        A copy of this object with any transformations or subranges removed.
      • recycle

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