maspack.geometry
Class Polyline

java.lang.Object
  extended by maspack.geometry.Polyline

public class Polyline
extends java.lang.Object


Field Summary
 int idx
           
 int myWorldCoordCnt
           
 
Constructor Summary
Polyline(int idx)
          Creates an empty polyline with a specified index value.
 
Method Summary
 double computeLength()
          Computes the length of this line.
 int getIndex()
          Returns the index value for this polyline.
 Vertex3d getVertex(int idx)
           
 int[] getVertexIndices()
           
 Vertex3d[] getVertices()
           
 Point3d interpolatePosition(double s)
          Interpolate point along polyline
 Vector3d interpolateTangent(double s)
          Interpolate tangent vector to polyline at specified point
static void main(java.lang.String[] args)
           
 int numVertices()
           
 void set(Vertex3d[] vtxs, int numVtxs)
          Creates a line a list of vertices.
 void updateBounds(Point3d min, Point3d max)
           
 double updateLengths()
          Computes the length of this line and per-segment length info.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idx

public int idx

myWorldCoordCnt

public int myWorldCoordCnt
Constructor Detail

Polyline

public Polyline(int idx)
Creates an empty polyline with a specified index value.

Parameters:
idx - desired index value
Method Detail

getIndex

public int getIndex()
Returns the index value for this polyline.

Returns:
index value

getVertexIndices

public int[] getVertexIndices()

set

public void set(Vertex3d[] vtxs,
                int numVtxs)
Creates a line a list of vertices.

Parameters:
vtxs - vertices to form the line
numVtxs - number of vertices

computeLength

public double computeLength()
Computes the length of this line.


updateLengths

public double updateLengths()
Computes the length of this line and per-segment length info.


interpolatePosition

public Point3d interpolatePosition(double s)
Interpolate point along polyline

Parameters:
s - - normalized curve parameter in range [0-1]
Returns:
point along polyline at s

interpolateTangent

public Vector3d interpolateTangent(double s)
Interpolate tangent vector to polyline at specified point

Parameters:
s - - normalized curve parameter in range [0-1]
Returns:
tangent to polyline curve at s

updateBounds

public void updateBounds(Point3d min,
                         Point3d max)

numVertices

public int numVertices()

getVertices

public Vertex3d[] getVertices()

getVertex

public Vertex3d getVertex(int idx)

main

public static void main(java.lang.String[] args)