Class SurfaceUtils


  • public final class SurfaceUtils
    extends java.lang.Object
    A collection of utility methods for working with NURBS surfaces.

    Modified by: Joseph A. Huwaldt

    Version:
    February 17, 2025
    Author:
    Joseph A. Huwaldt, Date: September 10, 2010
    • Method Detail

      • elevateToDegree

        public static NurbsSurface elevateToDegree​(NurbsSurface srf,
                                                   int degreeS,
                                                   int degreeT)
        Elevate the degree of a surface to the specified degree in the S & T directions. If the specified degrees are both ≤ the current degree of the surface in each direction, then no change is made and a reference to the input surface is returned.
        Parameters:
        srf - The surface to have the degrees elevated. May not be null.
        degreeS - The desired degree for the surface to be elevated to in the S-direction.
        degreeT - The desired degree for the surface to be elevated to in the T-direction.
        Returns:
        The input NurbsSurface with the S & T degree elevated to the specified degrees.
      • degreeElevate

        public static NurbsSurface degreeElevate​(NurbsSurface srf,
                                                 int tS,
                                                 int tT)
        Elevate the degree of a surface by the specified number of times in the S and T directions.
        Parameters:
        srf - The surface to have the degrees elevated. May not be null.
        tS - The number of times to elevate the degree in the S-direction.
        tT - The number of times to elevate the degree in the T-direction.
        Returns:
        The input NurbsSurface with the S & T degree elevated by the specified amount.
      • decomposeToBezier

        public static GeomList<GeomList<BasicNurbsSurface>> decomposeToBezier​(NurbsSurface srf)
        Decompose a NURBS surface into a list of lists of Bezier patches. The returned list contains lists of NURBS surfaces that represent each Bezier patch. Each list contains patches in the s-direction (t-direction is across the lists).
        Parameters:
        srf - The surface to be decomposed into Bezier patches. May not be null.
        Returns:
        A list of lists of Bezier patches that have a degree of at least 2.
      • getBezierStartParameters

        public static javolution.util.FastTable<java.lang.Double> getBezierStartParameters​(NurbsSurface srf,
                                                                                           int dir)
        Returns a list containing the parameters at the start (and end) of each Bezier patch of the specified NURBS surface in the specified direction. This first element of this list will always be zero and the last will always be 1.
        Parameters:
        srf - The NURBS surface to extract the Bezier patches for. May not be null.
        dir - The direction to return the start parameters in (0=S, 1=T).
        Returns:
        A list containing the parameters at the start (and end) of each Bezier patch of the specified NURBS surface in the specified direction.