|
Geometry : |
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2020-06-19 08:22:00
On Fri, 19 Jun 2020 at 00:31, 0xtrzy_at_[hidden] via Geometry
<geometry_at_[hidden]> wrote:
>
> Hello,
>
> I have a multi polygon from union two shapes. I would like to draw multipolygon on screen.
> Therefore I need a shape to draw. If my polygon no have holes it is simple.
> But if it have one or more its trouble.
> How draw a shapes (list of points) from polygon?
Drawing is not a domain of the Boost.Geometry library.
The library gives you access to list of points of polygon rings
and you need to process it according to requirements of
drawing/rendering engine/API which you are using.
I believe I have presented how to access points of rings here
https://github.com/boostorg/geometry/issues/729#issuecomment-646207412
For testing and debugging purposes, the library offers limited support for
outputting geometries in SVG format which can be displayed in web browser.
Here is example how to use it:
https://www.boost.org/doc/libs/1_73_0/libs/geometry/doc/html/geometry/reference/io/svg/svg_mapper.html
If you want to implement drawing using a different engine/API,
then you can learn some details from the SVG code:
https://github.com/boostorg/geometry/tree/develop/include/boost/geometry/io/svg
> P.S. What I can check clockwise of polygons in multipolygon? Simply i can check
> std::cout << " simple? " << (boost::geometry::is_simple(p) ? "yes" : "no") << std::endl;
> How checking each shape in Polygon?
> P.S.S. How set a clockwise one ring?
I believe we have answered these questions as part of our discussions here:
https://github.com/boostorg/geometry/issues/728
https://github.com/boostorg/geometry/issues/729
Best regards,
-- Mateusz Loskot, http://mateusz.loskot.net
Geometry list run by mateusz at loskot.net