@@ 53-66 (lines=14) @@ | ||
50 | csgA.invert() |
|
51 | return self.fromPolygons(csgA.allPolygons()) |
|
52 | ||
53 | def intersect(self, otherCSG): |
|
54 | csgA = csgNode(self.clone().polygons) |
|
55 | csgB = csgNode(otherCSG.clone().polygons) |
|
56 | ||
57 | csgA.invert() |
|
58 | csgB.clipTo(csgA) |
|
59 | csgB.invert() |
|
60 | csgA.clipTo(csgB) |
|
61 | csgB.clipTo(csgA) |
|
62 | csgA.build(csgB.allPolygons()) |
|
63 | csgA.invert() |
|
64 | ||
65 | ||
66 | return self.fromPolygons(csgA.allPolygons()) |
|
67 | ||
68 | def inverse(self): |
|
69 | newCSG = self.clone() |
|
@@ 39-51 (lines=13) @@ | ||
36 | ||
37 | return self.fromPolygons(csgA.allPolygons()) |
|
38 | ||
39 | def subtract(self, otherCSG): |
|
40 | csgA = csgNode(self.clone().polygons) |
|
41 | csgB = csgNode(otherCSG.clone().polygons) |
|
42 | ||
43 | csgA.invert() |
|
44 | csgA.clipTo(csgB) |
|
45 | csgB.clipTo(csgA) |
|
46 | csgB.invert() |
|
47 | csgB.clipTo(csgA) |
|
48 | csgB.invert() |
|
49 | csgA.build(csgB.allPolygons()) |
|
50 | csgA.invert() |
|
51 | return self.fromPolygons(csgA.allPolygons()) |
|
52 | ||
53 | def intersect(self, otherCSG): |
|
54 | csgA = csgNode(self.clone().polygons) |