Boost logo

Boost Users :

Subject: Re: [Boost-users] [Polygon] attaching data to polygon boundary segments
From: Andreas Buhr (andreas_at_[hidden])
Date: 2013-11-10 15:07:09


Hi,

On 11/09/2013 06:53 AM, Andreas Buhr wrote:
> I would like to process 2D geometry for a finite element solver using
> boost.polygon. I programmed it, it's working fine. I use the
> polygon_data and polygon_set_data types from boost.polygon.
>
> Now I would like to attach information to the boundary segments. Then
> I'd like to do boolean operations. At the end I would like to have the
> boundary information merged. Is this possible with boost.polygon?

I tried the following:

I wrote a coordinate type which acts like an int but has internal some
meta information. At the beginning each coordinate knows to which point
it belongs. During each calculation, so in each + or * or whatever, I
merge the information. At the end of a boolean operation between two
polygons I hoped to have a polygon where each point knows which of the
original points were involved in its creation.

>From this information I thought it might be possible to look up from
which segment in the input data the segments in the output data were
derived.

However, I had no luck. From my understanding, (one of) the reason(s) is
that in boost/polygon/detail/polygon_arbitrary_formation.hpp, in
function compute_lazy_intersection, everything is converted to long
double (where my meta information is lost). But my analysis might be wrong.

Maybe someone with more insight into the Boost.Polygon library can tell
me whether an approach like this could work in principle?

I am happy about any hint on how to solve this problem (without going to
O(N^2) algorithms).

Best regards,
Andreas


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net