6502
6502

Reputation: 114481

What is the meaning of open path "orientation" in clipperlib?

ClipperLib documentation about offset operation says among preconditions:

  1. The orientations of closed paths must be consistent such that outer polygons share the same orientation, and any holes have the opposite orientation (ie non-zero filling). Open paths must be oriented with closed outer polygons.

(emphasis mine)

What is the definition of orientation for an open path?

Upvotes: 1

Views: 248

Answers (1)

6502
6502

Reputation: 114481

The definition of orientation makes sense only for closed paths, that is a typo in the documentation.

Also if the input is not sorted and oriented (i.e. the area you want to offset is defined as a collection of closed loops assuming even-odd filling rule and it's unknown what loops are holes and what are boundaries) a solution is to perform the operation in two steps

  1. Compute the x-or of all the loops as a boolean operation
  2. Compute the offset of the result

This is possible because results from clipperlib operations are always sorted and oriented.

Upvotes: 0

Related Questions