1

Good day,

I am currently in the learning process of CGAL while being relatively new to C++. For my current project I need to use Minkowski sums and then do additional operations on the boundary of it.

However, before I do these additional operations I need to get a better understanding of the output of offset_polygon_2(), the exact Minkowski offset computation.

Question 1: What is the Syntax of the output for .outer_boundary?

From what I understand so far, it outputs a list of a conic circles defined here. I would also imagine you would need some kind of arc-angle range for each of these concic circles and origin point, correct? An example of the output goes something like this:

89 {-1*x^2 + -1*y^2 + 0*xy + 1400*x + 0*y + -489975} : (705,0) --ccw--> (700,5) {0*x^2 + 0*y^2 + 0*xy + 0*x + 0*y + 0} : (700,5) --l--> (699.97,5)...

Question 2: How do you use CGAL::draw() for the above?

I have the following code, but I am unsure of what else needs to be done before it can be drawn.

Offset_polygon_with_holes_2 offset = CGAL::offset_polygon_2(P, 5, traits);
    double secs = timer.time();
    std::cout << "The offset polygon has " << offset.outer_boundary().size()
                << " vertices, " << offset.number_of_holes() << " holes."
                << std::endl;
    std::cout << "Offset computation took " << secs << " seconds." << std::endl;

Question 3: What other operations can be done on the "offset"?

So in the example code for Minkowski sums (also see above) offset.outer_boundary() is done, is there a list of other operations that can be done? Note: I do not think "operations" is the correct term here, please correct me.

I think that is all I have for now, thanks!

3
  • 1. Q 1 is unclear. Any boundary in this context is a sequence of line segments and circular arcs. These curves are handled by the Arr_conic_traits_2 class template. 2. The CGAL::draw() function is rather new. I don't know whether it is possible to draw such curves; try it. Construct a 2D arrangement of conic arcs and draw it; see the examples in the "2D Arrangement"" package. Alternatively, obtain the underlying arrangement of the general polygon you get; see the arrangement() call in the General_polygon_set_2 class template. 3. Compile and run the demo of the "2D Arrangement" package.
    – Efi Fogel
    May 20, 2021 at 9:02
  • @EfiFogel Thanks for the response. To clarify question 1: I am wondering what the syntax is for the output of the method outer_boundary for the output of offset_polygon_2(). When I "print" this output to a file, I get 89 {CONIC EQUATION}: (x,y) --ccw-->(x',y')... and I was wondering what the (x,y), (x'y'), --ccw-->, --l--> represent. As for Question 2, I will play more with draw(), but besides that, are there other methods for displaying these 2D arrangements or would I just be better off converting the conics to a set of vertices? 3. I will take a look at it, thanks! May 20, 2021 at 20:03
  • ccw---counterclockwise, cw---clockwise, l---linear, (x,y)---source point, (x'y')---target point. See Arrangement_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h and look for the exporter (<<) operator. Also read the manual of Arr_conic_traits_2 (doc.cgal.org/latest/Arrangement_on_surface_2/…)
    – Efi Fogel
    May 22, 2021 at 7:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.