Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.geometry] buffer distance strategies
From: Barend Gehrels (barend_at_[hidden])
Date: 2014-10-29 18:21:21


Hi Grzegorz,

gchlebus wrote On 24-10-2014 16:44:
> Hi,
>
> I am wondering whether it would be possible to achieve anisotropic buffering
> (distances in neg x, pos x, neg y, pos y can have different values) of a
> polygon using the buffer function with custom-implemented distance strategy.
> What I want to achieve is presented on the figure 2-b in the following
> paper:
> http://itcnt05.itc.nl/agile_old/Conference/mallorca2002/proceedings/posters/p_molina.pdf
>
> I would be grateful to hear from you whether it is doable, and if positive,
> how one could implement such a custom distance strategy.

The current distance strategy has (currently) no means to get the angle,
or a vector of the new point to be buffered. We can consider adding that.

However, by writing custom strategies for join, side, point (for
point-buffers) and possibly end (for line-buffers) you should be able to
create this, because these have this information.

Attached a program doing similar things with polygons and points (I vary
the distance based on angle - you will have to do something with your
anistropic model).

The output is also attached.

The program defines three custom strategies, all based on the same
mechanism, to create interesting output.
I did not do the end-strategy but that would look similar, you can look
at the provided end-strategy (round) and apply the same function.

Regards, Barend






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