Rescaling and robustness

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Rescaling and robustness

This post has NOT been accepted by the mailing list yet.
I posted issue #10747 the other day (thanks for the speedy fix, by the way!) concerning computing polygon-polygon intersections using integers.

I'm working on a mesh generation tool where, for the sake of robustness, I cast to an integer grid for all internal calculations (cleaning small edges, resolving degenerate states, computing intersections, etc.) then cast back to floating point to build the final mesh. A topologically invalid mesh can result if geometric operations aren't performed in a robust, reproducible manner.

I was unaware boost.geometry performed rescaling to improve robustness. I wonder if I could use it in place of repeated integer recasting and greatly simplify my code. Is it always more robust to perform intersections with integers? Or could I get similar behavior by modifying the rescale policy and doing intersections in floating point? Is there any documentation/examples available for setting the rescaling policy?