Open stefanoromanello opened 5 years ago
Hi @stefanoromanello,
it's been a while since you asked, but if you could not find this in the library you might want to look at gl_tessellation, if you are looking for something 2d.
You could start from: http://www.songho.ca/opengl/gl_tessellation.html
Best, Claudio
you could try TriangulatedPolygonGenerator.cs, it uses a GeneralPolygon2d which is a polygon-with-holes, so I think it handles holes (but I can't remember).
thanks @rms80,
I've tried following your advice and I could write and test some code to get the results expected.
The code is quite simple:
TriangulatedPolygonGenerator tg = new TriangulatedPolygonGenerator();
tg.Polygon = new GeneralPolygon2d(new Polygon2d(
new List<Vector2d>()
{
new Vector2d(0,0),
new Vector2d(0,4),
new Vector2d(5,4),
new Vector2d(5,0)
}
));
tg.Polygon.AddHole(new Polygon2d(
new List<Vector2d>()
{
new Vector2d(1,1),
new Vector2d(2,1),
new Vector2d(1,2)
}
));
@stefanoromanello, have a look at a working sample at
Hi, is it possible from 2 polygon obtain the result of the subtraction (se photo)? Orange is the first polygon, green is the second one. I want to do orange-green and blu is the result.