Returns the difference between two bezier paths. >>> from pagebot.toolbox.units import p >>> from pagebot import getContext >>> context = getContext('Flat') >>> path1 = BezierPath(context=context) >>> path1.rect(0, 0, 200, 200) >>> path2 = BezierPath(
(self, path)
| 999 | return self.__class__(self.context, self.bp.union(path.bp)) |
| 1000 | |
| 1001 | def difference(self, path): |
| 1002 | """Returns the difference between two bezier paths. |
| 1003 | |
| 1004 | >>> from pagebot.toolbox.units import p |
| 1005 | >>> from pagebot import getContext |
| 1006 | >>> context = getContext('Flat') |
| 1007 | >>> path1 = BezierPath(context=context) |
| 1008 | >>> path1.rect(0, 0, 200, 200) |
| 1009 | >>> path2 = BezierPath(context=context) |
| 1010 | >>> path2.rect(0, 100, 200, 200) |
| 1011 | """ |
| 1012 | """ |
| 1013 | >>> # TODO: implement for Flat. |
| 1014 | >>> path1.difference(path2).points |
| 1015 | ((0.0, 0.0), (200.0, 0.0), (200.0, 100.0), (0.0, 100.0), (0.0, 0.0)) |
| 1016 | >>> #(path1 - path2).points |
| 1017 | #((0.0, 0.0), (200.0, 0.0), (200.0, 100.0), (0.0, 100.0), (0.0, 0.0)) |
| 1018 | >>> #(path2 - path1).points |
| 1019 | #((200.0, 300.0), (0.0, 300.0), (0.0, 200.0), (200.0, 200.0), (200.0, 300.0)) |
| 1020 | """ |
| 1021 | return self.__class__(self.context, self.bp.difference(path.bp)) |
| 1022 | |
| 1023 | def intersection(self, path): |
| 1024 | """Returns the intersection between two bezier paths. |
no outgoing calls
no test coverage detected