Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2007-10-04 14:12:28


Simonson, Lucanus J wrote:
>
> There is the strong possibility that I will be extending the GTL
> capabilities beyond 45 degree to allow arbitrary angles with the goal
> of providing best in class performance with a generic and productive
> interface.

Wouldn't this compromise the key facts of rectilinear geometry?

You can provide robust operations based solely on fixed-point arithmentic
precisely becasue of this restriction (or am I mistaken there?)
To support arbitrary angles you need rational coordinates, but then you
enter the world of non-rectilinear geometry whose rules are completely
different.

> As we are all aware, this leads to the need to provide a
> mechanism to ensure numerical robustness at considerable cost in
> runtime. That mechanism would obviously include a generic interface
> for specifying the internal numerical data type to be used by the
> algorithm,
> with a default provided by the library.

Is not as simple as that I'm afraid. Not for industrial-strenght code.

See for example the CGAL approach to it:

http://www.cgal.org/philosophy.html

Right now you have a library that can be used in real production, but that's
because it exploits the restrictions of its target domain.
I suggest to keep it that way.

> However, our intention is not
> to provide a comprehensive geometry library, which would be too broad
> in scope,

And which needs *different* design decisions.

> but rather a starting point for generic geometry that the
> community can participate in and extend in the most useful directions.
> In looking at the recent submissions to boost related to geometry
> there
> is a fair amount of overlap with our library, particularly in what I
> call the basic types such as point2d. The ideal outcome from my point
> of view is that we all benefit from a synthesis of ideas and craft a
> boost geometry library together that goes beyond the code we will
> initially submit and will continue to be enhanced and extended with
> the participation of the community over time.
>
I agree with your POV.

One way do that without compromising the key aspects of your work is to
stratify it.
That is, factor out the bottom layer than is relevant to most geometric
domains and keep the stuff specific to rectilinear geometry in a top layer.

The bottom layer would include the point class (and IMO it *should* include
a vector class to simplify "directional" operations)

The design decisions for the bottom layer need not be the same as those for
the top layer (rectilinar geometry)

Best

-- 
Fernando Cacciola
SciSoft
http://fcacciola.50webs.com 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk