Boost logo

Boost :

Subject: [boost] Boost Polygon library Review
From: Kai Benndorf (kai.benndorf_at_[hidden])
Date: 2009-09-01 08:07:36

Dear developers,

we are currently evaluating the boost polygon library as a possible
replacement for our currently used package for polygon boolean operations.

Because the review process is soon at an end i want to inform you of our
experiences so far.

For short, i vote for inclusion of the polygon lib into boost.

We are evaluating it in the scope of an analysis tool out of the EDA
field. One task in this tool is to determine overlays of copper planes
on a pcb. For this we need the plane intersection functionality.

We have integrated the boost polygon lib currently to use it in parallel
to our old library. Up to now we have found no errors in the calculated
plane intersections, and there are some quite complicated planes, with
complicate holes on the test pcb. This is very promising and the results
seem to be reliable.

We used the library on Windows XP, MSVC 2008, only. No compilation
problems occured.

Double vs. integer coordinates. Our planes are described with double
coordinates in mm. We convert them for the boost polygon lib to integer
by multiplying them with a constant factor. A first try with an factor
of 1e5 leaded to an error (overflow?). With a factor of 1e4 this error

Our first approach was to use the polygon and polygon with hole classes
provided by the library and copy our coordinates into them. It works,
but the creation of the objects with the set( itBegin, itEnd) functions
was really slow, especially for copying the holes into the polygon.

Our current approach is with some own intermediate polygon and polygon
with holes classes, which allocates the necessary memory on creation.
This is a lot faster and is really usable.

A third and still better approach would be to use the same polygon
classes as in the rest of our application, but i postponed this for now.

The performance seems to be slower than our old library, but this is not
really evaluated yet, there can e.g. still be conversion penalties.

The documentation was sufficient enough to integrate the library in our
application, but surely can be better.

Because i'm not experienced in such an extensive template usage as it is
done in the polygon lib, i omit comments about the design of the
library. But at least it proved, that it can really be used to work
reliable on external polygon objects.

Best regards

Kai Benndorf

Boost list run by bdawes at, gregod at, cpdaniel at, john at