-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up clipping, "open" option, improved speed
- Loading branch information
Showing
4 changed files
with
226 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package clip | ||
|
||
type options struct { | ||
openBound bool | ||
} | ||
|
||
// An Option is a possible parameter to the clip operations. | ||
type Option func(*options) | ||
|
||
// OpenBound is an option to treat the bound as open. i.e. any lines | ||
// along the bound sides will be removed and a point on boundary will | ||
// cause the line to be split. | ||
func OpenBound(yes bool) Option { | ||
return func(o *options) { | ||
o.openBound = yes | ||
} | ||
} |