The Path.clean() method removes spurious drawing operations from a path.

A spurious drawing operation is one that has no effect, but can still cause problems if left in place. For example, a line from a given point to the same given point will not cause any problems as such, but can trip up things like path offset and other methods. For this reason, such drawing operations can be cleaned up with the Path.clean() method.

As this method is called under the hood to guard against various scenarios where spurious segments could cause an issue, you should have no need to call this method yourself explicitly, but it’s there if you need it. path that you pass it.


Path path.clean()


8 ops in a 6 ops in b