Boost logo

Geometry :

Subject: Re: [geometry] nsphere roadmap
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-11-26 17:28:49


Hi Holger,

On 23-11-2012 10:44, Holger wrote:
> Hi list,
>
> I like to use boost::geometry for set operations like union, difference and
> intersection in a 2d cartesian coordinate system. Beside that I`d like to
> use the bg::distance between two points e.g. the centroid of a polygon and
> an other point. This works perfectly as long I do not use the nsphere
> extension. The algorithms of nsphere are very limited for my needs at the
> moment (what works so far is - trunk from 2012-11-22: assign, area, within,
> envelope, num_points). I found no way to bypass the limitations even no way
> to convert (assign) a nsphere to a polygon.

It is true that the nsphere extension in Trunk is quite limited.

>
> Is there a road map for the nsphere (in my case a circle) or does somebody
> have an idea how to convert a nsphere to a polygon with int x,y image
> coordinates?

Converting an nsphere to a polygon is basically easy, take sin/cos and
walk over 0-2 pi, multiplying with the radius. For integer coordinates
rounding is necessary (so the precision of the output will depend on
radius, and also on stepsize).

E.g. here (second Google hit):
http://www.helixsoft.nl/articles/circle/sincos.htm

>
> @Barend - if you read this: I can not find the status.xls you wrote about in
> Dec 20, 2010; 12:26pm. Is there an other place I can get informed about the
> future plans of nsphere?

That document is long not worked on, and does not contain nsphere (and
most extensions).

There are many things to be finished and nsphere is certainly one of
them. However, if you want to do intersections with them, the best thing
is to convert them to polygons and use that. That is probably what will
be done internally too - the intersection between two circles is (often)
a polygon anyway, and we are far from supporting polygons with curved
segments.

Regards, Barend


Geometry list run by mateusz at loskot.net