Skip to content

Add geometry polyhedral surface #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/concept/polygon.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[heading Description]
[concept Polygon..polygon]

A polygon is ['A polygon is a planar surface defined by one exterior boundary and zero or more interior boundaries]
['A polygon is a planar surface defined by one exterior boundary and zero or more interior boundaries]
(__ogc_sf__).

So the definition of a Boost.Geometry polygon differs a bit from e.g. Wiki, where a polygon does not have holes. A
Expand Down
47 changes: 47 additions & 0 deletions doc/concept/polyhedral_surface.qbk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[/============================================================================
Boost.Geometry (aka GGL, Generic Geometry Library)

Copyright (c) 2025 Oracle and/or its affiliates.
Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle

Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)

=============================================================================/]

[section:concept_polyhedral_surface PolyhedralSurface Concept]

[heading Description]
[concept PolyhedralSurface..polyhedral surface]

['A PolyhedralSurface is a contiguous collection of polygons, which share common boundary segments] (__ogc_sf__).

[heading Concept Definition]

The PolyhedralSurface Concept is defined as following:

* There must be a specialization of the metafunction `traits::tag`, defining `polyhedral_surface_tag` as type
* It must behave like a Boost.Range Random Access Range
* The type defined by the metafunction `range_value<...>::type` must fulfill
the [link geometry.reference.concepts.concept_polygon Polygon Concept]

[heading Rules]

Besides the Concepts, which are checks on compile-time, there are
rules that valid PolyhedralSurfaces must fulfill. See the
[link geometry.reference.concepts.concept_polygon Polygon Concept] for more information
on the rules a polygon (and also a polyhedral surface) must fulfill.

Additionally:

* It is a contiguous collection of polygons, which share common boundary segments.
* For any two polygons that share a common boundary, the “top” of the polygon shall be consistent.
This means that when two LinearRings from these two Polygons traverse the common boundary segment,
they do so in opposite directions.

[heading Available Models]
* [link geometry.reference.models.model_polyhedral_surface model::polyhedral_surface]


[endsect]
1 change: 1 addition & 0 deletions doc/geometry.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
[def __0dim__ pointlike (e.g. point)]
[def __1dim__ linear (e.g. linestring)]
[def __2dim__ areal (e.g. polygon)]
[def __3dim__ volumetric (e.g. polyhedral_surface)]
[def __single__ single (e.g. point, polygon)]
[def __multi__ multiple (e.g. multi_point, multi_polygon)]
[def __cart__ Cartesian]
Expand Down
Binary file added doc/html/img/geometries/triangular_pyramid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions doc/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 1. Geometry</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Chapter 1. Geometry">
<link rel="next" href="geometry/introduction.html" title="Introduction">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down Expand Up @@ -52,7 +52,7 @@
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dl class="toc">
<dt><span class="section"><a href="geometry/introduction.html">Introduction</a></span></dt>
<dt><span class="section"><a href="geometry/compilation.html">Compilation</a></span></dt>
<dt><span class="section"><a href="geometry/design.html">Design Rationale</a></span></dt>
Expand Down Expand Up @@ -103,12 +103,12 @@
</div>
<h3>
<a name="geometry.h0"></a>
<span><a name="geometry.contributions"></a></span><a class="link" href="index.html#geometry.contributions">Contributions</a>
<span class="phrase"><a name="geometry.contributions"></a></span><a class="link" href="index.html#geometry.contributions">Contributions</a>
</h3>
<p>
Boost.Geometry contains contributions by:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Akira Takahashi (adaption of Boost.Fusion)
</li>
Expand Down
1 change: 1 addition & 0 deletions doc/imports.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
[import src/examples/geometries/point_xyz.cpp]
[import src/examples/geometries/point.cpp]
[import src/examples/geometries/polygon.cpp]
[import src/examples/geometries/polyhedral_surface.cpp]
[import src/examples/geometries/ring.cpp]
[import src/examples/geometries/segment.cpp]

Expand Down
5 changes: 3 additions & 2 deletions doc/make_qbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
# Copyright (c) 2009-2012 Mateusz Loskot ([email protected]), London, UK
# Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland
#
# Copyright (c) 2018-2021, Oracle and/or its affiliates.
# Copyright (c) 2018-2025, Oracle and/or its affiliates.
# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
#
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -141,7 +142,7 @@ def cs_to_quickbook(section):
, "ever_circling_iterator"]

models = ["point", "linestring", "box"
, "polygon", "segment", "ring"
, "polygon", "segment", "ring", "polyhedral_surface"
, "multi_linestring", "multi_point", "multi_polygon", "referring_segment"]

srs = ["spheroid"]
Expand Down
34 changes: 23 additions & 11 deletions doc/quickref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
-->

<informaltable frame="all">

<!-- ###### CONCEPTS ########################################################################### -->
<tgroup cols="3">
<colspec colname="a"/>
Expand Down Expand Up @@ -64,6 +64,12 @@
<member><link linkend="geometry.reference.concepts.concept_multi_polygon">MultiPolygon</link></member>
</simplelist>
</entry>
<entry valign="top">
<bridgehead renderas="sect3">3-dimensional</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.concepts.concept_polyhedral_surface">PolyhedralSurface</link></member>
</simplelist>
</entry>
</row>
</tbody>
</tgroup>
Expand Down Expand Up @@ -109,6 +115,12 @@
<member><link linkend="geometry.reference.models.model_multi_polygon">multi_polygon</link></member>
</simplelist>
</entry>
<entry valign="top">
<bridgehead renderas="sect3">3-dimensional</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.models.model_polyhedral_surface">polyhedral_surface</link></member>
</simplelist>
</entry>
</row>
<row>
<entry valign="top">
Expand Down Expand Up @@ -144,10 +156,10 @@
<member><link linkend="geometry.reference.adapted.register.boost_geometry_register_point_3d">BOOST_GEOMETRY_REGISTER_POINT_3D</link></member>
<member><link linkend="geometry.reference.adapted.register.boost_geometry_register_point_3d_const">BOOST_GEOMETRY_REGISTER_POINT_3D_CONST</link></member>
<member><link linkend="geometry.reference.adapted.register.boost_geometry_register_point_3d_get_set">BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET</link></member>

<member><link linkend="geometry.reference.adapted.register.boost_geometry_register_multi_point">BOOST_GEOMETRY_REGISTER_MULTI_POINT</link></member>
<member><link linkend="geometry.reference.adapted.register.boost_geometry_register_multi_point_templated">BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED</link></member>

</simplelist>
</entry>
<entry valign="top">
Expand Down Expand Up @@ -207,7 +219,7 @@
<entry valign="top">
<bridgehead renderas="sect3">Access Functions</bridgehead>
<simplelist type="vert" columns="1">
<!-- This section is not ordered alfabetically
<!-- This section is not ordered alfabetically
to have get/set first and then the rings -->
<member><link linkend="geometry.reference.access.get">get</link></member>
<member><link linkend="geometry.reference.access.set">set</link></member>
Expand Down Expand Up @@ -349,7 +361,7 @@
</simplelist>
<bridgehead renderas="sect3">Area</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.algorithms.area">area</link></member>
<member><link linkend="geometry.reference.algorithms.area">area</link></member>
</simplelist>
<bridgehead renderas="sect3">Assign</bridgehead>
<simplelist type="vert" columns="1">
Expand All @@ -366,7 +378,7 @@
</simplelist>
<bridgehead renderas="sect3">Azimuth</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.algorithms.azimuth">azimuth</link></member>
<member><link linkend="geometry.reference.algorithms.azimuth">azimuth</link></member>
</simplelist>
<bridgehead renderas="sect3">Buffer</bridgehead>
<simplelist type="vert" columns="1">
Expand Down Expand Up @@ -466,7 +478,7 @@
<bridgehead renderas="sect3">Similarity</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.algorithms.discrete_frechet_distance">discrete_frechet_distance</link></member>
<member><link linkend="geometry.reference.algorithms.discrete_hausdorff_distance">discrete_hausdorff_distance</link></member>
<member><link linkend="geometry.reference.algorithms.discrete_hausdorff_distance">discrete_hausdorff_distance</link></member>
</simplelist>
<bridgehead renderas="sect3">Simplify</bridgehead>
<simplelist type="vert" columns="1">
Expand All @@ -483,7 +495,7 @@
<bridgehead renderas="sect3">Unique</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.algorithms.unique">unique</link></member>
</simplelist>
</simplelist>
</entry>
</row>
</tbody>
Expand Down Expand Up @@ -737,7 +749,7 @@
</row>
</tbody>
</tgroup>

<!-- ###### SPATIAL INDEXES ######################################################################### -->
<tgroup cols="3">
<colspec colname="a"/>
Expand Down Expand Up @@ -770,7 +782,7 @@
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree__">rtree()</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_par_cr_ind_cr_val_cr_all_cr">rtree(parameters_type const &amp;, indexable_getter const &amp;, value_equal const &amp;, allocator_type const &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_">rtree(Iterator, Iterator)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_">rtree(Iterator, Iterator)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_range_const___">rtree(Range const &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_ite_ite_par_cr_ind_cr_val_cr_all_cr_pac_cr">rtree(Iterator, Iterator, parameters_type const &amp;, indexable_getter const &amp;, value_equal const &amp;, allocator_type const &amp;, PackAlloc const &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_ran_cr_par_cr_ind_cr_val_cr_all_cr_pac_cr">rtree(Range const &amp;, parameters_type const &amp;, indexable_getter const &amp;, value_equal const &amp;, allocator_type const &amp;, PackAlloc const &amp;)</link></member>
Expand All @@ -790,7 +802,7 @@
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.operator__rtree_const___">operator=(const rtree &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.operator__rtree____">operator=(rtree &amp;&amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.swap_rtree___">swap(rtree &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.swap_rtree___">swap(rtree &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.insert_value_type_const___">insert(value_type const &amp;)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.insert_iterator__iterator_">insert(Iterator, Iterator)</link></member>
<member><link linkend="geometry.reference.spatial_indexes.boost__geometry__index__rtree.insert_convertibleorrange_const___">insert(ConvertibleOrRange const &amp;)</link></member>
Expand Down
22 changes: 12 additions & 10 deletions doc/reference.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

[section:access Access Functions]

[/ This section is not ordered alfabetically
[/ This section is not ordered alfabetically
to have get/set first and then the rings]

[section:get get]
Expand Down Expand Up @@ -240,12 +240,13 @@

[section:arithmetic Arithmetic]
[include generated/arithmetic.qbk]
[endsect]
[endsect]

[section:concepts Concepts]
[include concept/point.qbk]
[include concept/linestring.qbk]
[include concept/polygon.qbk]
[include concept/polyhedral_surface.qbk]
[include concept/multi_point.qbk]
[include concept/multi_linestring.qbk]
[include concept/multi_polygon.qbk]
Expand All @@ -257,7 +258,7 @@
[section:constants Constants]
[include reference/core/min_corner.qbk]
[include reference/core/max_corner.qbk]
[endsect]
[endsect]

[section:cs Coordinate Systems]
[include generated/cartesian.qbk]
Expand Down Expand Up @@ -286,16 +287,16 @@
[include generated/de9im_mask.qbk]
[include generated/de9im_matrix.qbk]
[include generated/de9im_static_mask.qbk]
[endsect]
[endsect]

[section:enumerations Enumerations]
[include generated/enum.qbk]
[endsect]
[endsect]

[section:exceptions Exceptions]
[include generated/exception.qbk]
[include generated/centroid_exception.qbk]
[endsect]
[endsect]


[section:io IO (input/output)]
Expand All @@ -310,14 +311,14 @@
[include generated/svg.qbk]
[include generated/svg_mapper.qbk]
[endsect]
[endsect]
[endsect]


[section:iterators Iterators]
[include generated/closing_iterator.qbk]
[include generated/circular_iterator.qbk]
[include generated/ever_circling_iterator.qbk]
[endsect]
[endsect]


[section:models Models]
Expand All @@ -327,6 +328,7 @@
[include generated/point_xyz.qbk]
[include generated/linestring.qbk]
[include generated/polygon.qbk]
[include generated/polyhedral_surface.qbk]
[include generated/multi_point.qbk]
[include generated/multi_linestring.qbk]
[include generated/multi_polygon.qbk]
Expand Down Expand Up @@ -411,7 +413,7 @@
[include generated/within_winding.qbk]
[include generated/within_franklin.qbk]
[include generated/within_crossings_multiply.qbk]
[endsect]
[endsect]


[section:views Views]
Expand All @@ -420,7 +422,7 @@
[include generated/closeable_view.qbk]
[include generated/reversible_view.qbk]
[include generated/identity_view.qbk]
[endsect]
[endsect]


[endsect] [/reference]
14 changes: 14 additions & 0 deletions doc/reference/geometries/polyhedral_surface.qbk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[/============================================================================
Boost.Geometry (aka GGL, Generic Geometry Library)

Copyright (c) 2025 Oracle and/or its affiliates.
Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle

Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================/]

[heading Examples]
[polyhedral_surface]
[polyhedral_surface_output]
Loading