Hi and welcome,

Zhang Qun Via Boost-users wrote:

Zhang Qun Via Boost-users wrote:

Hi guys, first-time post here. Hello to everyone.

I'm using boost.geometry to implement a project. I need to calculate the intersection between a line and a polygon. I know there is no infinite line concept in boost.geometry. So I try to use the segment to intersect with a polygon, however, it seems not supported yet. Is there any other workaround that I can implement the intersection between a line and a polygon? The line is like y=mx+b or ax + by + c = 0.

Indeed the intersection of segment and polygon does not compile even though it should. Fortunately you can represent a segment as a linestring with 2 points. Something like this:

// and line's parameters

Regards,

Adam