GeoSoft API

no.geosoft.cc.geometry.spline
Class SplineFactory

Object
  |
  +--SplineFactory

public class SplineFactory
extends Object

A spline factory instance.

Author:
GeoSoft

Constructor Summary
SplineFactory()
           
 
Method Summary
static double[] createBezier(double[] controlPoints, int nParts)
          Create a Bezier spline based on the given control points.
static double[] createCatmullRom(double[] controlPoints, int nParts)
          Create a Catmull-Rom spline based on the given control points.
static double[] createCubic(double[] controlPoints, int nParts)
          Create a cubic spline based on the given control points.
static void main(String[] args)
          Testing the spline package.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplineFactory

public SplineFactory()
Method Detail

createBezier

public static double[] createBezier(double[] controlPoints,
                                    int nParts)
Create a Bezier spline based on the given control points. The generated curve starts in the first control point and ends in the last control point.

Parameters:
controlPoints - Control points of spline (x0,y0,z0,x1,y1,z1,...).
nParts - Number of parts to divide each leg into.
Returns:
Spline (x0,y0,z0,x1,y1,z1,...).

createCubic

public static double[] createCubic(double[] controlPoints,
                                   int nParts)
Create a cubic spline based on the given control points. The generated curve starts in the first control point and ends in the last control point.

Parameters:
controlPoints - Control points of spline (x0,y0,z0,x1,y1,z1,...).
nParts - Number of parts to divide each leg into.
Returns:
Spline (x0,y0,z0,x1,y1,z1,...).

createCatmullRom

public static double[] createCatmullRom(double[] controlPoints,
                                        int nParts)
Create a Catmull-Rom spline based on the given control points. The generated curve starts in the first control point and ends in the last control point. Im addition, the curve intersects all the control points.

Parameters:
controlPoints - Control points of spline (x0,y0,z0,x1,y1,z1,...).
nParts - Number of parts to divide each leg into.
Returns:
Spline (x0,y0,z0,x1,y1,z1,...).

main

public static void main(String[] args)
Testing the spline package.

Parameters:
args - Not used.

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no