Package toxi.geom
Class LineStrip2D
java.lang.Object
toxi.geom.LineStrip2D
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(float x, float y) add
(ReadonlyVec2D p) get
(int i) Returns the vertex at the given index.getDecimatedVertices
(float step) Computes a list of points along the spline which are uniformly separated by the given step distance.getDecimatedVertices
(float step, boolean doAddFinalVertex) Computes a list of points along the spline which are close to uniformly separated by the given step distance.getEdges()
Returns a list ofLine2D
segments representing the segments between the vertices of this strip.float
getPointAt
(float t) Computes point at position t, where t is the normalized position along the strip.intersectLine
(Line2D line) iterator()
rotate
(float theta) scale
(float scale) scale
(float x, float y) scale
(ReadonlyVec2D scale) scaleSize
(float scale) scaleSize
(float x, float y) scaleSize
(ReadonlyVec2D scale) void
setVertices
(List<Vec2D> vertices) translate
(float x, float y) translate
(ReadonlyVec2D offset) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LineStrip2D
public LineStrip2D() -
LineStrip2D
-
-
Method Details
-
add
-
add
-
add
-
get
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
-
getBoundingCircle
-
getBounds
-
getCentroid
-
getDecimatedVertices
Computes a list of points along the spline which are uniformly separated by the given step distance.- Parameters:
step
-- Returns:
- point list
-
getDecimatedVertices
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
-
getEdges
Returns a list ofLine2D
segments representing the segments between the vertices of this strip.- Returns:
- list of lines
-
getLength
public float getLength() -
getPointAt
Computes point at position t, where t is the normalized position along the strip. If t<0 then the first vertex of the strip is returned. If t>=1.0 the last vertex is returned. If the strip contains less than 2 vertices, this method returns null.- Parameters:
t
-- Returns:
-
getSegments
-
getVertices
- Returns:
- the vertices
-
intersectLine
-
iterator
-
rotate
-
scale
-
scale
-
scale
-
scaleSize
-
scaleSize
-
scaleSize
-
setVertices
- Parameters:
vertices
- the vertices to set
-
translate
-
translate
-