Class NurbsCreator

java.lang.Object
toxi.geom.nurbs.NurbsCreator

public final class NurbsCreator extends Object
This class offers some static methods to create NurbsSurfaces and NurbsCurves from diffrent inputs.
Version:
1.0
Author:
sg
  • Method Details

    • createArc

      public static NurbsCurve createArc(Origin3D o, float r, float thetaStart, float thetaEnd)
      Create an Arc.
      Parameters:
      o - Origin to creat arc around
      r - Radius of the arc.
      thetaStart - Start angle of the arc in radians
      thetaEnd - End angle of the arc in radians. If end angle is smaller than start angle, the end angle is increased by 2*PI.
      Returns:
      A NurbsCurve for the Arc.
    • createFullCircleQuad7

      public static NurbsCurve createFullCircleQuad7(Origin3D o, float r)
      Create a full-circle NurbsCurve around the given Origin with radius r. The NurbsCurve has controlpolygon which has 7 controlpoints and the shape of quadrat.
      Parameters:
      o - Origin to create the full-circle around
      r - Radius of the full-circle
      Returns:
      A NurbsCurve for a full-circle
    • createFullCircleQuad9

      public static NurbsCurve createFullCircleQuad9(Origin3D o, float r)
      Create a full-circle NurbsCurve around the given Origin with radius r. The NurbsCurve has controlpolygon which has 9 controlpoints and the shape of quadrat.
      Parameters:
      o - Origin to create the full-circle around
      r - Radius of the full-circle
      Returns:
      A NurbsCurve for a full-circle
    • createRevolvedSurface

      public static NurbsSurface createRevolvedSurface(Axis3D a, NurbsCurve curve, double theta)
      Create a revolved NurbsSurface from the given NurbsCurve around the given axis whith the angle theta.
      Parameters:
      a - Axis to revolve around.
      curve - NurbsCurve to revolve
      theta - Angle to revolve
      Returns:
      The revolved NurbsSurface
    • createRevolvedSurface

      public static NurbsSurface createRevolvedSurface(Axis3D a, NurbsCurve curve, double thetaStart, double thetaEnd)
      Create a revolved NurbsSurface from the given NurbsCurve around the given axis whith the angle theta.
      Parameters:
      a - Axis to revolve around.
      curve - NurbsCurve to revolve
      thetaStart - Angle to start revolution
      thetaEnd - Angle to end revolution
      Returns:
      The revolved NurbsSurface
    • createSemiCircle

      public static NurbsCurve createSemiCircle(Origin3D o, float r)
      Create a semi-circle NurbsCurve around the given Origin with radius r.
      Parameters:
      o - Origin to create semi-circle around.
      r - Radius of the semi-circle
      Returns:
      A NurbsCurve for a semi-circle
    • createSwungSurface

      public static NurbsSurface createSwungSurface(NurbsCurve proj, NurbsCurve traj, float alpha)
      Creates a NurbsSurface by swinging a profile NurbsCurve in the XZ plane around a trajectory curve in the XY plane. Both curves MUST be offset from the major axes (i.e. their control points should have non-zero coordinates for the Y coordinates of the profile curve and the Z coordinates of the trajectory).
      Parameters:
      proj - profile curve in XZ
      traj - trajectory curve in XY
      alpha - scale factor
      Returns:
      3D NURBS surface
    • extrudeCurve

      public static NurbsSurface extrudeCurve(NurbsCurve curve, Vec3D extrude)
      Perform a linear extrusion of the given NurbsCurve along the supplied vector to produce a new NurbsSurface. The extrusion length is the length of the vector given.
      Parameters:
      curve - NURBS curve instance
      extrude - a extrusion vector
      Returns:
      a NurbsSurface.
    • globalCurveInterpolation

      public static NurbsCurve globalCurveInterpolation(Vec3D[] points, int degree) throws InterpolationException
      Interpolates a NurbCurve form the given Points using a global interpolation technique.
      Parameters:
      points - Points to interpolate
      degree - degree of the interpolated NurbsCurve
      Returns:
      A NurbsCurve interpolating the given Points
      Throws:
      InterpolationException - thrown if interpolation failed or is not possible.
    • globalSurfaceInterpolation

      public static NurbsSurface globalSurfaceInterpolation(Vec3D[][] points, int uDegrees, int vDegrees) throws InterpolationException
      Interpolates a NurbsSurface from the given points using a gloabl interpolation technique.
      Parameters:
      points - Points arranged in a net (matrix) to interpolate
      uDegrees - degree in u direction
      vDegrees - degree in v direction
      Returns:
      A NurbsSurface interpolating the given points.
      Throws:
      InterpolationException - thrown if interpolation failed or is not possible.