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
When editing a polygonal entity, there are a number of tools to edit the polygon, one being the "paint" tool, for which I implemented a bespoke boolean add/subtract algorithm tailored to brush strokes.
The algorithm breaks down in cases where it would need to generate multiple polygons, i.e. deleting a middle part of a polygon, leaving two ends. When this happens it creates many points around the circle of the brush, and if you don't release the mouse button it can quickly escalate, slowing down the page until it totally freezes up.
The obvious thing to do is to create two (or more) entities as a copy of the original with different polygons, when it needs to be split.
However, the current model only allows editing one entity at a time, so it would have to pick one, unless this is to be changed.
Alternatively, the entity model could be changed to have terrain entities own a list of polygons instead of just one.
And perhaps a separate list of holes? What about holes?
Alternatively, multi-polygons and polygons with holes could be represented as a still a single list of points, with zero-width isthmuses and canals. This might be simpler in some ways, but it would certainly put some edge cases front and center, which would need to be handled correctly. It's also a bit unintuitive and would be weird if it showed these zero-width isthmuses and canals when editing, and e.g. allowed you to select a terrain entity via an invisible bridge between two terrain regions.
Regardless, the algorithm should be patched to avoid creating exponentially many points.
The text was updated successfully, but these errors were encountered:
When editing a polygonal entity, there are a number of tools to edit the polygon, one being the "paint" tool, for which I implemented a bespoke boolean add/subtract algorithm tailored to brush strokes.
The algorithm breaks down in cases where it would need to generate multiple polygons, i.e. deleting a middle part of a polygon, leaving two ends. When this happens it creates many points around the circle of the brush, and if you don't release the mouse button it can quickly escalate, slowing down the page until it totally freezes up.
The obvious thing to do is to create two (or more) entities as a copy of the original with different polygons, when it needs to be split.
However, the current model only allows editing one entity at a time, so it would have to pick one, unless this is to be changed.
Alternatively, the entity model could be changed to have terrain entities own a list of polygons instead of just one.
And perhaps a separate list of holes? What about holes?
Alternatively, multi-polygons and polygons with holes could be represented as a still a single list of points, with zero-width isthmuses and canals. This might be simpler in some ways, but it would certainly put some edge cases front and center, which would need to be handled correctly. It's also a bit unintuitive and would be weird if it showed these zero-width isthmuses and canals when editing, and e.g. allowed you to select a terrain entity via an invisible bridge between two terrain regions.
Regardless, the algorithm should be patched to avoid creating exponentially many points.
The text was updated successfully, but these errors were encountered: