\section{Introduction}
\label{sec:intro}
The disks surrounding young stars provide the building material for planets. While terrestrial mantle rocks show that the Earth took tens of Myr to form \citep{Halliday:2006}, such direct formation dating is impossible for gas giants and exoplanets. Therefore, the frequency of disks around stars of different ages is used as a method to obtain information about the time available for planet formation \citep[][]{Haisch:2001}. The derived median disk lifetime is a "make-or-break" test for planet formation theories. As stellar ages of individual stars are intrinsically highly imprecise \citep[e.g.,][]{Bell:2013,Richert:2018}, disk fractions, $f_d$,  in young star clusters are used instead. As clusters consist of fairly coeval stars, their ages can be determined with higher accuracy than for individual stars.

The decline of the disk fraction with cluster age, $t$, has been shown for many different disk indicators, such as infrared excess or accretion signatures \citep{Haisch:2001,Hernandez:2007,Fedele:2010,Ribas:2014,Richert:2018}.
Exponential fits of the form $f_d(t) = exp(-t/\tau)$ provide an inconsistent picture with median disc lifetimes ranging from  \mbox{1 -- 3.5 Myr} to  \mbox{5 -- 10 Myr}.
As at least half the stars in the field seem to harbour planets \citep[e.g., ][]{Winn:2015}, the shorter disk lifetimes would imply extremely rapid planet growth.

\begin{table*}[t]
\caption{Examples of the fraction of old and nearby clusters in disk lifetimes studies}
\label{tab:old_cluster_number}
\centering
      \begin{tabular}{lccccllllll}
  \hline \hline
        \multicolumn{1}{l}{Reference}    & \multicolumn{1}{l}{Number of clusters} & \multicolumn{2}{l}{ Fraction of clusters with}& \multicolumn{1}{l}{disc lifetime} \\

        \multicolumn{1}{l}{}    & \multicolumn{1}{l}{} & \multicolumn{1}{l}{$t_c\geq$}5 Myr & \multicolumn{1}{c}{$d\leq$200 pc} & \\
     \hline
     \citet[][]{Richert:2018}   &69  & 0.00 & 0.00 & 1.3 -- 3.5 \\
     \citet[][]{Haisch:2001}    & 7  & 0.15 & 0.28 & 3.0  \\
     \citet[][]{Hernandez:2008} & 18 & 0.17 & 0.22 & $<$ 5   \\
     \citet[][]{Fedele:2010}    & 10 & 0.20 & 0.33 & 2.9 \\
     \citet[][]{Briceno:2019}   & 9  & 0.55 & 0.00 & 2  \\
     \citet[][]{Ribas:2014}     & 22 & 0.15 & 0.54 & 2  \\
     \citet[][]{Ribas:2015}     & 11 & 0.5  & 0.73 & 5.2 \\
     \citet[][]{Michel:2021}    &11 & 0.36 & 0.91 & 8.0 \\
     this work, Fig. 1 middle   &14 & 0.50 & 1.0 & 7 -- 8 \\
\hline
           \hline
      \end{tabular}

\end{table*}

The uncertainties in cluster age determination \citep[][]{Bell:2013} is a known problem in deducing disk lifetimes from cluster disk fractions. Besides,  environmental effects can lead to lower disc fractions in the dense cluster centres \citep[][]{Guarcello:2007,Pfalzner:2014}. Also, these effects play a part, here we show that the main reason for the discrepancy in the derived disk lifetimes is its sensitivity to cluster selection regarding age and distance. We suggest that the stellar mass dependence might skew the results towards short disk lifetimes. We find that restricting the sample to nearby ($<$ 200 pc) clusters with an adequate balance between young and old clusters leads to much longer median disk lifetimes of 5--10 Myr. The disk fractions of the individual clusters in this sample are from two works \citep[][]{Michel:2021,Luhman:2021}.
Within these two sources, the same method was used to determine the disk fractions.

\section{Correlation between cluster sample and disk lifetime}

The work by \citet[][]{Haisch:2001} held the promise that additional data would lead to a well-defined decline of the disk fraction with cluster age. However, the more data became available, the wider became the spread. This spread is often interpreted as being caused by external disk dispersal mechanisms. While this explains the lower disc fraction in dense clusters (typical $n \approx$ 10$^4$ pc$^{-3}$ \citep[][]{Gutermuth:2005}) ( see clusters indicated in green in Fig. 1, top left \citep[][]{Stolte:2015,Vincke:2018,Concha:2021}, it fails to account for the higher disc fractions in sparse clusters (typical $n <$ 0.5 pc$^{-3}$)). The black curve in Fig. 1 is based on clusters with $n <$ 600  pc$^{-3}$, where the effect of close stellar flybys on the disc fractions is restricted to small areas close to the cluster centre. Many of them have no O stars or much few than Upper Sco or UCL/LCC, excluding external photo-evaporation as the main cause for the difference in disk fraction. In total the environmental effect on the disc fraction should be small ($\ll$5\%) \citep[][]{Vincke:2018,Concha:2021}. Furthermore, the disc fractions of older sparse associations and co-moving groups are up to 25\% higher (Fig. 1, top right, red data points) higher than for the black curve. Thus  density effects cannot be dominantly responsible for this large difference.

Most clusters are detected as over-density relative to the background and elevated infrared excesses. Young clusters are identifiable even if they contain only a few hundreds or even tens of stars. When young clusters lose most of their gas content at the end of the star formation phase \citep[for example, ][]{Lada:2003,Kuhn:2019}, their size increases to 5 -- 10 times its initial value at ages \mbox{1 -- 5 Myr}. Thus, older clusters must contain $N >$ 1000 stars to be detectable.
This is why low-$N$ clusters older than 5 Myr are missing from plots like Fig. \ref{fig:disc_fraction_age_old} top right. Exceptions are the co-moving groups, as they are discovered as moving in the same phase space independent of their surface density.

Due to their initial compactness, clusters are identifiable at much larger distances at young ages than later. Table \ref{tab:old_cluster_number} shows that studies including a significant fraction of distant clusters arrive at shorter median disc lifetimes. Even studies that include many old clusters, but all at large distances, show this trend.
Our central hypothesis is that limiting magnitude at large distances introduces a bias towards brighter high-mass stars. As high-mass stars tend to lose their discs earlier \citep[see, for example,][]{Carpenter:2006,Ribas:2015}, this skews the resulting disk lifetimes towards shorter values.

Most young clusters contain 10 -- 1000 times fewer stars than the older clusters \citep[][]{Pfalzner:2014}.   This makes the individual disc fraction of young clusters less statistically significant in deriving the disk lifetime than these of older clusters. In many studies, young clusters are over-represented, while older clusters are under-represented. For example,  in \citet[][]{Haisch:2001} about 85\% of clusters and all 69 clusters in \citet[][]{Richert:2018} were $\leq$ 5 Myr. Table \ref{tab:old_cluster_number} shows examples of the fraction of clusters \mbox{$>$ 5 Myr} in various studies. Studies with large fractions of young clusters tend to derive short median disc lifetimes ($<$ 5 Myr) than those with more long-lived clusters ($>$ 5 Myr).

\begin{figure*}[t]
\includegraphics[width=0.49\textwidth]{disk_fraction.pdf}
\includegraphics[width=0.49\textwidth]{disk_fraction_all_equal.pdf}
\includegraphics[width=0.49\textwidth]{disk_fraction_weight.pdf}
\includegraphics[width=0.49\textwidth]{Disk_fraction_distance.pdf}
\caption{Disk fraction vs cluster age. Top: Distinction between areas of different density. Clusters generally used are shown in black, compact, dense clusters in green, and sparse clusters in blue. The original fit by Haisch (dashed black line). Middle: Fit using only clusters within 200 pc with the age range 1 -- 20 Myr equitably covered (red line and symbols).
Bottom: Clusters within 1000 pc. Symbols area proportional to the number of stars considered and the colour representing the cluster distance.
}
\label{fig:disc_fraction_age_old}
\end{figure*}

\section{Median disk lifetimes}
\label{sec:disk_lifetime}

To avoid these biases, we include nearby clusters \mbox{($<$ 200 pc)} with an equitable weight over the entire age range  \mbox{1 -- 20 Myr.}  Our sample contains four clusters aged \mbox{1 - 3 Myr,} five aged \mbox{3 -- 8 Myr} and four aged \mbox{8 -- 20 Myr.}
\mbox{Fig. \ref{fig:disc_fraction_age_old}} top, right shows that the resulting decline of disk fraction with cluster age (red solid line) is shallower than in studies mainly based on young distant clusters (black line)(for values  see Table \ref{tab:disc_fractions_old_new}).  We fitted different types of curves to the data. We find that the dependence of the disk fraction on cluster age can be approximated by a one-parameter exponential function of the form  ${f_D = \exp (-t/7})$ with a median disc lifetime of 5.0 Myr or two-parameter exponential function of the form $f_D = \exp (-0.25 t^{0.8})$. These fits exclude the data of the even older clusters $\sim$ 25 Myr old NGC 1960 and the 25 -- 35 Myr old Alessi 30 \citep{Galli:2021_1} as it is unclear whether their disks are protoplanetary or debris in nature. As an alternative, we also performed a Gaussian fit of the corresponding disc life distribution (see accompanying research note). In this case, we obtain a median disc lifetime of 6.5$\pm$1.5 Myr. Independent of the applied method, the derived median disk lifetimes exceed considerably the usually quoted \mbox{1 -- 3 Myr}. We emphasize that 25\% of disks exist beyond 10 Myr and $\approx$ 10\% beyond 15 to 20 Myr.

The question is how statistically significant is this result. Everything else being equal,  the disk fractions of high-$N$ clusters are statistically more significant. Fig. \ref{fig:disc_fraction_age_old} bottom left shows the disc fraction as a function of cluster age for the clusters within 1 kpc (see Table \ref{tab:disc_fractions_old_new}). However, here the symbol area is approximately proportional to the number of stars, $N$, considered in determining the disc fraction. It becomes apparent that the disc fractions of Upper Sco and UCL/LCC are considerably more statistically significant than those of the younger clusters. In total, there are 448 stars surrounded by a protoplanetary disc in Upper Sco and UCL/LLC in \citep[][]{Luhman:2021}. Therefore it is improbable that some extreme outlier stars dominate by their exceptionally long disc lifetimes. Thus the result of a median disc lifetime exceeding 5 Myr seems to be highly statistically significant.

Besides these selection effects, some older studies assumed Upper Sco was younger and had a lower disc fraction. Age estimates for Upper Sco range from 5 Myr to 12 Myr \citep[ for example, ][]{Preibisch:2002,Pecault:2016}, however, with an increasing consensus towards an age of 10 -- 12 Myr \citep[][]{Feiden:2016,Ascensio:2019}.  Before GAIA, significant uncertainties in membership existed, especially in the cluster outskirts. Disk fractions in the outer areas could be up to 3 times lower due to false positives at that time \citet{Rizzuto:2012}. One strategy to avoid the problem of false positives was to consider only the central cluster areas. However, at least for high-mass clusters older than 3 -- 5 Myr, this introduces a bias toward lower disk fractions caused by external disk destruction \citep[][]{Pfalzner:2014}. Nowadays, the false positive rate in the outskirts of clusters is much lower. Recent disk fractions of Upper Sco are nearly twice as high as the 11 \% used in several older studies. Similarly, for the 15 -- 20 Myr old UCL/LCC region, disk fraction values increased from 1\% -- 3\% to 9 \% nowadays.

Why does restricting to nearby clusters with an even spread in cluster ages lead to a longer disc lifetime? \citet[][]{Michel:2021} found the disk fraction of Upper Sco to be very similar to that of co-moving groups of similar age. They argue that the low-UV radiation in both samples is the reason for the similarity in disk fractions. In the following, we reason that distance rather than similar radiation levels might lead to disc fractions being similar for these otherwise quite different environments.

\section{Median disk lifetime: a question of stellar mass}
\label{sec:stellar_mass}

Many studies found that disk fractions to be lower for high- than low-mass stars \citep[e.g.,][]{Carpenter:2006,Roccatagliata:2011,Yasui:2014,Ribas:2015,Richert:2018}.
Here we hypothesise that this stellar mass dependence of disc fractions is partly responsible for the wide spread in disc fractions at any given age. Most stars are of low mass (M- and K-type); however,  observations of more distant clusters or at low sensitivity suffer from limiting magnitude. Thus mean stellar mass is higher as low-mass stars are under-represented in these samples. This bias towards higher stellar mass affects the derived disc lifetimes directly. As high-mass stars lose their disks faster\citep[for example, ][]{Ribas:2015}, distant cluster disk fractions are systematically lower. Consequently, the derived disc lifetimes are shorter.

We test this hypothesis by plotting the disk fractions as a function of stellar age colour-coded by cluster distance (Fig. \ref{fig:disc_fraction_age_old} bottom left). A strong correlation between the slope of the decline in disk fraction with cluster distance becomes apparent. Obviously, current median disk lifetimes suffer from a strong selection effect connected to cluster distance. Here cluster distance is only a crude proxy for missing out on low-mass stars in the more distant samples but is sufficient to demonstrate the problem.

The mean density of distant clusters like Arches or Trumpler 14 clusters is about a thousand times higher than in clusters like the ONC. These dense clusters are located at distances $>$ 2000 pc. Therefore they are strongly affected by limiting magnitude; The derived very low disc fractions usually apply only to stars with masses $>$ 1 \MSun. However, environmental effects should also apply to these clusters \citep[][]{Mann:2014,Vincke:2016,Ansdell:2017}. However, determining the relative importance of mass dependence vs environment remains a challenging task.

Upper Sco has a disk fraction of 5\%$^{+4\%}_{-3\%}$ for B7--K5.5-type stars \citep[][]{Luhman:2021} compared to 22\%$\pm$0.02 for low-mass stars (M3.7-M6). Similar, for the UCL/LLC, the disk fraction is 0.7\%$^{+0.06}_{-0.04}$ for higher mass stars compared to 9\%$\pm$1\% for low-mass stars. The statistical significance of these data is quite high, even when separated into mass bins. For M3.75-M6 stars (22\%) it is based on 633 objects, for K6-M3.5 stars (18\%) on 311 objects, and for B7--K5.5-type stars (5\%$^{+4\%}_{-3\%}$) on 76 objects in \citep[][]{Luhman:2021}. So even for the high-mass star, the statistical sample is as large as many young low-mass clusters' total population. The statistical significance is even higher for the UCL/LLC data, with sample sizes of 2488, 725 and 452 in the equivalent stellar mass bins.

\begin{figure}[t]
\includegraphics[width=0.50\textwidth]{Disc_fraction_mass_100_75.pdf}
\caption{Disk fraction vs. cluster age.  Top: colors indicating different cluster distances. Middle: colors indicating different limiting magnitudes. Bottom: Fits for mass-dependent disc lifetimes based on the high-significance values of Upper Sco and UCL/LCC assuming an initial disc fraction of 100\% (solid line) and 75\%  dashed line}.
\label{fig:disc_fractions_mass}
\end{figure}

This dependence of the disk fractions on stellar mass translates into shorter disc lifetimes for high- than low-mass stars. Figure \ref{fig:disc_fractions_mass} shows a simple extrapolation based on the  Upper Sco and UCL/LLC data, assuming an initial disk fraction of 100\%. Basing the curves on just three points is not ideal (the third one being the assumed primordial disc fraction, but as shown in Fig. \ref{fig:disc_fraction_age_old}, bottom, the fit for the total disk fraction holds for additional clusters. Nevertheless, it illustrates the critical point of the mass-dependence of the decline in disc fraction. Using Fig. \ref{fig:disc_fractions_mass} as a first indication, we expect that 50\% of the low-mass stars still have a disk at $\approx$ 5 Myr. By contrast, only $<$ 20\% of the high-mass stars retain their disks at that age. Half of the high-mass stars have already lost their disks at $\approx$ 2  Myr.   Thus the median disk lifetime of high- and low-mass stars seems to differ at least a factor of two.

There is considerable uncertainty of the zero-age disk frequency \citep[][]{Michel:2021}. If all stars are initially surrounded by disks, the median disk frequency for the low-mass stars would be 5 -- 7 Myr, whereas for initial disk frequencies of 80\%, the median disk lifetime increases to \mbox{6 -- 10 Myr.} (see Fig. \ref{fig:disc_fractions_mass} bottom). Here again the higher values are obtained when performing a Gaussian fit the corresponding disc life distribution.

The mass dependence disk lifetime could be determined from the disk fractions for the different stellar masses. Unfortunately, there is a lack of statistically meaningful data for high stellar masses. Fig. \ref{fig:mass} illustrates the general trend based on the Upper Sco and UCL/LCC data. Both scenarios (initial disk frequency of 100\% and 80\%) show the same overall trend: For M -- K stars, the median disk lifetime is basically the same, but for higher mass stars, it is considerably lower. However, where precisely the decline in disk lifetimes happens remains uncertain. This relation requires urgently further observational investigation.

Why do high-mass stars lose their disks so much earlier than low-mass stars?
One answer might lie in their higher efficiency in accreting material and photo-evaporation. \citet{Martijn:2021} find that stars with masses exceeding  \mbox{0.8 \MSun\ } have shorter lifetimes due to these two effects; nevertheless, lifetimes up to 15 Myr are still possible for all host star masses up to 2 \MSun. The critical role of accretion is supported by observations finding that the lowest M stars still that retain a disk at ages $\approx$ 8 -- 10 Myr also show moderate accretion levels \citet[][]{Venuti:2019}.

\section{From the diversity of disk life times to that of planets}
\label{sec:planets}

The biggest surprise in exoplanet observations is the immense diversity in planets and planetary systems \citep[][]{Howard:2013,Gaudi:2021}. Suggested causes
are, among others, differences in the disk mass and disk mass profile \citep[][]{Kokubo:2002}, the metallicity of the stars \citep{Petigura:2018}, the location of rings in discs \citep[][]{Marel:2021}, and the type of cluster environment \citep[][]{Bate:2018,Vincke:2018,Winter:2020}.

The variation in individual disk lifetime has also been suggested to influence the type of planet that forms and the architecture of the planetary systems \citep[][]{Carpenter:2005,Luhman:2012, Ribas:2015}. If that holds, the stellar mass dependence of the disc lifetime should result in differences in the planets as a function of stellar mass.

\begin{figure}[h]
\includegraphics[width=0.47\textwidth]{Mass.pdf}
\includegraphics[width=0.5\textwidth]{Schematic_planet.pdf}
\caption{Top: Median disk lifetime as function of stellar mass assuming 100 \% initial disc fraction (dashed lines,) 80\% initially disc fraction (solid lines) and assuming a lower Upper Sco age of 8 Myr instead of 11 Myr (dotted lines).The orange lines show the general trend including the uncertainty for higher mass stars. Bottom: Correlation between disk lifetime and properties of planetary system.}
\label{fig:mass}
\end{figure}

Disk masses scale quasi linearly with stellar mass \citep[e.g., ][]{Andrews:2020}. Thus high-mass stars have a much larger gas and dust reservoir for planet formation.
Therefore it is not surprising that main-sequence FGK stars host more larger planets than low-mass stars \citep[][]{Howard:2012, Sabotta:2021}. However, the situation is different for smaller planets. M dwarfs host about a factor of three more small planets (1.0--2.8 R$_\Earth$\,) than main-sequence FGK stars \citep[for example, ][]{Mulders:2021}. However, the mass is not simply redistributed into more, smaller planets. Surprisingly, the average heavy-element mass decreases with increasing stellar mass from 7 M$_\Earth$\, for M stars to 5 M$_\Earth$\, for G and K stars and 4 M$_\Earth$\, for F stars. Thus despite M star disks containing ten times less mass, they are nearly 20 times as efficient than F stars in converting the disk's heavy-element content into planetary material. The higher heavy-element content also corresponds to a higher fraction of stars with planetary systems for low-mass stars \citep[][]{Yang:2020, He:2021}.

The strong dependence of the disk lifetime on stellar mass may explain the high planet-formation efficiency in low-mass stars. High-mass stars seem to produce their high-mass gas giants on timescales shorter than 3 Myr while failing to form additional low-mass planets. By contrast, low-mass stars form large planets to a lower degree; however, their long disk lifetimes allow for the formation of many small planets. In a way, slow but steady beats fast and short.

Forming low-mass planets on time scales $>$ 5 Myr lowers the hurdles for the standard accretion model. However, explaining why high-mass stars form more massive planets on considerably shorter time scales remains a significant challenge. A possible explanation is that their higher disk masses make their disks more prone to gravitational instabilities. However, as $M_d / M_s \sim$ const independent of stellar mass, the parameter $Q$ that describes the stability of disks should be the same for high and low mass stars. Thus unstable disks are at least not a straightforward explanation. Thus planet formation around high-mass stars remains an open question.

\section{Summary and Conclusion}

We investigated the role of cluster sample selection on derived median disc lifetimes. We find that samples with a large fraction of distant, young clusters \mbox{($>$ 200 pc;} $<$ 5 Myr) tend to derive short disc lifetimes (1 -- 3 Myr). Samples including higher fractions of nearby, older clusters arrive at higher disc lifetimes ($>$ 5 Myr). Restricting to clusters closer than 200 pc aged between 1 and 20 Myr, we obtain a median disk lifetime of 5 to 10 Myr.

One main reason for this discrepancy is that distant clusters are affected by limiting magnitude. Therefore, the disc fraction of, on average, higher mass stars is determined in distant clusters. As the disk lifetime of high-mass stars is shorter than for low-mass stars, the disc fractions of more distant clusters seem lower due to this selection effect. We conclude that disc lifetimes derived from samples including many distant clusters ($>$ 200 pc) represent mostly high-mass stars. Indeed, if we only consider the high-mass stars in the sample limited to distances $<$ 200 pc, we recover a disk lifetime of only 2 -- 4 Myr.

However, these disc lifetimes are not representative of most of the stars. Low-mass stars have a median disc lifetime of 5 -- 10 Myr. The actual value depends mainly on the assumed initial disc fraction. If all stars are surrounded by disks at cluster ages $t_c$ = 0 Myr, the median disc lifetime is  5-- 6 Myr. However, some stars seem to be born diskless or lose their disk extremely rapidly to planet formation. An initial disk fraction of \mbox{70\%-- 80 \%} would increase the disk dissipation times for low-mass stars to 8 -- 10 Myr and that of high-mass stars to 4 -- 5 Myr.

For low-mass stars, the median disk lifetime of \mbox{5 -- 10 Myr} significantly relaxes the temporal constraints on planet formation. These long disk lifetimes allow for sufficient time for planets to form via accretion.
The diversity of disk lifetimes might influence the structure of the emerging planetary system. It could be responsible for low-mass stars having considerably higher efficiency in using the heavy-element content in their disk for planet formation. Despite having considerably lower disk masses to start with, these low-mass stars produce a larger number of lower-mass planets. The real challenge remains to explain how high-mass stars can form planets on such a short timescale.

Currently, the effect of the environment on the disk lifetime is still not quantifiable. Only disk fractions for high-mass star clusters have been determined for dense clusters due to their general large distances ($>$ 2000 pc). A comparison is difficult even for those high-mass stars as the initial disc fraction in these dense clusters is unknown. Its uncertainty is very high, as none of the measured disc fractions exceed 32\%.

Generally, determining the initial disc fraction is the next step to determine disc lifetimes accurately. This includes potential dependencies on stellar mass, cluster density and binarity.  \\

\bigskip
We thank the referee for the constructive report and useful suggestions that have significantly improved our manuscript. We would like to thank K. Luhman for helpful advice on interpreting his results on the disk fractions in Upper Sco and UCL/LCC.

\begin{table*}
        \caption{Disk fractions}
        \centering
        \begin{longtable}{lrclllcclccccc}
        \hline
        Identification & $d$ & Age & $N_{stars}$  & $f_d$ &  Limit  & Median mass &  log($\rho_c)$ &Source  \\
                       & pc  & Myr &              &           &    & [\MSun]& [\MSun/pc$^3$] \\
                     \hline
      $ d \ll$ 200 pc\\
       \hline
       \hline%
       Alessi 30         &  108 & 30       & 162  & 0.049\footnote{possibly debris disk fraction} &     0.04 \MSun & & & a)  \\
       UCL/LLC           &   150 & 15--20  & 3665 & 0.09            &   & 0.15                               &  -0.85 -(-1.05) & b) \\
       32 Ori       &   95  & 15--20 &  160 & 0.07 &   & 0.15  & & f1 \\
       Upp Sco           &  145 & 10--12  & 1774 & 0.22/0.20       & 0.01 \MSun  & 0.15                                &-0.59 &   b, c) \\
       Lupus -off cloud  & 160  & 10--12  &  60    & 0.21 $\pm$ 0.06 &  0.05 \MSun        &                                  & &   l)\\
       $\eta$ Cha        &   94 &  8--14  &  40    & 0.28/33         &          &                                  & &   d)\\
       \hline
       TW Hya            &   56 & 7--13   &  56   & 0.25/0.30       &          &                                   &  & d)\\
       Lupus-on cloud    &  160 & 6       &  30  & 0.63 $\pm$ 0.04 &   0.05 \MSun       &                                    & & l) \\
       CrA               &  152 & 5       & 146  & 0.23 $\pm$ 0.4 & 0.04 \MSun &                                   & & d)\\
       $\epsilon$ Cha    &  101 & 5 (3--8)& 90& 0.5/0.3\footnote{The disk fraction is much higher in the center than the outskirts ($>$10 pc) of $\eta$ Cha}&      &                                                                                & & d, e)\\
       \hline
       Lupus             &  158 & 2.6--3.1 & 158  & 0.50/0.53  & 0.03 \MSun &                                      & & a, d) \\
       Cham I            &  188 & 1.7      & 183  & 0.44  & 6 $<$G $<$20    &                                      & & f) \\
       Cham II           &  197 & 1.7      & 41   & 0.76  & G12-G18         &                                      & & f)  \\
       Taurus            &  128-196 & 1--2 &  137    & 0.49  &       0.05 \MSun          &                                   & & i)    \\
       Ophiuchus         &  139 & 1--2     &  420    & 0.62  &                 &                                   & & i)    \\
        \hline
        \hline
        200 pc $< d <$ 500 pc\\
       \hline
       \hline
        25 Orionis        &  330   &    8.5 $\pm 1.5$ & 26   & 0.09      &     &   &   & g)\\
        Ori 1a            &  355   &    8             & 811  & 0.08      &  0.1 \MSun   &   &   -0.54   & a1) \\
        $\gamma$ Vel      &  345   &    7.5           & 125  & 0.06      &  0.2 \MSun   &   &      & i) \\
        $\lambda$ Ori     &  414   &    5             & 43   & 0.19      &     &   &      & i) \\
        OriOB1b           &  414   &    5             & 278  & 0.15      &  0.04 \MSun   &   &      0.55 & i) \\
        IC 348            &  310   &   2-3            & 310  & 0.50/0.40 &   &   &     2.2 & d) \\
        $\sigma$ Ori      &  414   &   2.5            & 71   & 0.36      &     & 0.3 \MSun  &      & i) \\
        NGC2068/NGC2071   &  400   &   1-3            & 67    & 0.54     &     &   &      & j) \\
        Berkley59         &  400   &   1.8            & 201  & 0.50      &  0.1 \MSun   & 0.78  &  & k) \\
        Serpens South     &  415   &   1.8            & 26 & 0.58       &  0.1 \MSun   &  0.3 & & k) \\
        ONC Flank         &  414   &   1.7            & 236 & 0.43       &  0.13 \MSun  &  0.52 & 1.3 & k) \\
        OMC               &  414   &   1.5            & 181 & 0.45       &  0.09 \MSun  &  0.32 &  & k) \\
        L1630N            &  400   &   1.5            &     & 0.97       &     & &      & l) \\
        Lynds1641         &  400   &   1.5            & & 0.51       &     &    &  & m) \\
        NGC1333           & 320    &   1.0            & 73 & 0.81       &     &  &    & j) \\
        Flame/NGC2023     &  414   &   0.8            & 142 & 0.71       &  0.1 &  0.38 \MSun  &  & k) \\
        Serpens           &  425   &   0.5            & 137   & 0.75       &     &  &    & j) \\
        NGC2024           & 415    &  0.3             & & 0.85       &     &     & 2.424& a1)\\
        \hline
        \hline
        500 pc $< d <$ 1000 pc \\
       \hline
       \hline
        NGC 7160        & 900      & 11 $\pm$ 1      & --    & 0.04 $\pm$ 0.03  & & &  &b1) \\
        CepOB3b-East    & 700      & 3.5             &       & 0.32             & & &  &x) \\
        CepOB3b-West    & 700      & 3.5             &       & 0.50             &  & & &y) \\
        NGC2264         & 760      & 3.2             & 324      & 0.52             & & & &c1)\\
                        & 751      & 3.1             &       & 0.38             & & & &j) \\
        Trumpler37      & 900      & 2.6             &       & 0.49             & & & &j) \\
        CepC            & 700      & 2.2             &  59   & 0.44             & 0.1 \MSun  & 0.47 && k) \\
        CepA/A          & 700      & 2.0             &  77   & 0.38             & 0.1 \MSun  & 0.43 && k) \\
        MonR2           & 830      & 1.7             &  208  & 0.64             & 0.09 \MSun & 0.47 & 1.72  &k) \\
        LkH$\alpha$101  & 510      & 1.5             &  140  & 0.56             & 0.1 \MSun  & 0.56 && k) \\
        L988e           & 700      & 1.5             &       & 0.79             &  & & & d1) \\
       \multicolumn{3}{r}{Continued on next page}\\%

        \end{longtable}
  \end{table*}

   \begin{table*}
     \renewcommand\thetable{2}
        \caption{continued}
        \centering
        \begin{longtable}{lrclllcclccccc}
        \hline
        Identification & $d$ & Age & $N_{stars}$  & $f_d$ & Limit  & Median mass& log($\rho_c)$ &Source  \\
                       & pc  & Myr &              &           &    & [\MSun]& [\MSun/pc$^3$] \\
\hline%
\hline%
        CepA/C          & 700      & 1.4             &  86   & 0.65             & 0.1 \MSun & 0.38 && k) \\
        RCW36           & 700      & 0.9             &       & 0.81             & 0.1 \MSun & 0.35 & &k) \\
        W40             & 500      & 0.8             &       & 0.79             & 0.1 \MSun & 0.53 & &k \\
       \hline
       \hline
                             1000 pc $< d <$ 2000 pc \\
       \hline
       \hline
       NGC6231         & 1585     & 4    & & 0.05               & & & &n)  \\
       NGC2282         & 1650     & 3.5  & & 0.58               & & & &o)  \\
       NGC7129         & 1260     & 3    & & 0.33 $\pm$ 0.22    & & & &q)  \\
       W3Main          & 1950     & 3    & & 0.07               & & & &r)  \\
       NGC2244         & 1880     & 3    & 570 & 0.445              & & & 1.03 & e1) \\
       NGC2362         & 1480     & 2.5  & & 0.12               & & & &k) \\
       M8              & 1300     & 2.3  & & 0.41               & & & &k) \\
       AFGL333         & 2000     & 2.0  & & 0.55 $\pm$ 0.5     & & & &s)  \\
       NGC 6611        & 1995     & 2.0  & & 0.59                      \\
                       & 1750     & 1.2  & & 0.34               & & & 1.45 &u)\\
       Pismis 24        & 1700     & 1.85 & & 0.33               & & & &t) \\
       Cyngus OB2       & 1450     & 1.5  & & 0.29               &  &  &1.61  &u)  \\
       M 17             & 2000     & 1.1  & 35 & 0.6                & 0.12 \MSun & 3.68 & & k)  \\
       Sh2-106         & 1400     & 0.8  & 92 & 0.53 $\pm$ 0.1     & 0.13 \MSun & 0.6  & & k)  \\
       NGC 6530         & 1300     & 0.7  & & 0.20               & & &  &v)  \\
       \hline
       \hline
       $d >$ 2000 pc \\
       \hline
       \hline
       Trumpler 15      & 2360    & 8.0 & & 0.021    & 1 \MSun   & & & w)  \\
       Bochum 1         & 2800    & 5.0 & & 0.086    & A -B      & & & w) \\
       Quintuplett      & 8000    &  4.0   & 766 &  0.04    & A - B    & &3.7 & z)  \\
       Trumpler 16      & 2700    & 3.0 & & 0.069    & 1 \MSun   & & &w)  \\
       Trumpler 14      & 2800    & 2.0 & & 0.097    & 1 \MSun   & &4.3 &w)  \\
       Arches           & 8000    & 2.5 & & 0.092    & A - B     & & 5.6  &z) \\
       NGC 3603         & 3600    & 1.0 & & 0.27     &           & & 5.0  &z) \\
       TTC              & 2700    & 0.1 & & 0.32     & 1 \MSun   & & &w)\\
       \hline
       \hline
              \end{longtable}
              \tablerefs{a) \citet[][]{Galli:2021_1}, b) \citet[][]{Luhman:2021}, c) \citet{Luhman:2020}, d) \citet[][]{Michel:2021}, e) \citet[][]{Dickson:2021}, f) \citet[][]{Galli:2021_2}, g) \citet[][]{Ribas:2014}, i) \citet[][]{Manzo:2020}, j) \citet[][]{Sung:2009}  k) \citet{Richert:2018},l) \citet{Spezzi:2015}, m)\citet{Fang:2013}, n)\citet{Damiani:2016}, o)\citet[][]{Dutta:2015}, q) \citet[][]{Stelzer:2009}, r) \citet[][]{Bik:2014}, s)\citet[][]{Jose:2016}, t) \citet[][]{Fang:2012}, u) \citet[][]{Guarcello:2016}, v) \citet[][]{Damiani:2006}, w) \citet[][]{Preibisch:2011}, x) \cite{Allen:2008}, y) \citet[][]{Allen:2012}, z) \citet[][]{Stolte:2015}, a1) \citet{Briceno:2019}, b1) \citet{Hernandez:2008}, c1) \citet[][]{Sousa:2019}, d1) \citet[][]{Allen:2008}, e1) \citet[][]{Balog:2007}
              }
     \label{tab:disc_fractions_old_new}
\end{table*}

\newpage
\bibliographystyle{aa}


\section{Introduction}
\label{sec:intro}
Meshing of 3D point clouds has been studied extensively.
Traditional methods either employ direct approaches based on
local neighborhood properties
\cite{edelsbrunner_shape_1983,edelsbrunner_threedimensional_1994,boissonnat_geometric_1984,amenta_new_1998,amenta_power_2001,amenta_power_2001a,amenta_surface_1999} or use an implicit volumetric representation as an intermediary step~\cite{hoppe_surface_1992,carr_reconstruction_2001,lewiner_efficient_2003,lorensen_marching_1987,ju_dual_2002,schaefer_dual_2004,taubin_smooth_2012,fleishman_robust_2005,kolluri_provably_2008,oztireli_feature_2009,kazhdan_poisson_2006,kazhdan_screened_2013}.
While early works perform poorly on noisy real-world input or exhibit high computational demands, follow-up methods have addressed several of these shortcoming~\cite{lv_voxel_2022,thayyil_local_2021,zhong_surface_2019,boltcheva_surface_2017}.

\begin{figure}[t]
    \centering
    \includegraphics[width=1.0\textwidth]{fig_teaser.pdf}\\[-6pt]
    \caption{\textbf{NeuralMeshing{}.} We propose a novel meshing algorithm specifically designed for neural implicit representations (NIRs). Starting from an initial set of randomly placed seed triangles on the zero level set of the implicit neural representation, NeuralMeshing{} iteratively expands the triangles into all directions until the full zero level set is covered}
    \label{fig:teaser}
\end{figure}

In recent years, neural implicit representations (NIRs)~\cite{park_deepsdf_2019,mescheder_occupancy_2019,michalkiewicz_deep_2019,chen_learning_2018} have been used to improve upon traditional implicit-based representations by storing the implicit function within a deep neural network.
Follow-up approaches based on these have addressed various issues, \eg, concerning scalability~\cite{peng_convolutional_2020,chabra_deep_2020,jiang_local_2020}, quality~\cite{duan_curriculum_2020,sitzmann_implicit_2020,sitzmann_metasdf_2020} or processing of raw data~\cite{atzmon_sal_2020,atzmon_sald_2020,gropp_implicit_2020}.
However, such methods still rely on an isosurface extraction method like marching cubes~\cite{lewiner_efficient_2003,lorensen_marching_1987} in order to generate the final triangle mesh, usually resulting in unnecessarily high-resolution triangle meshes.
Furthermore, those post-processing steps are often not differentiable, prohibiting end-to-end training of networks.

In this paper, we propose NeuralMeshing{} (Figure~\ref{fig:teaser}), a novel data-driven approach for directly predicting a triangle-mesh from a NIR{}.
NeuralMeshing{} aims to close the gap of a differentiable meshing approach specifically designed for the usage with NIRs{}.
Starting from a seed of initially placed triangles, NeuralMeshing{} iteratively extends triangles at boundary edges by predicting new vertex locations given local geometry information like curvature, SDF and surface normals through queries on the underlying implicit representation.
This allows to adaptively place bigger triangles at surface areas with lower curvature, \ie flat surface patches, and smaller triangles at areas with high curvature.
The main contributions of this paper can be summarized as follows:
\textbf{(1)} We propose NeuralMeshing{}, a novel data-driven meshing approach for NIRs{}. Our method iteratively predicts new triangles based on local surface information from the implicit representation.
\textbf{(2)} Extensive experiments show that NeuralMeshing{} better approximates the surface of NIRs{} while using considerably fewer triangles than commonly used iso-surface extraction methods~\cite{lewiner_efficient_2003}.

\section{Related Work}
\label{sec:related_work}
\boldparagraph{Traditional Deterministic Reconstruction Methods.}
Early works on shape reconstruction from points have proposed deterministic approaches using alpha shapes~\cite{edelsbrunner_shape_1983,edelsbrunner_threedimensional_1994}, Delaunay triangulation~\cite{boissonnat_geometric_1984} or ball-pivoting~\cite{bernardini_ballpivoting_1999}.
Such methods make local decisions to directly triangulate the given input point cloud.
Later works focused on extracting the surface as the crust of a Voronoi diagram~\cite{amenta_new_1998,amenta_power_2001,amenta_power_2001a,amenta_surface_1999}.
However, these methods do not well handle noise or outliers and thus perform poorly on real-world data, creating noisy and incomplete output meshes.

\boldparagraph{Traditional Implicit Reconstruction Approaches.}
In contrast to triangulation methods, implicit-based approaches try to represent the surface as an implicit function.
The pioneering work of Hoppe~\emph{et al}\onedot~\cite{hoppe_surface_1992} introduced a method for creating a piecewise smooth surface through implicit modeling of a distance field.
An alternative approach relies on radial basis function methods~\cite{carr_reconstruction_2001} which try to fit implicit functions to a surface.
Another line of work focuses on extracting the iso-surface from signed distance function values (SDF) of a volumetric grid, the most prominent known as the marching cubes algorithm~\cite{lorensen_marching_1987,lewiner_efficient_2003}.
There has been a plethora of follow-up work~\cite{ju_dual_2002,taubin_smooth_2012,schaefer_dual_2004}, improving upon marching cubes.
Moving least-squares (MLS)~\cite{fleishman_robust_2005,kolluri_provably_2008,oztireli_feature_2009} based techniques locally reconstruct the surface with local functions approximating the SDF in the local neighborhood.
Poisson surface reconstruction~\cite{kazhdan_poisson_2006,kazhdan_screened_2013} reconstructs surfaces from oriented points via energy optimization.
While these methods are able to close larger surface holes they come with high computational demands.

\boldparagraph{Neural Implicit Representations.}
Recently, neural implicit representations are used as an alternative representation for surface reconstruction. Pioneering works \cite{chen_learning_2018,mescheder_occupancy_2019,michalkiewicz_deep_2019,park_deepsdf_2019} use coordinate-based deep networks in order to learn a continuous SDF or occupancy function. While the early works have been limited to objects and low levels of details, follow-up approaches have extended the representations to scenes of larger scale~\cite{chabra_deep_2020,chibane_implicit_2020,jiang_local_2020,lombardi_scalable_2020,mi_ssrnet_2020,peng_convolutional_2020}, proposed learning on raw data~\cite{atzmon_sal_2020,atzmon_sald_2020,chibane_neural_2020,gropp_implicit_2020}, improved details~\cite{sitzmann_implicit_2020} or improved upon the training scheme~\cite{duan_curriculum_2020,sitzmann_metasdf_2020}.
In order to obtain the final mesh, all these methods rely on extracting the surface via an iso-surface extraction approach like marching cubes~\cite{lorensen_marching_1987}.

\boldparagraph{Data-driven Direct Meshing Approaches.}
Recent works have started to adopt deep learning-based approaches for triangulation and meshing of shapes.
Early approaches used deep networks in order to warp 2D patches onto the point cloud~\cite{groueix_atlasnet_2018,williams_deep_2019}. Such parametric approaches often lead to undesirable holes and overlapping patches.
Some works proposed to utilize grids, \eg to predict a signed distance field using random forests~\cite{ladicky_point_2017}, to deform and fit a shape~\cite{yang_foldingnet_2018} or to extract the surface via a differentiable marching cubes algorithms~\cite{liao_deep_2018}. However, they come with high computational resource demands.
BSP-Net~\cite{chen_bspnet_2020} and CvxNet~\cite{deng_cvxnet_2020} both build upon the idea of predicting a set of hyperplanes for creating convex shapes as building blocks of the final shape. The triangulation is extracted through a non-differentiable post-processing step involving convex hull computations in the dual domain.
However, the number of planes is fixed which limits the reconstruction to objects of smaller scale.
Another line of work deforms and fits a template mesh to the input point cloud~\cite{hanocka_point2mesh_2020,pan_deep_2019,wang_pixel2mesh_2018,wen_pixel2mesh_2019}.
However, the topology of the reconstructed shape is usually fixed to the topology of the provided template mesh.
Recently, PointTriNet~\cite{sharp_pointtrinet_2020} proposed to directly predict the connectivity of the given input point cloud.
In an iterative procedure, triangle candidates are first proposed and then classified for their suitability to be part of the final mesh.
While the method is local and differentiable, the resulting meshes often include holes. Similarly, Rakotosaona~\emph{et al}\onedot~\cite{rakotosaona_learning_2021} model the problem of triangulation locally by predicting a logarithmic map which allows triangulation in 2D using non-differentiable Delaunay triangulation.
Finally, some recent work focus on using the neural implicit representation as the core representation for differentiable meshing or learning~\cite{chen_neural_2021,peng_shape_2021,guillard_deepmesh_2021}.
Neural Marching Cubes~\cite{chen_neural_2021} implements a data-driven approach to improve the mesh quality at sharp edges by defining a learnable representation to differentiate between the topological configurations of marching cubes.
They introduce additional vertices inside cells of the underlying grid and predict the offset of these vertices.
However, they use a 3D ResNet and rely on discretized inputs, limiting the resolution and making it less memory efficient.
In contrast, our method operates in continuous space and therefore on arbitrary resolutions.
DeepMesh~\cite{guillard_deepmesh_2021} uses a trick, \ie, an additional forward pass on all mesh vertex locations for computing gradients with respect to an underlying implicit representation without the need to make the meshing differentiable.
They use a non-differentiable marching cubes algorithm to generate the output and define loss functions directly on the obtained mesh.
The %
recent work by Peng~\emph{et al}\onedot~\cite{peng_shape_2021} instead proposes a new shape representation based on a differentiable Poisson solver.
Contrary to those two works, we aim to directly create a triangle mesh from the underlying neural implicit representation.
\section{Method}
\label{sec:method}

NeuralMeshing{} takes as input an oriented point cloud $\XPC = \{(\Xp_{i}, \Xn_{i})\ |\ \Xp_{i}\in\mathbb{R}^3, \Xn_{i}\in\mathbb{R}^3\}_{i=1}^{\Xnumpoints}$.
Our goal is to compute a surface mesh $\XM = (\XV, \XF)$ defined as a set of vertices $\XV =\{\Xv_i \in \mathbb{R}^3\}$ and a set of triangular faces $\XF$ %
in order to approximate the surface of a shape.
In a first step, we employ a modified neural implicit representation $\XNIP$ in order to learn a continuous SDF field approximating the shape's surface.
In a second step, we use
the neural representation %
as input for our meshing algorithm in order to extract an explicit representation $\XM$ of the surface.
In order to effectively predict new triangles, our neural representation $\XNIP$ uses an extra branch in addition to the existing SDF branch, which outputs curvature information.
Please refer to Figure~\ref{fig:overview} for an overview of our method.
\begin{figure}[tb]
    \centering
    \includegraphics[width=1.0\linewidth]{fig_big_picture.pdf}\\[-5pt]
    \caption{\textbf{Overview.} Given an input point cloud $\XPC$ (left), we use a neural implicit representation with added curvature head $\XNIP$ (middle) to extract a continuous SDF field. After placing a set of random triangles on the zero level set of $\XNIP$, NeuralMeshing{} then queries $\XNIP$ in order to predict a triangular mesh $\XM$ (right) in an iterative fashion. Red blocks denote trainable MLPs
    }
    \label{fig:overview}
\end{figure}
\subsection{Modified Neural Implicit Representation}
Ideally, we aim for small triangles where the curvature is high and larger triangles at low curvature.
To account for this, we extend the neural implicit representation $\XNIP$ with curvature information.
In order to learn a NIR{}, we follow Gropp~\emph{et al}\onedot~\cite{gropp_implicit_2020} and use implicit geometric regularization (IGR) for network training.

\begin{figure}[tb]
    \captionsetup[subfigure]{aboveskip=0pt,belowskip=-5pt}
	\centering
	\begin{subfigure}[t]{0.25\linewidth}
		\centering
        \includegraphics[width=1.0\linewidth]{fig_turning_angle.pdf}
        \caption{\textbf{Turning angle.}}
        \label{fig:turning_angle}
	\end{subfigure}
	\begin{subfigure}[t]{0.30\linewidth}
		\centering
        \includegraphics[width=1.0\linewidth]{fig_init_triangles.png}
        \caption{\textbf{Initialization.}}
        \label{fig:mesh_init_triangles}
	\end{subfigure}
	\begin{subfigure}[t]{0.43\linewidth}
		\centering
        \includegraphics[width=1.0\linewidth]{fig_mesh_evolution.pdf}
        \caption{\textbf{Iterative meshing process.}}
        \label{fig:mesh_evolution}
	\end{subfigure}
	\caption{\textbf{Meshing procedure.}
	(a) We employ the turning angle for approximating the curvature, \ie, the signed angle between the tangential lines, defined by query point $\Xq_1$ and the target point $\Xq_2$, respectively.
	(b) NeuralMeshing{} first randomly places points in space (blue points), which are then projected to the zero surface of $\XNIP$. The resulting projections (red points) serve as the initialization locations for new surface triangles.
	(c) Based on the implicit shape (orange sphere), a set of initialization triangles (light blue) is placed on the surface of the object. In an iterative fashion, new faces (green triangles) are added at boundary edges of the existing faces (blue triangles) until the mesh is complete
	}
\end{figure}
\boldparagraph{Curvature Information.}
Our method grows the mesh seeds by generating new triangles in orthogonal direction of unprocessed boundary edges.
For generating new vertices close to the implicit surface, we are interested in the curvature only along that particular direction, \ie, normal curvature, which we found to provide more meaningful information than aggregated curvature measures, \eg, mean or gauss curvature.
The problem of measuring normal curvature on a surface in 3D can be reduced to a line on a 2D-plane, defined by a query point $\Xq_1$, its corresponding surface normal $\Xn_1$ and a query direction vector $\Xqdir$.
To this end, we employ the turning angle for approximating the curvature, \ie, the signed angle between the tangential lines, defined by query point $\Xq_1$ and the target point $\Xq_2$, respectively.
For our case, $\Xq_2$ is computed by following the geodesic path on the discrete mesh along $\Xqdir$ until a fixed distance $\Xldist$ has been covered, as illustrated in Figure~\ref{fig:turning_angle}.
We define $\Xangle_1=\frac{\pi}{2}$ as the angle between the tangential line and the surface normal at $\Xq_1$, and $\Xangle_2$ as the angle between the tangential line at $\Xq_2$ and the surface normal $\Xn_1$ at $\Xp_1$.
The turning angle is then computed as
$\Xcurv_{\Xq_1,\Xqdir} = \Xangle_2 - \Xangle_1 = \Xangle_2 - \pi / {2}$ .
The resulting value is positive for surfaces bending away from the surface normal $\Xn_1$, negative for surfaces bending towards the surface normal $\Xn_1$ and zero for flat surfaces.
Furthermore, the distance $\Xldist$ determines the scale of detected curvatures and is fixed to $0.005$ for all of our experiments.
Although just an approximation of curvature, we found the turning angle to be a good indicator for predicting the amount of surface bending.

\boldparagraph{Directed Curvature Head.}
We extend the neural implicit representation of IGR~\cite{gropp_implicit_2020} with an additional directed curvature head in order to predict the curvature $\Xcurv_{\Xq,\Xqdir}$
of a surface point $\Xq$ along the tangential direction $\Xqdir$.
The extended signed distance function
$(\Xsdf_{\Xq}, \Xcurv_{\Xq,\Xqdir}) = \Xnet_\Xcurv((\Xq, \Xqdir); \Xnetw; \Xlat)$
returns a tuple of signed distance and normal curvature at point $\Xq$.
We make the curvature query optional, such that the extended decoder can be queried for signed distance values only.
We use the same training losses as in IGR~\cite{gropp_implicit_2020}.
We train the curvature head with a supervised $L_2$ loss on top of the existing IGR losses $\Xloss_{\text{IGR}}$:
\begin{equation}
\begin{aligned}
    \Xlosstot(\Xnetw; \Xlat) = \Xlossigr(\Xnetw; \Xlat) &+ \Xlosswcurv \mathbb{E}_{\Xq,\Xqdir}(\norm{\Xcurv_{\Xq,\Xqdir} - \Xgtcurv}_2^2),
\end{aligned}
\end{equation}
where $\Xcurv_{\Xq,\Xqdir}$ is the curvature prediction and $\Xcurv_{\text{GT}}$ the ground truth curvature, based on the turning angle approximation.
During training, we sample a surface-tangential direction $\Xqdir$ uniformly at random for every element in the batch.
We refer to the supplementary material for architectural details.

\subsection{Iterative Meshing Procedure}
The input to our \textit{iterative meshing module} are the predictions of our modified implicit representation $\XNIP$.
The resolution of the output mesh $\XM = (\XV, \XF)$ is defined by the default equilateral triangle with circumradius $\Xrd$ which is provided as an input parameter.
In an initial step, random faces are placed along the surface defined by $\XNIP$.
Further processing then iteratively extends existing triangles by inserting new faces along boundary edges until completion of the mesh, as shown in Figure~\ref{fig:mesh_evolution}.
In order to keep track of boundary edges, we employ a halfedge data structure, which provides efficient operations for boundary edge access, vertex insertion and face insertion.
To find vertices in a local region quickly,
we use an additional k-d tree to keep track of mesh vertices.

\boldparagraph{Initialization.}
As visualized in Figure~\ref{fig:mesh_init_triangles}, the set of initial triangles $\{\Xtri_i\}^{\Xnumtriangles}$ is computed by first sampling a set of \Xnumtriangles{} points uniformly at random within the bounding box of the point cloud $\XPC$.
This set of points is then projected onto the surface using the gradient $ \nabla_{\Xq}\Xnet(\Xq;\Xlat)$
of the SDF prediction. For each projected point, we construct an equilateral triangle on the tangential plane with circumradius $\Xrd$ and random location of vertices.
We enforce a minimum euclidean distances $\Xdist_{\min} = 3\Xrd$ to be present between all
projected points in order to avoid overlapping triangles.
We use a k-d tree data structure to query candidates within a radius $\Xdist_{\min}$ efficiently and filter out overlapping triangles.
As the underlying implicit representation $\XNIP$ might exhibit inaccuracies, \eg, far from the surface, we employ a simple heuristic in order to accurately place the initialization triangles.
We perform the surface projection $\Xnumprojections$ times for $k \times \Xnumtriangles$ points, each time bringing the initial random samples closer to the surface, similar to Chibane~\emph{et al}\onedot~\cite{chibane_neural_2020}.
Finally, we choose random $\Xnumtriangles$ non-overlapping points as initialization locations for the triangles.

\boldparagraph{Iterative Face Insertion.}
Given the initial set of triangles $\{\Xtri_i\}^{\Xnumtriangles}$, our iterative meshing module proceeds to iteratively select boundary edges, \ie, edges of existing triangles which only have one connected face, and predict new vertices until no boundary edges are left.
The process can be accelerated by computing batches of vertex insertions.
To this end, the vertex predictions are computed batchwise on the GPU.
As batch processing introduces the risk of inserting overlapping triangles, we employ two simple strategies:
\textbf{(1)} Only boundary edges with distances between their mid-points greater than a certain threshold are processed in the same batch and
\textbf{(2)} we filter overlapping face insertion candidates before adding the faces to the mesh.
This procedure ensures that no overlapping triangles are inserted, given a reasonable threshold.
Since the sampling of non-overlapping boundary edges reduces the number of available boundary edges, we use a simplified procedure in practice where we apply a minimum threshold of $3\Xrd$ between the boundary edge centers.
Although this reduces the number of collisions, the absence of overlaps is not guaranteed.
We apply a final overlap check in order to reject candidates with small distances between triangle centers.

\subsection{Merging Surface Patches}
Naively inserting new faces for every boundary edge leads to overlapping surface patches.
Therefore, we employ a deterministic procedure for merging such faces.
Prior to creating the triangle proposed by the vertex prediction, we replace it by the existing vertex closest to the center $\Xbecent$ of the boundary edge,
provided the vertical distance is below a threshold $t_v=\frac{r_d}{2}$
and the prospective new triangle does not overlap with an existing triangle.
\begin{figure}[tb]
    \captionsetup[subfigure]{aboveskip=2pt,belowskip=-5pt}
	\centering
	\begin{subfigure}[t]{0.16\linewidth}
		\centering
		\includegraphics[width=1.\linewidth]{fig_a_no_overlap.pdf}
		\caption{}
		\label{fig:overlap_nope}
	\end{subfigure}
	\begin{subfigure}[t]{0.16\linewidth}
		\centering
		\includegraphics[width=1.\linewidth]{fig_b_trivial_overlap.pdf}
		\caption{}
		\label{fig:overlap_trivial}
	\end{subfigure}
	\begin{subfigure}[t]{0.16\linewidth}
		\centering
		\includegraphics[width=1.\linewidth]{fig_c_cover_existing.pdf}
		\caption{}
		\label{fig:overlap_covering}
	\end{subfigure}
	\begin{subfigure}[t]{0.16\linewidth}
		\centering
		\includegraphics[width=1.\linewidth]{fig_d_edge_intersection.pdf}
		\caption{}
		\label{fig:overlap_edge_intersection}
	\end{subfigure}
	\begin{subfigure}[t]{0.16\linewidth}
		\centering
		\includegraphics[width=1.\linewidth]{fig_e_parallel_faces.pdf}
		\caption{}
		\label{fig:overlap_parallel}
	\end{subfigure}
	\begin{subfigure}[t]{0.16\linewidth}
		\centering
		\includegraphics[width=1.\linewidth]{fig_f_near_vertex_clip.pdf}
		\caption{}
		\label{fig:overlap_near_clip}
	\end{subfigure}
	   \caption{\textbf{Triangle-overlap scenarios during merging.} Prior to inserting a prospective new triangle (green), a series of checks is performed, measuring the overlap with existing triangles (blue). In overlap cases, the prospective vertex (green) is replaced with the existing vertex (blue).
	   (a) No overlap. (b) Predicted vertex inside existing triangle. (c) Existing triangle inside predicted triangle. (d) Triangle edge overlap. (e) No overlap, but close vertical proximity of triangles. (f) No overlap, but close proximity of vertices
	   }
	   \label{fig:overlap}
\end{figure}
In order to decide whether two triangles overlap, we distinguish between several scenarios illustrated in Figure~\ref{fig:overlap}.
For the most frequent case \ref{fig:overlap_nope} where no overlap occurs, the prediction is not replaced.
Case~\ref{fig:overlap_trivial} handles
geometric intersections between
the predicted vertex and the existing triangle, while \ref{fig:overlap_covering} addresses the case where an existing triangle is completely contained in the prospective new triangle.
In both cases, the predicted vertex is projected onto the triangle plane followed by a simple inside-outside test.
Since vertex projection is not sufficient in all cases, we additionally perform edge intersection tests (\ref{fig:overlap_edge_intersection}) and compare the vertical distance between triangle planes (\ref{fig:overlap_parallel}).
Finally, we consider vertices in close proximity to the prediction to be overlapping, as shown in Figure~\ref{fig:overlap_near_clip}.
Please refer to the supplementary material for more details.

\subsection{Vertex Prediction}

\begin{figure}[tb]
    \captionsetup[subfigure]{aboveskip=1pt,belowskip=-5pt}
	\centering
	\begin{subfigure}[t]{0.19\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_a_default_prediction.pdf}
		\caption{}
		\label{fig:face_insertion_default}
	\end{subfigure}
	\begin{subfigure}[t]{0.19\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_b_v_d_edge_rotation.pdf}
		\caption{}
		\label{fig:face_insertion_boundary_edge_rot}
	\end{subfigure}
	\begin{subfigure}[t]{0.19\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_c_v_d_length_manipulation.pdf}
		\caption{}
		\label{fig:face_insertion_lenth_scaling}
	\end{subfigure}
	\begin{subfigure}[t]{0.19\linewidth}
	    \centering
	    %
        \includegraphics[width=1.0\linewidth, clip,trim={0em 0em 19em 0em}]{fig_feature_vector.pdf}
        \caption{}
        \label{fig:feature_vector_a}
    \end{subfigure}
    \begin{subfigure}[t]{0.19\linewidth}
	    \centering
	    %
        \includegraphics[width=1.0\linewidth, clip,trim={18em 0em 0em 0em}]{fig_feature_vector.pdf}
        \caption{}
        \label{fig:feature_vector_b}
    \end{subfigure}
        \caption{\textbf{Vertex prediction and Feature embedding.} In order to predict vertex $\Xpredvert$, we parameterize the prediction with 2 of the available 3 degrees of freedom, \ie, the angle $\Xpreder$ around the boundary edge (b) and the height $\Xpredls$ of the prospective triangle (c). Note that we omit the angle around the face normal of the triangle adjacent to the boundary edge (green) for practical reasons. By default, the predictor returns the default vector $\Xdvec$, extending the surface along the same plane as defined by the boundary edge and the corresponding triangle, shown in (a).
        Input to the predictor is a $22$-dimensional feature vector conditioned on the given boundary edge (d+e).
        It contains the SDF values, the gradients of the SDF values and the curvature predictions from our modified implicit representation $\XNIP$ at the three vertices of the default triangle, \ie, boundary edge end points $\Xbestart$ and $\Xbeend$, and
        the vertex at the default location $\Xdvec$. Best viewed digitally
	   }
	   \label{fig:face_insertion_manipulation}
\end{figure}

We introduce a novel \textit{vertex prediction module} which takes a boundary edge and a feature vector as input and predicts the location of the next vertex based on local geometry information.
The output of the predictor is a 2-dimensional vector $\Xpred =
\begin{bmatrix}
\Xpredls & \Xpreder %
\end{bmatrix}$.
As demonstrated in Figure~\ref{fig:face_insertion_manipulation}, both target a separate degree of freedom for
transforming the default prediction $\Xdvec$ at the center of the boundary edge $\Xbecent$.
Note that we define $\Xdvec$ such that it is orthogonal to the boundary edge and the face normal $\Xfnormal$ and incidentally defines the height of the predicted triangle.
The first component denotes the \textit{boundary edge rotation},
\ie the angle $\Xpreder \in \left[-\frac{\pi}{2}, \frac{\pi}{2} \right] $ defining the rotation around the boundary edge (Figure~\ref{fig:face_insertion_boundary_edge_rot}).
The \textit{length scaling} factor $\Xpredls \in \left[-1,1\right]$ scales the length of the default vector $\Xdvec$.
Negative values decrease the vector length whereas positive values increase its length.
Note that we intentionally only predict two out of 3 DoF,
\ie, we omit the rotation around the face normal $\Xfnormal$ belonging to the face of the boundary edge,
since we
found no performance improvement in incorporating the \nth{3} DoF.

\boldparagraph{Feature Embedding.}
To effectively predict accurate vertex locations, we provide the predictor with a feature embedding containing information about the local geometry.
Figure~\ref{fig:feature_vector_b} depicts the used feature vector.
We consider the 3 points defined by the default triangle, \ie, the vertex at the default location $\Xdvec$ and the two boundary edge end points, $\Xbestart$ and $\Xbeend$.
For each of these 3 points, we query the implicit representation $\XNIP$ for SDF values ($\XbeSDFc$, $\XbeSDFs$ and $\XbeSDFe$), SDF gradients or normals ($\XbeGradc$, $\XbeGrads$ and $\XbeGrade$) and directional curvature values ($\XbeCurvc$, $\XbeCurvs$ and $\XbeCurve$) (Figure~\ref{fig:feature_vector_a}).
In practice, we use multiple directional curvature queries for each query point.
Additionally, we feed the length of the boundary edge $e_{\text{length}} = \norm{\Xbestart - \Xbeend}_{2}$ into the feature vector.
Note that the feature embedding can be made invariant to rotation and translation. Prior to inference, we therefore transform the normals into a local coordinate system with the boundary edge center $\Xbecent$ as its origin.
The network predictions can be readily applied within the world coordinate system to obtain the new vertex $\Xpredvert$.
In order to reduce prediction errors, we apply surface projection once as a post-processing step in the same way as performed during the initialization phase.

\boldparagraph{Loss Functions.}
We introduce a surface distance loss $\Xlosssd=\abs{\Xpredsdf}$, in order to penalize any deviation from the zero value for the SDF $\Xpredsdf$ of the predicted vertex $\Xpredvert$.
To encourage the network to predict triangles with default size $\Xrd$, we additionally define a length regularization loss $\Xlossreg=\abs{ \Xpredls }$ which prevents prediction of degenerate triangles close to the boundary edge and competes with the surface distance loss.
Based on the surface mapping procedure, applied as a post-processing step, we can compute the ground truth turning angle $\Xgtangle$, located at the boundary edge.
Therefore, the boundary edge rotation loss $\Xlossbe= \abs{\Xpreder - \Xgtangle}$ encourages the network to predict vertices close to the surface and penalize the predicted boundary angle $\Xpreder$.
The final loss then consists of a weighted sum of those loss terms, \ie,
$
\Xloss_{\text{Total}} = \Xlosswsd  \Xlosssd + \Xlosswbe  \Xlossbe + \Xlosswreg  \Xlossreg.
$

\section{Evaluation}
\label{sec:evaluation}
For the experiments, we use a subset of the D-Faust~\cite{bogo_dynamic_2017} dataset, containing high-resolution scans of humans in different poses and corresponding triangle meshes, which we use as ground truth (GT) reference.
We train, validate and test on 512, 64 and 32 poses respectively,
sampled randomly from the subset used in IGR~\cite{gropp_implicit_2020}.
To further evaluate our capability of dealing with sharp corners and edges, we evaluate on a selected subset of shapes, belonging to the \textit{file cabinet} category of the ShapeNet~\cite{chang_shapenet_2015} dataset.
We use 147 models for training, 32 for validation and 32 for testing and preprocess the models with ManifoldPlus~\cite{huang2020manifoldplus}.

\subsection{Reconstruction Quality}
\input{tab_chamfer_distances}
\boldparagraph{Reconstruction Error.}
We evaluate the reconstruction error of the produced triangle meshes with the Chamfer-L1 distance
in Table~\ref{tab:eval_chamfer_distances}.
The Chamfer distance is reported in two directions, \ie, from the prediction to the ground truth and the implicit representation, respectively, and vice versa.
We report both, the distance to the ground truth mesh and the distance to the respective implicit representation, since there is a discrepancy between both, introducing an additional error in the reported numbers.
We compare our method to the SotA method PointTriNet~\cite{sharp_pointtrinet_2020}, however, since PointTriNet directly operates on point clouds sampled from the ground truth mesh, the reported error appears lower than methods working directly on implicit representations.
We therefore evaluate PointTriNet on both, points sampled on the ground truth mesh, and points generated from the implicit representation by first sampling surface points on the ground truth mesh and projecting them to the zero level set of the implicit representation.
We further compare our method to a version of marching cubes~\cite{lewiner_efficient_2003} implemented by scikit-image~\cite{scikit-image}, which we evaluate on three different resolutions.
In the same manner, we evaluate our method for three different triangle sizes $\Xrd$.
Finally, we compare to PSR~\cite{kazhdan_poisson_2006} from Open3D (depth=$10$), and DSE~\cite{rakotosaona_learning_2021}, with the author-provided model.
On the highest resolution, our method outperforms all baselines, when measured on the implicit representation, while yielding comparable results on the medium resolution.
Compared to marching cubes, our method improves on every comparable level of resolution.
For evaluations on the ground truth mesh, NeuralMeshing{} also outperforms marching cubes.
PointTriNet evaluated on the ground truth sampled points shows comparatively better numbers, which is expected because of the error introduced by the underlying implicit representation.

\boldparagraph{Reconstruction Accuracy and Completeness.}
\input{tab_f1_score_both_all}
We report further quantitative results in Table~\ref{tab:results_all_f1score_both}.
Specifically, we report the accuracy, completeness and the F-score for 3 different inlier thresholds, evaluated on both implicit surface representation and ground truth mesh.
The accuracy is computed as the ratio of inlier points, \ie sampled points on the predicted mesh which are within inlier distance of the ground truth mesh, and total number of sampled points.
The completeness is computed similarly in the opposite direction.
Our method again outperforms marching cubes on implicit surface evaluations while PointTriNet performs better when evaluated on the ground truth mesh, presumably because of reconstruction errors inherent in the implicit surface representation.

\boldparagraph{Qualitative Results.}
\begin{figure}[tb]
    \includegraphics[width=1.\linewidth, clip,trim={0em 0em 0em 0em}]{fig_qualitative.png}
    \caption{\textbf{Qualitative results.} Result meshes of various baselines from a single sample. The level of detail reconstructed on the face heavily depends on the resolution and method. IGR artifacts were manually removed. Best viewed digitally}
    \label{fig:meshes_2571}
\end{figure}
Figure~\ref{fig:meshes_2571} shows the meshes of all methods on one example.
NeuralMeshing{} yields well behaved triangle meshes with regularly shaped and sized triangles, reconstructing high-level details in accordance to the chosen triangle size $\Xrd$.
While marching cubes on comparable resolution levels reconstructs a similar level of detail, their generated triangle sizes cannot become bigger than the underlying voxel size.
PointTriNet reconstructs the full shape with some level of detail but introduces many visible holes and overlapping faces.

\subsection{Triangle Mesh Properties}
In this section, we evaluate several mesh properties and triangle metrics.
\boldparagraph{Mesh Metrics.}
\input{tab_mesh_sizes}%
To demonstrate the capability of producing detail-preserving, low-memory triangle meshes, we report typical mesh metrics in Table~\ref{tab:mesh_sizes}, \ie, number of triangles, number of vertices and the average triangle area.
We also list the inference time for speed comparisons.
Our method produces less but bigger triangles than marching cubes for comparable levels of detail.

\boldparagraph{Distribution of Face Area, Triangle Angles and Holes.}
\begin{figure}[tb]
	\centering
    \captionsetup[subfigure]{aboveskip=0pt,belowskip=-10pt}
	\begin{subfigure}[t]{0.32\linewidth}
        \centering
		\includegraphics[width=\linewidth]{fig_angle_dist.png}
		\caption{}
		\label{fig:eval_angle_histogram}
	\end{subfigure}
	\begin{subfigure}[t]{0.32\linewidth}
		\centering
        \includegraphics[width=\linewidth]{fig_area_dist.png}
		\caption{}
        \label{fig:eval_area_histogram}
	\end{subfigure}
	\begin{subfigure}[t]{0.32\linewidth}
		\centering
        \includegraphics[width=\linewidth]{fig_hole_distribution.png}
		\caption{}
        \label{fig:hole_dist}
	\end{subfigure}
	\caption{\textbf{Distribution analysis.} We compare the distribution of triangle angles in radians (a), triangle areas (b) and average number of holes (c) between our method, PointTriNet~\cite{sharp_pointtrinet_2020} and marching cubes~\cite{lewiner_efficient_2003}
	on the D-Faust~\cite{bogo_dynamic_2017} dataset
	}
\end{figure}
To demonstrate the regularity of the generated faces, Figure~\ref{fig:eval_angle_histogram} shows the angle distribution observed in generated meshes of each method.
Compared to marching cubes and PointTriNet,
our method produces triangle angles closer to the equilateral triangle, containing very few triangles with tiny angles.
Figure~\ref{fig:eval_area_histogram} provides similar insights by comparing the triangle area distribution.
It can be observed that our method produces more similarly sized faces while still allowing some variation in order to adapt to more complex surface patches.
In Figure~\ref{fig:hole_dist}, we plot the number of holes vs. the hole size and compare it with both baselines, illustrating that the vast majority of holes produced by NeuralMeshing{} are very small.
We refer to the supplementary material for more quantitative metrics and ablation studies.

\boldparagraph{Limitations.}
NeuralMeshing{} does not guarantee watertightness, but typically produces meshes with fewer holes than comparable methods.
Sharp edges are sometimes problematic which we attribute to the performance of the prediction network.
Like marching cubes, NeuralMeshing{} does not provide a manifoldness guarantee.
However, our mesh growing strategy can effectively avoid the insertion of non-manifold edges, while marching cubes requires expensive post-processing.

\section{Conclusion}
\label{sec:conclusion}

We introduced NeuralMeshing{}, a novel meshing algorithm for neural implicit representations.
We exploit curvature information learned as part of the neural implicit representation in order to guide the predictions of new triangles.
Our iterative, curvature-based processing of boundary edges allows us to generate triangle sizes in accordance to the underlying curvature, yielding preferable mesh properties.
Experiments demonstrate that NeuralMeshing{} outperforms existing meshing algorithms,
producing meshes with lower triangle counts.

\section{Details on Overlap Checks}
\label{sec:overlap_details}
The size of the triangles inserted into the mesh is controlled by the circumradius $\Xrd$ of the default triangle while the height of a triangle is upper bounded by two times the height of the default triangle.
It is therefore sufficient to apply the overlap check only on a local subset of nearby mesh faces.
For a triangle candidate $f_c$, we define this set of relevant local faces as
\begin{equation}
	F_{f_c} = \{f \in F \ \lvert \  d(f, c(f_c)) \leq 2  \Xrd  \},
\end{equation}
where $c(f_c)$ is the centroid of the triangle and $d(f, c(f_c))$ denotes the smallest euclidean distance among the face vertices in $f$ and the triangle center of $f_c$.
$F_{f_c}$ can be efficiently constructed by first collecting all relevant vertices through a radius search on the centroid $c(f_c)$ with radius $2\Xrd$ using the vertex k-d-tree.
The half-edge data structure allows us to access all the triangles involved with these vertices.

\boldparagraph{Vertex Proximity Test.}
Vertex insertions very close to existing vertices are undesirable (Figure~4f) since it requires the insertion of very small faces at subsequent prediction steps.
We therefore consider triangle candidates close to an existing triangle as overlapping.
The threshold  $t_v = \frac{\Xrd}{2}$ is applied along the axis defined by the face normal and on the distance to the triangle edges on the triangle plane.
More formally, we define the test for whether point $\Xp$ overlaps with triangle $f$ as
\begin{equation}
\begin{aligned}
	\text{PIT}(\Xp, f)=\  d_{\text{vertical}} < t_{\text{near}}\quad \wedge
	\min \{\Xsdf_{e_0}, \Xsdf_{e_1}, \Xsdf_{e_2} \} >- t_{\text{near}}
\end{aligned}
\end{equation}
where $d_{\text{vertical}}$ is the smallest distance between $\Xp$ and the triangle plane and $\Xsdf_e$ denotes the signed distance of $\Xp$ projected onto the triangle plane, to the lines defined by the triangle edges. Note that these values are positive if the point lies on the same site of the line as the triangle and negative otherwise.

\boldparagraph{Segment Intersection Test.}
Consider two edges $e_1$ and $e_2$, both belonging to different triangles.
Let $\Xv_{e_1,\text{a}}$ and $\Xv_{e_1,\text{b}}$ denote the vertices of $e_1$ and $\Xv_{e_2,\text{a}}$ and $\Xv_{e_2,\text{b}}$ denote the vertices belonging to $e_2$.
Furthermore, let $\Xp_1$ and $\Xp_2$ be the points on edge $e_1$ and edge $e_2$, respectively, belonging to the shortest line segment which connects these two
lines.
The points can be expressed as
\begin{equation}
\begin{aligned}
    \Xp_1&= \Xv_{e_1,\text{a}} + d_1 (\Xv_{e_1,\text{b}}-\Xv_{e_1,\text{a}})\\
    \Xp_2&= \Xv_{e_2,\text{a}} + d_2 (\Xv_{e_2,\text{b}}-\Xv_{e_2,\text{a}}),
\end{aligned}
\label{eq:segment_points}
\end{equation}
with $\Xp_1$ and $\Xp_2$ being on the triangle edge if $d_1 \in [0,1]$ and $d_2 \in [0,1]$, respectively.
Therefore, we consider two edges intersecting, if the two points $\Xp_1$ and $\Xp_2$ are located on the respective edges and the euclidean distance between the points is within a defined threshold, \ie $d_1, d_2 \in [0, 1]$ and $\norm{\Xp_2 - \Xp_1} \leq t_{\text{near}}$.

To compute the scalars $d_1$ and $d_2$, we make use of the constraint that the line segment is perpendicular to the edges. Hence, the dot product must be zero, \ie $(\Xv_{e_i,\text{b}}-\Xv_{e_i,\text{a}})^{\top} (\Xp_2-\Xp_1) =0$ for $i \in \{0,1\}$. By rewriting the vector $\Xp_2-\Xp_1$ with Eq.~\ref{eq:segment_points}, we are able to solve for the scalars $d_1$ and $d_2$.

\boldparagraph{Existing Vertex Selection.}
If one of the above tests indicates that the predicted vertex overlaps with existing triangles, the predicted vertex is replaced with an existing vertex $v_A$.
Only vertices returned from the radius search used to build the triangle set $F_{f_c}$ (Sec.~\ref{sec:overlap_details}) are considered as candidates.
Among the available candidate vertices, we choose the candidate with the smallest euclidean distance to the center of the boundary edge, provided the triangle defined by the vertex candidate does not overlap with the existing mesh.
We therefore perform an additional overlap check for all candidate vertices.
Note that vertex proximity test must not be applied to faces containing the vertex candidate, since the two faces always intersect at the vertex candidate.

\section{Curvature Head Details}
\label{sec:curvature_head_details}
\begin{figure}[t]
    \includegraphics[width=1.0\linewidth]{fig_curvature_head.pdf}
    \caption{\textbf{Curvature head architecture.} The curvature head consists of 3 fully connected layers with ReLU activation functions. We attach the curvature head at the layer after the skip connection of the original IGR decoder. The directional curvature query is only provided to the curvature head
    }
    \label{fig:net_curvature_head}
\end{figure}
As shown in Figure~\ref{fig:net_curvature_head}, we attach the curvature head at the layer after the skip connection.
The head consists of three fully connected layers of width 512 with ReLU activations,
except for the output layer where we use tanh as the activation function.
The directional curvature query $\Xqdir$ is exclusively provided to the curvature head and doesn't get used for standard SDF queries.
The decoupled curvature head allows us to use pretrained decoder weights from models trained without a curvature head.
During training, the query direction $\Xqdir$ is randomly sampled on the tangential plane of each query point, defined by the surface normal.

\section{Vertex Prediction Details}
\label{sec:vertex_predictor_details}
\boldparagraph{Architecture.}
\begin{figure}[t]
    \includegraphics[width=1.0\linewidth]{fig_vp_mlp.pdf}
    \caption{\textbf{Vertex prediction architecture.} The MLP for the vertex prediction module consists of 5 fully connected layers with ReLU activation functions.
    The angular value in the result vector is scaled by $\frac{\pi}{2}$
    }
    \label{fig:net_vp_mlp}
\end{figure}
The MLP in the vertex prediction module, shown in Figure \ref{fig:net_vp_mlp}, consists of five fully connected layers of width 512. We use ReLU as activation function and tanh for the output layer.
The angular value in the result vector is scaled by $\frac{\pi}{2}$.
\boldparagraph{Training.}
We use the Adam optimizer~\cite{kingma_adam_2015} with an initial learning rate of $0.001$
without any learning rate scheduling.
The MLP is trained iteratively with new batches (of 32 shapes) of triangle insertions.
Each shape is initialized with 1024 initialization triangles.
A training step consists of a mini batch containing 512 boundary edges per shape.
For every batch of 32 shapes, 50 training steps are computed.
Currently, we train a model for every mesh resolution, defined by $\Xrd$.

\section{Data Preprocessing}
\label{sec:data_preprocessing}
\boldparagraph{Data Normalization.}
We normalize meshes and point clouds by centering them to the mean and scaling them to the unit cube, \ie to $[-1,1]$ for every dimension.
We perform this normalization for the training of the modified implicit representation and for all evaluations.

\boldparagraph{Artifact Removal.}
\begin{figure}[t]
    \includegraphics[width=1.0\linewidth]{fig_artefacts_colorized.png}
    \caption{\textbf{Artifacts of implicit representations.} The original scan contains the human only (green). IGR introduces artifacts such as volumetric objects (red) around the body and a curtain in front of the person (blue). For evaluations, we remove such artifacts}
    \label{fig:igr_artefacts}
\end{figure}
The implicit neural representation (IGR) used by marching cubes and our method introduces several shape artifacts.
An example of such artifacts is visualized in Figure \ref{fig:igr_artefacts}.
Furthermore, as the implicit representation is an approximation of the ground-truth mesh, it might differ slightly in some surface areas, smoothing sharp features or providing explanations for parts of the shape where no input data was provided.
In order to compare our method with approaches which do not use an implicit representation, \eg PointTriNet~\cite{sharp_pointtrinet_2020}, we remove such artifacts automatically.
The removal process first discards all triangles in the lowest five percent of the bounding box,
\ie we cut of the feet of humans in the DFaust dataset since the artifacts often are connected with the scans through the ground and the feet.
We then split the mesh into connected components and keep only the component closest to the center of the bounding box. The distance from a mesh component to the center of the bounding box is computed by measuring the euclidean distance between the center of the bounding box and the mean of all mesh-vertices.

\section{More Quantitative Results}
\label{sec:quantitative_results}
\boldparagraph{Impact of Inlier Threshold on F1-score.}
\begin{figure}[t]
	\centering
    \captionsetup[subfigure]{aboveskip=-4pt,belowskip=-10pt}
	\begin{subfigure}[t]{0.49\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_implicit_representation.png}
		\caption{}
		\label{fig:f1plot_igr}
	\end{subfigure}
	\begin{subfigure}[t]{0.49\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_f1_scores_plot.png}
		\caption{}
		\label{fig:f1plot_gt}
	\end{subfigure}
	\caption{\textbf{Impact of the inlier threshold on the F1-score.} (a) F1-score of the generated meshes measured on the implicit representation. (b) F1-score of the generated meshes measured on the ground-truth meshes}
	\label{fig:f1plots}
\end{figure}
To provide a better picture on the impact of the threshold on the F1-score,
Figure~\ref{fig:f1plots} visualizes the change of the F1-score with growing $t_{\text{inlier}}$.
Compared to marching cubes, our method achieves a better F1 score for similar resolutions with tight inlier thresholds.
PointTriNet meshes are closer to the ground truth mesh, which we attribute to the artifacts and differences in the implicit representation.

\boldparagraph{Normal Consistency.}
\input{tab_normal_consistency}
To further evaluate the consistency of the orientation of the generated faces, we employ the normal consistency metric (NC).
The corresponding results are reported in Table~\ref{tab:results_dfaust_nc}.
The quality of the face orientation are within the same range for marching cubes and our method when evaluated on the implicit representation.

\boldparagraph{Interaction with Implicit Representation.}
\input{tab_num_sdf_queries}
Marching cubes and NeuralMeshing{} rely on querying the underlying implicit representation.
In Table~\ref{tab:eval_num_sdf_queries} we report the average number of queries performed in the evaluated meshing procedures on the D-Faust dataset.
We can observe that the extensive querying performed by our algorithm is cheaper than the grid-based queries employed by marching cubes.

\section{More Qualitative Results}
\label{sec:more_qualitative_results}
\begin{figure}[t]
\centering
    \includegraphics[width=0.95\linewidth]{fig_qualitative_more.pdf}
    \caption{\textbf{More qualitative results on D-Faust.} We show 2 subjects in 2 different poses, respectively, and compare our version with $\Xrd=0.005$ with marching cubes~\cite{lewiner_efficient_2003} at $512$ resolution and PointTriNet~\cite{sharp_pointtrinet_2020}
    }
    \label{fig:more_qualitative}
\end{figure}
\begin{figure}[t]
\centering
    \includegraphics[width=0.95\linewidth]{fig_qualitative_more2.pdf}
    \caption{\textbf{More qualitative results on D-Faust.} We show 4 subjects in different poses, respectively, and compare our version with $\Xrd=0.005$ with marching cubes~\cite{lewiner_efficient_2003} at $512$ resolution and PointTriNet~\cite{sharp_pointtrinet_2020}
    }
    \label{fig:more_qualitative_2}
\end{figure}
In Figure~\ref{fig:more_qualitative} and Figure~\ref{fig:more_qualitative_2}, we provide additional qualitative results.
We can observe that our meshes are more complete than those from PointTriNet, while still providing the same level of detail as marching cubes.

\section{Ablation Study}
\label{sec:ablation_results}
\input{tab_ablation_distances}
To understand the impact of different elements of our meshing algorithm on the reconstruction quality, we perform an ablation study and report the results in Table~\ref{tab:ablation_chamfer_distances}.
For a given triangle size of $\Xrd=0.005$, we retrain the \textit{vertex predictor} with different components disabled, while using a similar experiment setup as before.
We run all ablations with a disabled surface projection post-processing step, as it otherwise skews the results, as differences between the ablations get tiny.
For the \textit{no length scaling} experiment, we use the default triangle size $\Xrd$ instead of the predicted length, while for the \textit{no edge rotation} experiment, we use a predicted angle of zero, corresponding to an extension of the mesh along the plane defined by the existing triangle adjacent to the boundary edge.
For the \textit{no prediction} experiment, we do not use either prediction.
The next 4 experiments test the effectiveness of each embedded feature.
We alternatingly either omit the features at the default vertex (\textit{no $p$-queries}) or at the boundary edge end points (\textit{$p$-queries only}), use only 1 directional curvature feature queries instead of the original 3 (\textit{$1$ direction}) or use no curvature features at all (\textit{no curvature}).

\section{Watertightness}
\label{sec:watertightness}
\input{tab_hole_eval}
We report the boundary edge to total edge ratio in Table~\ref{tab:eval_hole_metrics} as a metric for watertightness.
Since some shapes intersect the bounding box, marching cubes also introduces boundary edges at these locations.
NeuralMeshing{} exhibits fewer and smaller holes than PointTriNet while marching cubes does not generate any.

\section{Limitations}
\label{sec:limitations}
\boldparagraph{Sharp features}
\begin{figure}[t]
	\centering
    \includegraphics[width=1.0\linewidth]{fig_sharp_features_shapenet.pdf}
    \caption{\textbf{Sharp features.} NeuralMeshing{} naturally extends to sharp edges and corners but smooths them due to the smoothing effects of the underlying implicit representation. Example belongs to the ShapeNet dataset
    }
    \label{fig:sharp_edges}
\end{figure}
The subset of the ShapeNet dataset used for evaluation contains features such as corners and sharp edges. NeuralMeshing{} naturally extends to sharp edges and corners, as visible in Figure~\ref{fig:sharp_edges}.
However, due to the limited information provided to the \textit{vertex prediction module} and the smoothing effects of the underlying implicit representation, the meshing procedure reconstructs smoother corners and can lead to irregularities along sharp edges.

\boldparagraph{Holes.}
Holes occur mostly at surface locations with high curvature, illustrated in Figure~\ref{fig:failure_ear}, \ref{fig:failure_hand} and \ref{fig:failure_schritt}.
In such cases, the edge rotation prediction does not bend the triangle sufficiently towards the
real surface, leading to a scenario where no existing vertices are found, and the mesh therefore remains unclosed.
Holes in flat surfaces can occur, but are rare and almost unnoticeable, as shown Figure \ref{fig:failure_thin}.
\begin{figure}[t]
	\centering
	\begin{subfigure}[t]{0.49\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_failure_cases_ear.png}
		\caption{}
		\label{fig:failure_ear}
	\end{subfigure}
	\hfill
	\begin{subfigure}[t]{0.49\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_failure_cases_hand.png}
		\caption{}
		\label{fig:failure_hand}
	\end{subfigure}
	\newline
	\begin{subfigure}[t]{0.49\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_failure_cases_schritt.png}
		\caption{}
		\label{fig:failure_schritt}
	\end{subfigure}
	\hfill
	\begin{subfigure}[t]{0.49\linewidth}
		\centering
		\includegraphics[width=\linewidth]{fig_failure_cases_flat.png}
		\caption{}
		\label{fig:failure_thin}
	\end{subfigure}
	   \caption{\textbf{Holes.} NeuralMeshing{} does not guarantee watertightness and
	   therefore, holes may occur
	   %
	   %
	   on very complex surfaces such as ears (a), nearly parallel surface patches (b) or in places with large differences in orientation (c). Flat surfaces can lead to barely noticeable holes (d).
	   Green edges indicate boundary edges}
	   \label{fig:failure_cases}
\end{figure}

\boldparagraph{Supervision.}
The current method requires an explicit mesh for computation of the supervision signal of the curvature head.
Future work would address this by incorporating self-supervision in order to preserve training on raw scans only.

\boldparagraph{Initialization Triangles.}
A single initialization triangle is sufficient for reconstructing a single connected component, but will fail for shapes containing multiple disconnected surface components.
The procedure must therefore sample enough points in order to catch all surface components with high probability. Such cases can easily be reduced by using the grid points of an initialisation grid instead of random points in space.

Furthermore, initialization triangles placed on a surface region with high curvature might
introduce inaccurate faces in the mesh. Future work could improve upon this by adapting the size of the initialization triangle to the curvature.