
On 23-2-2013 20:32, Jabiertxo Arraiza Cenoz wrote:
Hi. I have a problem. Its this: T get the last subpath of a Geom::Path::const_iterator whith a this options: end_open(), end(), end_default(), end_closed() and this subpath is not degenerated at the end. But never get a CubicBezier from the last subpath. Anybody can help me?
I don't understand your exact question, but perhaps this will help.
General advice: *only* use end_open(), end_closed(), or end_default(). 2geom offers an end() method for paths, but do not use it; it makes the code difficult to read because end() returns end_open().
end_open() returns the last segment assuming that the path is not closed.
end_closed() always returns a ClosingSegment (which is a LineSegment). It assumes the path is closed. (even if it is not closed). The returned segment is a straight line from start to end, closing the path. For paths that look curved, this segment will probably be degenerate, i.e. infinitely small.
end_default(): returns end_open() for open paths, and returns end_closed() for closed paths.
Cheers, Johan