Skip to content

Commit

Permalink
Start changing the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Oct 3, 2024
1 parent ace1e7f commit 3076c16
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Polygon_repair/doc/Polygon_repair/PackageDescription.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
\cgalPkgAuthors{Ken Arroyo Ohori}
\cgalPkgDesc{This package provides algorithms to repair 2D polygons, polygons with holes,
and multipolygons with holes, by selecting faces of the arrangement of the input based on a selection rule.
Currently, only the even-odd rule is provided. }
Currently, only the even-odd rule and the non-zero rule are provided. }
\cgalPkgManuals{Chapter_2D_Polygon_repair,PkgPolygonRepairRef}
\cgalPkgSummaryEnd

Expand All @@ -35,4 +35,5 @@ Currently, only the even-odd rule is provided. }

\cgalCRPSection{Simplification Rules}
- `CGAL::Polygon_repair::Even_odd_rule`
- `CGAL::Polygon_repair::Non_zero_rule`
*/
24 changes: 15 additions & 9 deletions Polygon_repair/doc/Polygon_repair/Polygon_repair.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ each face according to what it represents (exterior, polygon interior
or hole), and reconstructs the polygon(s) represented by the arrangement.
The method returns valid output stored in a multipolygon with holes.

Different arrangement and labelling heuristics are possible, but
currently only the <em>even-odd</em> rule is implemented in this package.
This rule results in areas that are alternately assigned as polygon
Different arrangement and labeling heuristics are possible, but
currently only the <em>even-odd</em> rule and <em>non-zero</em> rule are implemented in this package.
The even-odd rule results in areas that are alternately assigned as polygon
interiors and exterior/holes each time that an input edge is passed.
It does not distinguish between edges that are part of outer boundaries
from those of inner boundaries. In a next version we will add the
<em>winding number</em> rule.
from those of inner boundaries.

The non-zero rule results in areas with a non-zero winding number.

\section SectionPolygonRepair_Definitions Definitions

Expand Down Expand Up @@ -81,7 +82,7 @@ order
- The polygons with holes of a multipolygon with holes are also stored in
lexicographic order

\section SectionPolygonRepair_Algorithm Algorithm
\section SectionPolygonRepair_Algorithm Even-Odd Algorithm

Broadly, the algorithm consists of three steps:

Expand All @@ -95,7 +96,7 @@ single multipolygon with holes.

\cgalFigureBegin{inout, inout.svg}
Examples of polygons with holes (a-d) and multipolygons with holes
(e-h) before (left) and after (right) being repaired.
(e-h) before (left) and after (right) being repaired with the even-odd rule.
\cgalFigureEnd

\subsection SubsectionPolygonRepair_Arrangement Arrangement
Expand Down Expand Up @@ -133,7 +134,12 @@ into multipolygons using the face labels to know which polygon with holes inner/
boundaries belong to, and using the orientation to distinguish between the outer and
inner boundaries of each polygon with holes.

\subsection SubsectionPolygonRepair_Notes Notes on the Output

\section SectionPolygonRepair_Algorithm Non-Zero Algorithm

Tbd.

\section SubsectionPolygonRepair_Notes Notes on the Output

If the input is already valid, the method will return a valid output representing
the same area. However, the output might be different in order to conform to the
Expand All @@ -148,7 +154,7 @@ with holes has zero holes and extract these if needed.

\section SectionPolygonRepair_Examples Examples

\subsection SubsectionPolygonRepair_Repair Repairing a (Multi)polygon
\subsection SubsectionPolygonRepair_Repair Repairing a (Multi)polygon with the Even-Odd Rule

It is possible to repair a polygon, polygon with holes or multipolygon with holes
using the even-odd rule by calling the `Polygon_repair::repair()` function
Expand Down
1 change: 1 addition & 0 deletions Polygon_repair/doc/Polygon_repair/examples.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*!
\example Polygon_repair/repair_polygon_2.cpp
\example Polygon_repair/repair_non_zero_polygon_2.cpp
\example Polygon_repair/repair_multipolygon_2.cpp
*/
4 changes: 2 additions & 2 deletions Polygon_repair/include/CGAL/Polygon_repair/Winding.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ default constructor.
Winding() = default;


*!
/*!
sets the polygon as input of the winding number computation.
*/
void
Expand Down Expand Up @@ -350,4 +350,4 @@ sets the polygon as input of the winding number computation.

} // namespace CGAL

#endif CGAL_POLYGON_REPAIR_WINDING_H
#endif // CGAL_POLYGON_REPAIR_WINDING_H

0 comments on commit 3076c16

Please sign in to comment.