Package toxi.geom

Class LineStrip3D

java.lang.Object
toxi.geom.LineStrip3D
All Implemented Interfaces:
Iterable<Vec3D>

public class LineStrip3D extends Object implements Iterable<Vec3D>
  • Constructor Details

    • LineStrip3D

      public LineStrip3D()
    • LineStrip3D

      public LineStrip3D(Collection<? extends Vec3D> vertices)
  • Method Details

    • add

      public LineStrip3D add(float x, float y, float z)
    • add

      public LineStrip3D add(ReadonlyVec3D p)
    • add

      public LineStrip3D add(Vec3D p)
    • get

      public Vec3D get(int i)
      Returns the vertex at the given index. This function follows Python convention, in that if the index is negative, it is considered relative to the list end. Therefore the vertex at index -1 is the last vertex in the list.
      Parameters:
      i - index
      Returns:
      vertex
    • getDecimatedVertices

      public List<Vec3D> getDecimatedVertices(float step)
      Computes a list of points along the spline which are uniformly separated by the given step distance.
      Parameters:
      step -
      Returns:
      point list
    • getDecimatedVertices

      public List<Vec3D> getDecimatedVertices(float step, boolean doAddFinalVertex)
      Computes a list of points along the spline which are close to uniformly separated by the given step distance. The uniform distribution is only an approximation and is based on the estimated arc length of the polyline. The distance between returned points might vary in places, especially if there're sharp angles between line segments.
      Parameters:
      step -
      doAddFinalVertex - true, if the last vertex computed should be added regardless of its distance.
      Returns:
      point list
    • getEstimatedArcLength

      public float getEstimatedArcLength()
    • getSegments

      public List<Line3D> getSegments()
    • getVertices

      public List<Vec3D> getVertices()
      Returns:
      the vertices
    • iterator

      public Iterator<Vec3D> iterator()
      Specified by:
      iterator in interface Iterable<Vec3D>
    • setVertices

      public void setVertices(List<Vec3D> vertices)
      Parameters:
      vertices - the vertices to set