Class BasicNurbsSurface

java.lang.Object
toxi.geom.nurbs.BasicNurbsSurface
All Implemented Interfaces:
NurbsSurface

public class BasicNurbsSurface extends Object implements NurbsSurface
A Basic NurbsSurface implementation.
Version:
1.2
Author:
sg
  • Constructor Details

    • BasicNurbsSurface

      public BasicNurbsSurface(ControlNet cps, float[] uK, float[] vK, int p, int q) throws IllegalArgumentException
      Create a Nurbs Surface from the given ControlNet and the knot values of degree p in u direction and of degree q in v direction.
      Parameters:
      cps - ControlNet of the Nurbs
      uK - Knot values in u direction
      vK - Knot values in v direction
      p - degree in u direction
      q - degree in v direction
      Throws:
      IllegalArgumentException
    • BasicNurbsSurface

      public BasicNurbsSurface(ControlNet net, KnotVector u, KnotVector v) throws IllegalArgumentException
      Create a Nurbs form the Controlnet and the two Knot vectors.
      Parameters:
      net - Contorl net of Nurbs
      u - KnotVector in u direction
      v - KnotVector in v direction
      Throws:
      IllegalArgumentException
  • Method Details

    • getControlNet

      public ControlNet getControlNet()
      Description copied from interface: NurbsSurface
      Get the Contol points of the NurbsSurface
      Specified by:
      getControlNet in interface NurbsSurface
      Returns:
      ControlNet of the Nurbs
    • getUDegree

      public int getUDegree()
      Description copied from interface: NurbsSurface
      Get the degree in u direction
      Specified by:
      getUDegree in interface NurbsSurface
      Returns:
      degree in u direction
    • getUKnots

      public float[] getUKnots()
      Description copied from interface: NurbsSurface
      Get the knot values in u direction
      Specified by:
      getUKnots in interface NurbsSurface
      Returns:
      knot values in u direction
    • getUKnotVector

      public KnotVector getUKnotVector()
      Specified by:
      getUKnotVector in interface NurbsSurface
    • getVDegree

      public int getVDegree()
      Description copied from interface: NurbsSurface
      Get the degree in v direction
      Specified by:
      getVDegree in interface NurbsSurface
      Returns:
      degree in v direction
    • getVKnots

      public float[] getVKnots()
      Description copied from interface: NurbsSurface
      Get the knot values in v direction
      Specified by:
      getVKnots in interface NurbsSurface
      Returns:
      knot values in v direction
    • getVKnotVector

      public KnotVector getVKnotVector()
      Specified by:
      getVKnotVector in interface NurbsSurface
    • pointOnSurface

      public Vec3D pointOnSurface(double u, double v)
      Specified by:
      pointOnSurface in interface NurbsSurface
    • pointOnSurface

      public Vec3D pointOnSurface(float u, float v)
      Description copied from interface: NurbsSurface
      Calculate point on surface for the given u and v values
      Specified by:
      pointOnSurface in interface NurbsSurface
      Parameters:
      u - u value to caculate point from
      v - v value to caculate point from
      Returns:
      calculated point
    • pointOnSurface

      public Vec3D pointOnSurface(float u, float v, Vec3D out)
      Description copied from interface: NurbsSurface
      Calculate point on surface for the given u and v values
      Specified by:
      pointOnSurface in interface NurbsSurface
      Parameters:
      u - u value to caculate point from
      v - v value to caculate point from
      out - point to place result in.
    • surfaceDerivCpts

      public Vec4D[][][][] surfaceDerivCpts(int d, int r1, int r2, int s1, int s2)
      Description copied from interface: NurbsSurface
      Computes control points of dth derivative
      Piegel, L. The Nurbs Book, Algorithm A3.7 -> Page 114
      Specified by:
      surfaceDerivCpts in interface NurbsSurface
      Parameters:
      d - - dth derivative (0<=k+l<=d)
      r1 - - from control point (u direction; 0 for all control points)
      r2 - - to control point (u direction; n for all control points)
      s1 - - from control point (v direction; 0 for all control points)
      s2 - - to control point (v direction; n for all control points)
      Returns:
      ControlPoint4f[k][l][i][j] i,jth control point, differentiated k times
      with respect to u and l times with respect to v