Code: Select all
import Part
i_wire = Part.makePolygon([
App.Vector(0.2, 0.5, 0),
App.Vector(0.5, 1.2, 0),
App.Vector(1.2, 1.1, 0),
App.Vector(0.8, 0.5, 0),
App.Vector(0.2, 0.5, 0),
])
o_wire = Part.makePolygon([
App.Vector(0,0,0),
App.Vector(0,1,0),
App.Vector(1,1,0),
App.Vector(1,0,0),
App.Vector(0,0,0),
])
Part.show(i_wire.cut(o_wire)))
[(0.2, 0.5, 0.0), (0.41428571428571426, 1.0, 0.0), (1.0, 1.0, 0.0), (1.0, 0.8, 0.0), (0.5, 1.2, 0.0)]
However, I get this polygon instead:
[(0.2, 0.5, 0.0), (0.41428571428571426, 1.0, 0.0), (0.8, 0.5, 0.0), (1.0, 0.8, 0.0), (1.2, 1.1, 0.0), (0.5, 1.2, 0.0)]
Which is the inner one including the two intersection points.
Is it possible to get the cut from these two polygons?
The only requirements I have are:
* 2D only
* I have the vertices of the two polygons
* I want the vertices of the output polygon