![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| struct | Point |
Typedefs | |
| using | Ring = std::vector<Point> |
Functions | |
| double | cross (Point a, Point b, Point c) |
| Compute the oriented twice-area of a triangle in planar coordinates. | |
| double | signedArea (const Ring &p) |
| Sum a polygon ring's signed triangle-fan area. | |
| double | tolerance (const Ring &p) |
| Derive a scale-relative tolerance for ring cross products and areas. | |
| bool | between (Point a, Point b, Point p, double eps) |
| Test whether a point lies on a closed segment within a cross-product tolerance. | |
| bool | intersects (Point a, Point b, Point c, Point d, double eps) |
| Test closed planar segments for proper crossing or endpoint/collinear contact. | |
| std::string | triangulate (Ring &p, std::vector< Ring > &triangles, const std::function< bool()> &running={}) |
| Validate a simple ring and triangulate it by counterclockwise ear clipping. | |
| double | intersectionArea (Ring subject, const Ring &clip) |
| Clip a polygon against a counterclockwise convex ring and return its area. | |
| using openswmm::twoD::footprint::Ring = std::vector<Point> |
Test whether a point lies on a closed segment within a cross-product tolerance.
| [in] | a | First segment endpoint. |
| [in] | b | Second segment endpoint; equality with a is allowed. |
| [in] | p | Point tested against the segment. |
| [in] | eps | Nonnegative tolerance in squared coordinate units for collinearity only. |
Compute the oriented twice-area of a triangle in planar coordinates.
| [in] | a | First point, serving as the subtraction origin. |
| [in] | b | Second point. |
| [in] | c | Third point. |
Clip a polygon against a counterclockwise convex ring and return its area.
| [in] | subject | Owned working copy of the subject polygon, implicitly closed. Caller data is unchanged; for general concave footprints, pass each triangle produced by triangulate(). |
| [in] | clip | Stable counterclockwise convex clipping polygon in the same planar coordinate system, with at least three valid vertices for a meaningful polygon intersection. |
|
inline |
Test closed planar segments for proper crossing or endpoint/collinear contact.
| [in] | a | First endpoint of the first segment. |
| [in] | b | Second endpoint of the first segment. |
| [in] | c | First endpoint of the second segment. |
| [in] | d | Second endpoint of the second segment. |
| [in] | eps | Nonnegative cross-product tolerance in squared coordinate units. |
|
inline |
Sum a polygon ring's signed triangle-fan area.
| [in] | p | Stable planar vertices, implicitly closed; a repeated final vertex is permitted. |
|
inline |
Derive a scale-relative tolerance for ring cross products and areas.
| [in] | p | Planar ring; coordinates should be finite. Extent is measured relative to its first vertex using the largest absolute coordinate offset. |
|
inline |
Validate a simple ring and triangulate it by counterclockwise ear clipping.
| [in,out] | p | Finite planar polygon. An exact repeated closing vertex is removed, clockwise order is reversed and collinear boundary vertices may be erased. These changes can survive a later failure; holes and multipart rings are unsupported. |
| [out] | triangles | Cleared immediately, then populated with owned three-point rings in p's coordinate units. Cancellation or triangulation failure can leave a partial triangulation. |
| [in] | running | Optional synchronous continuation callback; false cancels validation or the ear loop. The callback is not retained; its exceptions propagate. |