Skip to content
Snippets Groups Projects
Commit 63cf46db authored by Jan Schnathmeier's avatar Jan Schnathmeier
Browse files

Fix heuristic formulas

parent 9897bec6
Branches
No related tags found
No related merge requests found
......@@ -63,11 +63,13 @@ In our implementation, there are additional constraints to consider in order to
\caption{Weights of new edges of $\mathcal{B}$ after splits.}
\label{fig:SplitWeights}
\end{figure}
\vspace{-10pt}
Where $E^{\mathcal{B}'}$ denotes the \textit{original} edges of $\mathcal{B}$ and $anc(e^{\mathcal{B}}_i)$ returns the \textit{ancestor} of $e^{\mathcal{B}}_i$, meaning the edge $e^{\mathcal{B}}_i$ was split off from. In this way heavily split up areas of $\mathcal{B}$ exponentially increase in weight marking the need for a cleanup. Figure \ref{fig:SplitWeights} visualizes how this works. Part (a) shows two original faces of $\mathcal{B}$, where all edges have weight 1. In part (b), the central edge is split. The two edges representing the original edge retain weight 1, whereas the two new edges (yellow) double their weight to two. Finally, (c) shows a split of a yellow edge where the newly created edges (red) again double their weight to four. This type of edge weighting heavily favors original edges of $\mathcal{B}$, and also provides a data structure to roll back changes by collapsing away non-original edges.
Given the weight function $w_{\mathcal{B}}$ presented in Equation \ref{eq:BaseEdgeWeight}, weights of meta edges are easily derived by summing over the weights of their base edge components:
\vspace{-10pt}
\begin{equation}\label{eq:MetaEdgeWeight}
w_{\mathcal{M}}(e^{\mathcal{M}}_i):=\sum_{e^{\mathcal{B}}_i\in\Phi(e^{\mathcal{M}}_i)} w_{\mathcal{B}}(e^{\mathcal{B}}_i)
\end{equation}
......@@ -76,8 +78,8 @@ A possible improvement of such a weight function would be factoring in edge leng
Using these weights, we observe that base edges of high weight cluster around meta vertices, since the area around them becomes increasingly more split as edges need to reach vertices. Consequently, removing an edge of a triangle often decreases the weight of opposite vertex, since the shared vertices become easier to reach. At worst, the weight remainins the same. With these observations, and the weighting method presented in Equation \ref{eq:MetaEdgeWeight}, we derive a heuristic that orders collapses based on the approximate weight changes they would introduce to the mesh (without explicitly performing the collapses).
\begin{wrapfigure}[10]{r}{0.5\textwidth}
\vspace{-10pt}
\begin{wrapfigure}[8]{r}{0.5\textwidth}
\vspace{-15pt}
\def\svgwidth{0.5\textwidth}
{\centering
\input{img/CollapseHeuristic.pdf_tex}\par
......@@ -87,18 +89,20 @@ Using these weights, we observe that base edges of high weight cluster around me
\label{fig:CollapseHeuristic}
\end{wrapfigure}
Figure \ref{fig:CollapseHeuristic} visualizes the edges changed by collapsing the halfedge $h^{\mathcal{M}}_x$ from $v^{\mathcal{M}}_A$ to $v^{\mathcal{M}}_B$. Halfedges $h^{\mathcal{M}}_p$ and $h^{\mathcal{M}}_{on}$ exist only before the collapse, so their weight can be discounted. $h^{\mathcal{M}}_x$ entering vertex $v^{\mathcal{M}}_B$ is replaced by $|v^{\mathcal{M}}_A|-3$ halfedges entering $v^{\mathcal{M}}_B$, and the topology around the vertices they come from does not change. Thus we derive the following collapse heuristic:
Figure \ref{fig:CollapseHeuristic} visualizes the edges changed by collapsing the halfedge $h^{\mathcal{M}}_x$ from $v^{\mathcal{M}}_A$ to $v^{\mathcal{M}}_B$. Halfedges $h^{\mathcal{M}}_p$ and $h^{\mathcal{M}}_{on}$ exist only before the collapse, so their weight can be discounted. $h^{\mathcal{M}}_x$ entering vertex $v^{\mathcal{M}}_B$ is replaced by $|v^{\mathcal{M}}_A|-3$ halfedges entering $v^{\mathcal{M}}_B$, and the topology around the vertices they come from does not change. We estimate that each of these edges increases in weight by $\frac{1}{2}w_{\mathcal{M}}(h^{\mathcal{M}}_x)$, representing half of the weight of $h^{\mathcal{M}}_x$, gained while entering $v^{\mathcal{M}}_B$. Thus we derive the following collapse heuristic:
\vspace{-10pt}
\begin{equation}\label{eq:CollapseHeuristic}
\textsc{ch}(h^{\mathcal{M}}_x) := (|v^{\mathcal{M}}_A|-4)*w_{\mathcal{M}}(h^{\mathcal{M}}_x) - w_{\mathcal{M}}(h^{\mathcal{M}}_p) - w_{\mathcal{M}}(h^{\mathcal{M}}_{on})
\textsc{ch}(h^{\mathcal{M}}_x) :=\frac{1}{2} (|v^{\mathcal{M}}_A|-4)*w_{\mathcal{M}}(h^{\mathcal{M}}_x) - w_{\mathcal{M}}(h^{\mathcal{M}}_p) - w_{\mathcal{M}}(h^{\mathcal{M}}_{on})
\end{equation}
Where $v^{\mathcal{M}}_A$ is the \textit{from\_vertex} and $v^{\mathcal{M}}_B$ is the \textit{to\_vertex} of $h^{\mathcal{M}}_x$, and $h^{\mathcal{M}}_p, h^{\mathcal{M}}_{on}$ are the previous halfedge and opposite next halfedge of $h^{\mathcal{M}}_x$ respectively. Using this heuristic Equation \ref{eq:CollapseHeuristic}, we sort all meta edges from low to high values and check low value halfedges for collapses first. Given the properties optimized by this heuristic it should perform better than collapsing based on a randomized set of edges, and a detailed comparison can be found in Chapter \ref{ch:Evaluation}.
\textbf{Note on non-triangles}: The heuristic described above assumes that the faces next to $h^{\mathcal{M}}_x$ and its opposite halfedge $h^{\mathcal{M}}_o$ are triangles. It is, however, easily extendable to non-triangles in the following way:
\vspace{-10pt}
\begin{align}\label{eq:CollapseHeuristicNonTriangles}
\textsc{ch}'(h^{\mathcal{M}}_x) := (|v^{\mathcal{M}}_A|-2-\textsc{tr}(h^{\mathcal{M}}_x)-\textsc{tr}(h^{\mathcal{M}}_o))*w_{\mathcal{M}}(h^{\mathcal{M}}_x) \\ \nonumber
\textsc{ch}'(h^{\mathcal{M}}_x) := \frac{1}{2}(|v^{\mathcal{M}}_A|-2-\textsc{tr}(h^{\mathcal{M}}_x)-\textsc{tr}(h^{\mathcal{M}}_o))*w_{\mathcal{M}}(h^{\mathcal{M}}_x) \\ \nonumber
- (\textsc{tr}(h^{\mathcal{M}}_x)*w_{\mathcal{M}}(h^{\mathcal{M}}_p)) - (\textsc{tr}(h^{\mathcal{M}}_o)*w_{\mathcal{M}}(h^{\mathcal{M}}_{on}))
\end{align}
......
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment