Loading...
Searching...
No Matches
patch.hpp
Go to the documentation of this file.
1
26
27#ifndef MESHKIT_NATIVE_MESHPATCH_HPP
28#define MESHKIT_NATIVE_MESHPATCH_HPP
29
30namespace meshkit::plan
31{
32
46
51struct SweptPatch {
53 double width = 0.0;
54 int across = 0;
58 double along = 0.0;
60};
61
75 int across = 0;
79 double along = 0.0;
81};
82
92
106
114Text validate(const SweptPatch &p);
120Text validate(const PatchMesh &pm);
121
125Polygon orderedPatchBoundary(const PatchMesh &pm, Text *err = nullptr);
126
130PatchMesh makeTransfinitePatch(const StructuredPatch &p, Text *err = nullptr);
131
136PatchMesh makeSweptPatch(const SweptPatch &p, Text *err = nullptr);
137
141PatchMesh makeBankPairPatch(const BankPairPatch &p, Text *err = nullptr);
142
143// ── Quad-region redesign (QUAD_MESHING_REDESIGN_PLAN_2026-09-06.md §4.2) ───
144
153PatchMesh makeTransfinitePatch(const Vector<Vector<Point2>> &sides, int n, int m, const Text &tag,
154 Text *err = nullptr);
165// Four already-stationed cyclic sides. Opposite side counts must agree.
166// Retains every boundary coordinate exactly; shared owners can reuse/reverse
167// one canonical sequence. No independent boundary resampling occurs.
169 Text *err = nullptr);
170
174PatchMesh makeMappedPatch(const Polygon &ring, const Vector<int> &corners, double h,
175 const Text &tag, Text *err = nullptr);
176
182PatchMesh makeMappedPatch(const Polygon &ring, const Vector<int> &corners, double hAlong,
183 double hAcross, double alongAngleDeg, const Text &tag,
184 Text *err = nullptr);
185
186} // namespace meshkit::plan
187
188#endif // MESHKIT_NATIVE_MESHPATCH_HPP
std::vector<T> with the QVector-style member names the CDT kernel and plan model use.
Definition storage.hpp:31
Point sequence in XY units used for polygon rings and polylines.
Definition planmodel.hpp:83
Owned byte string with the QString-style helpers used for tags and diagnostics.
Definition planmodel.hpp:21
Planning algorithms on standard containers: quad patch planning and placement, size fields,...
PatchMesh makeMappedPatch(const Polygon &ring, const Vector< int > &corners, double h, const Text &tag, Text *err=nullptr)
Split a ring (either winding) at the four corners (ring vertex indices, ring order) into polyline sid...
Definition patch.cpp:1043
PatchMesh makeBankPairPatch(const BankPairPatch &p, Text *err=nullptr)
Build a conforming strip between two simple, disjoint banks.
Definition patch.cpp:1256
Text validate(const StructuredPatch &p)
Input checks.
Definition patch.cpp:407
Polygon orderedPatchBoundary(const PatchMesh &pm, Text *err=nullptr)
Validate the complete patch and return its CCW boundary, without a repeated closing vertex.
Definition patch.cpp:630
PatchMesh makeTransfinitePatchAtStations(const Vector< Vector< Point2 > > &sides, const Text &tag, Text *err=nullptr)
Coons patch on four already-stationed sides that keeps every station exactly.
Definition patch.cpp:886
PatchMesh makeSweptPatch(const SweptPatch &p, Text *err=nullptr)
Sweep the centreline: (stations)×(across+1) vertices, (stations-1)×across quads.
Definition patch.cpp:1095
PatchMesh makeTransfinitePatch(const StructuredPatch &p, Text *err=nullptr)
Transfinite interpolation on the four straight sides.
Definition patch.cpp:656
Two open bank polylines with independently supplied directions.
Definition patch.hpp:67
int across
Quads across between the banks at every station; must be >= 1.
Definition patch.hpp:75
double along
Target station spacing, XY units, measured on the longer bank; must be finite and >= 0.
Definition patch.hpp:79
Vector< Point2 > bankA
First bank: open polyline in XY units with >= 2 finite points, no repeated consecutive vertex and dis...
Definition patch.hpp:74
Vector< Point2 > bankB
Second bank, same rules.
Definition patch.hpp:74
Text tag
Label copied to PatchMesh::tag and to every generated quad.
Definition patch.hpp:80
A polyline through a patch's vertices that must be reported as mesh edges with a marker — a conduit r...
Definition patch.hpp:85
int marker
Marker given to every edge emitted for the line.
Definition patch.hpp:87
Vector< int > path
Local vertex indices, consecutive ones joined by quad edges.
Definition patch.hpp:86
Text tag
Label for the emitted edges.
Definition patch.hpp:90
A generated patch in local indices.
Definition patch.hpp:94
Vector< PatchLine > lines
Interior lines emitted as MeshResult::boundaryEdges with their marker and tag, and bounding region ta...
Definition patch.hpp:104
Vector< Point2 > xy
Vertex positions, XY units, indexed locally by quads, boundarySegments and lines.
Definition patch.hpp:97
Text tag
Patch label. The generators copy it to every quad, and validation messages quote it.
Definition patch.hpp:101
Vector< std::pair< int, int > > boundarySegments
Local index pairs around the patch.
Definition patch.hpp:99
Vector< MeshTriangle > quads
v3 >= 0, local indices.
Definition patch.hpp:98
Four-sided patch: corners in cyclic order (either orientation); n subdivisions along corner0→corner1 ...
Definition patch.hpp:36
int n
Subdivisions along corner0→corner1; must be >= 1.
Definition patch.hpp:43
int m
Subdivisions along corner0→corner3; must be >= 1.
Definition patch.hpp:43
Vector< Point2 > corners
Exactly 4, cyclic.
Definition patch.hpp:37
Text tag
Label copied to PatchMesh::tag and to every generated quad.
Definition patch.hpp:44
Swept patch: the centreline is offset ±width/2 (mitred at interior vertices) and cut into across quad...
Definition patch.hpp:51
Vector< Point2 > centreline
>= 2 points.
Definition patch.hpp:52
Text tag
Label copied to PatchMesh::tag and to every generated quad.
Definition patch.hpp:59
double width
Full strip width, XY units; must be finite and > 0.
Definition patch.hpp:53
int across
Quads across the strip at every station; must be >= 1.
Definition patch.hpp:54
double along
Target station spacing along the centreline, XY units; must be finite and >= 0.
Definition patch.hpp:58