|
Boost Users : |
Subject: [Boost-users] How to do line clipping using boost polygon?
From: jian hu (andy.hujian_at_[hidden])
Date: 2012-10-16 16:34:03
Hi,
I'm trying to clip line segments using boost polygon.
Boost polygon does not provide public interface but somehow I find the
function validate_scan(),
which can do the line clipping.
My input are two segments < (10, 10), (10, 2), 0 >
< ( 6, 7), (11, 2), 1 >
The numbers in the brackets are coordinates of two end points of the
segments and the number after it is the segment id.
So it looks like this.
The result I expect should be four segments, which are the result of
intersection <(10,10), (10,3), 0>
<(10,3), (10,2), 0>
<(6,7 ), (10,3), 1>
<(10,3), (11, 2), 1>
However, the <(10,3), (11,2), 1> segment is replace by two segments, which
are <(10,3), (10,2), 1> and <(10,2), (11,2), 1>.
Can someone tell me what happened? Replacing the segment with the other two
are not right behavior.
Thank you very much.
-- Jian Hu
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