tranverse through a polygon

hello, if i have a polygon, is there any algo. in opencascade to let me tranverse this polygon from a start point to the end point, and find whether a given point is inside this polygon or outside?

thanks in advance.

Francois Lauzon's picture

Hi Jimmy,
you might want to look at the Graphics Gems books, there is many algorithm to intersect ray/line with polygon/triangle, or you can build a TopoDS_Shell for your polygon and use the BRepExtrema_ExtCF algorithm for example. But the first method your probably be faster.

Good Luck,
Francois.

j-zhang's picture

Could you kindly explain what is BRepExtrema_ExtCF algorithm ? I cannot find it in
Library book.(I am using opencascade ver. 3.1)

thanks.

Francois Lauzon's picture

It's easy to use, look at the BRepExtrema_ExtCF.cdl file, all cdl files are documented.
Good Luck,
Francois.