Suppose there is a polygon $\mathcal{P}\subset\mathbb{R}^2$ and a set of triangles $\mathcal{T}\equiv\{T_i\}_i$ that partitions $\mathcal{P}$. My question is, given any polygon $\mathcal{Q}\subset \mathcal{P}$, is there any algorithm (other than exhaustive searching) to determine whether there exists a set $\{T_{i_j}\}_j\subset \mathcal{T}$ such that $$ \mathcal{Q} = \bigcup_j T_{i_j}? $$ Any help or hint will be greatly appreciated!
2026-03-31 17:46:01.1774979161
On
Check Whether a Polygon "Fits into" a 2-D Triangular Mesh
83 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
2
On
(I do not assume convexity of the two simple polygons)
In $O(qt)$ time, determine for each triangle whether any of its vertices are outside $\mathcal Q$. (Can be done by counting “windings” around the tested vertices; I assume this can be done error-free, eg because all coordinates are integers)
Select those triangles which have none of their vertices outside $\mathcal Q$. Remains to check whether the union of these triangles is all of $\mathcal Q$ or a proper subpolygon. To do so, compute both areas in $O(q+t)$ time and compare (again assuming exactness, eg integer coordinates).
(Note: $\mathcal{P}$ and $\mathcal{Q}$ are supposed to be convex polygons with a non-empty interior, and all triangles in $\mathcal{T}$ to have a non-empty interior, too. It may be that the method proposed below still works for other cases, but I have not checked).
"$\mathcal{Q}$ is the union of triangles from $\mathcal{T}$" is equivalent to "all true $\mathcal{Q}$ vertices are vertices from triangles in $\mathcal{T}$, and edges of $\mathcal{Q}$ are covered by edges in $\mathcal{T}$".
By "true vertex", here I mean a vertex where the two adjoint edges are non-aligned. Said otherwise, if the vertex can be suppressed without changing the polygon interior, it is a false vertex. So it may be necessary to first remove false vertices from $\mathcal{Q}$.
Then the check step 1 consists in searching for each $\mathcal{Q}$ vertex in $\mathcal{T}$ vertices. To do this efficiently:
The step 2 consists in checking that $\mathcal{Q}$'s edges are covered by $\mathcal{T}$'s edges. For this:
So total complexity is $(Cn+Dq) \log(n) + E q \frac r 2 s$, where $C$, $D$ and $E$ are constants that depend upon the individual operations needed to do the sort and searches.
(1) Assuming here that testing for equality is "perfect", i.e. not taking into account floating point artefacts, which may be present in some applications.
(2) This assumes $\mathcal{T}$ is stored in a way that is convenient for this kind of check.