Search code examples
cgalsegment

CGAL:how to divide a segment into many little segments and output the points into a file


I have a line segment defined by two points P1 and P2. I now need to divide its into many parts. For example, 50 Parts. and output the points into a file from P1 to P2.


Solution

  • Honestly, it makes no sense to use CGAL, if that is really all what you want.

    It's just: P1 + i * (P2 - P1)/50, for i=0..50