segments

Iterate the path one command / segment at a time.

The returned iterator has the following methods...

reset() - resets the iterator to the start of the path next() - advance to the next command PathCmd cmd() - the current command Point opIndex(idx) - get segment coordinates

When you use [] / opIndex the index is for indexing into the current segment, so if the current command is a line, 0 will be the first point, 1 will be the end point. A cubic curve command can be indexed 0,1,2 or 3. It is bounds checked in debug mode.

When all the commands are exhausted cmd() will return PathCmd.empty

segments
(
T
)
(
auto ref T path
)

Meta