OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
MeshBuilder.cpp File Reference

Implementation of mesh topology construction and geometry computation. More...

#include "MeshBuilder.hpp"
#include "QuadVfr.hpp"
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <utility>
#include <cstdint>
Include dependency graph for MeshBuilder.cpp:

Namespaces

namespace  openswmm
 
namespace  openswmm::twoD
 

Functions

void openswmm::twoD::buildMeshTopology (MeshData &mesh)
 Build mesh topology and precompute geometry from raw vertex/triangle data.
 
bool openswmm::twoD::buildMeshTopologyCancellable (MeshData &mesh, const std::function< bool(int)> &progress)
 Cancellable equivalent; progress receives integer percent and returns true to cancel.
 
std::string openswmm::twoD::validateMesh (const MeshData &mesh)
 Validate mesh data for consistency.
 
std::string openswmm::twoD::validateMeshCancellable (const MeshData &mesh, const std::function< bool(int)> &progress, bool &cancelled)
 Cancellable validator. cancelled is set when progress returns true.
 
void openswmm::twoD::recomputeVertexZDependents (MeshData &mesh, int vidx)
 Recompute Z-derived per-triangle / per-edge geometry for triangles incident to a vertex whose Z just changed.
 
void openswmm::twoD::recomputeAllZDependents (MeshData &mesh)
 Whole-mesh form of recomputeVertexZDependents.
 

Detailed Description

Implementation of mesh topology construction and geometry computation.

Mixed triangle / quadrilateral cells (kMaxCellVerts = 4 padded layout, see MeshData.hpp). Triangle arithmetic is kept expression-for-expression identical to the triangle-only builder so an all-triangle mesh reproduces its geometry bit-for-bit; quads use the shoelace area and the area-weighted centroid of their two sub-triangles (the vertex mean is NOT the centroid of a skewed quad, and the Perot arms / ghost distances need the real one).

See also
MeshBuilder.hpp
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0