You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use FlattenJS for just it's polygon boolean operations (since I already have implemented other functionality otherwise) and for that want to convert my polygon format into FlattenJS format.
For that I use the following function: return Flatten.polygon(this.points.map(p => Flatten.point(p.x, p.y)));
this.points is an array of points Point: {x, y}. For a hexagon I would have 6 points at the corners for example.This actually works fine.
But when I want to convert the result of a boolean intersection back the polygon seems to be intersecting itself (even though .isValid returns true). This is the function I use to convert them back: var points = intersection.vertices.map(p => new Point(p.x, p.y))
new Point is the same type I used above.
It seems like the vertices of flattenJs seem to be a bit more complicated. How would I go about converting them to just an array of points, each point being connected to the next one?
The text was updated successfully, but these errors were encountered:
I wanted to use FlattenJS for just it's polygon boolean operations (since I already have implemented other functionality otherwise) and for that want to convert my polygon format into FlattenJS format.
For that I use the following function:
return Flatten.polygon(this.points.map(p => Flatten.point(p.x, p.y)));
this.points is an array of points
Point: {x, y}
. For a hexagon I would have 6 points at the corners for example.This actually works fine.But when I want to convert the result of a boolean intersection back the polygon seems to be intersecting itself (even though
.isValid
returns true). This is the function I use to convert them back:var points = intersection.vertices.map(p => new Point(p.x, p.y))
new Point is the same type I used above.
It seems like the vertices of flattenJs seem to be a bit more complicated. How would I go about converting them to just an array of points, each point being connected to the next one?
The text was updated successfully, but these errors were encountered: