Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

News about Mesh_3 #43

Merged
merged 14 commits into from
Dec 16, 2024
121 changes: 121 additions & 0 deletions _posts/2024-12-01-mesh3-improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
layout: post
title: "Tetrahedral Mesh Generation improvements"
janetournois marked this conversation as resolved.
Show resolved Hide resolved
description: "Tetrahedral Mesh Generation improvements in CGAL-6.0.1"
category:
tags: [""]
---
{% include JB/setup %}

<h3><a href="https://geometryfactory.com/who-we-are/">Jane Tournois</a></h3>
<h4><a href="http://www.geometryfactory.com" target="_blank">GeometryFactory</a></h4>


<p>Introduced in CGAL 3.5, the package
<a href="https://doc.cgal.org/latest/Manual/packages.html#PkgMesh3" text="3D Mesh Generation">3D Mesh Generation</a>
is designed to generate a isotropic simplicial meshes discretizing 3D domains.
janetournois marked this conversation as resolved.
Show resolved Hide resolved
Since then, multiple improvements in mesh quality, performances, and versatility have been made available in CGAL.
janetournois marked this conversation as resolved.
Show resolved Hide resolved
Lately, CGAL authors have focused more on the quality of the output mesh, the ability of the
janetournois marked this conversation as resolved.
Show resolved Hide resolved
mesh generation algorithm to represent the input surface in a more accurate way, for a wider range of input data types.
janetournois marked this conversation as resolved.
Show resolved Hide resolved
</p>

<br>
<p>Recent releases of CGAL have introduced improvements to the 3D Tetrahedral Mesh Generation package:
detection and protection of triple lines from labeled images,
generation and use of weighted labeled images,
and a new approximation error criterion for polyline features.</p>


<br>
<h3>Triple lines from labeled images</h3>
janetournois marked this conversation as resolved.
Show resolved Hide resolved

<p>CGAL's tetrahedral mesh generation algorithm is able to compute tetrahedral meshes from 3D segmented images.
For all types of inputs, detection and construction of one-dimensional features must be done a priori for the
feature protection algorithm to be able to represent them properly in the generated mesh.
In 3D segmented images, such features correspond to the intersections of the bounding box of the image with the surfaces
defined by the image, as well as polylines that lie at the intersection of three or more subdomains (including the outside).</p>

<p>The article
<a href="https://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/274"><i>Hege, H. C., Seebass, M., Stalling, D., & Zöckler, M. (1997),
A generalized marching cubes algorithm based on non-binary classifications</i></a>, provides a list of possible voxel configurations.
This description has been generalized for tetrahedral mesh generation needs, and
implemented in CGAL.</p>

<p>After feature lines detection, similarly to what is done for polyhedral surfaces, the polyline features
are added to the feature graph of the domain for feature protection.</p>

<p>Two detection functors are provided :
<ul>
<li><i>CGAL::Detect_features_in_image()</i> detects and constructs all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other posts I saw .. being used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like CGAL::Detect_features_in_image(..) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code>...</code>

polylines lying at the intersection of three or more subdomains, and</li>
<li><i>CGAL::Detect_features_on_image_bbox()</i> detects and constructs the polylines
that lie at the intersection of two or more subdomains and the bounding box of the input labeled image.</li>
</ul>
</p>

<div style="text-align:center;">
<a href="../../../../images/mesh3_triple_lines_protection.png"><img src="../../../../images/mesh3_triple_lines_protection.png" style="max-width:80%"/></a><br>
<br><small>Mesh generation from labeled image without (left)
and with triple lines detection and protection (right).
The polylines lying at the intersection of three or more subdomains are
a lot more precise with a lot fewer vertices.</small>
</div>


<br>
<h3>Weighted Labeled Images</h3>

<p>When a segmented image is given as input for tetrahedral mesh generation,
the generated mesh surface sometimes sticks too closely to the voxels surface, causing an aliasing effect. A solution to generate
a smooth and accurate output surface was described by Stalling et al in
janetournois marked this conversation as resolved.
Show resolved Hide resolved
<a href="https://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/382"><i>Stalling, D., Zöckler, M., Sander, O., & Hege, H. C. (1998),
Weighted labels for 3D image segmentation</i></a>.
It consists in generating a second input image, made of integer coefficients called weights, and use those weights to define
smoother domain boundaries. The 3D image of weights can be generated by <i>CGAL::Mesh_3::generate_label_weights()</i>.</p>

<div style="text-align:center;">
<a href="../../../../images/mesh3_weighted_images.png"><img src="../../../../images/mesh3_weighted_images.png" style="max-width:100%"/></a><br>
<br><small>Mesh generation from labeled image without weights (left, 88,000 vertices)
and with weights (right, 67,000 vertices).</small>
</div>

<br>
<p>The following example shows how to use weighted labeled images: <a href="https://doc.cgal.org/6.0.1/Mesh_3/Mesh_3_2mesh_3D_weighted_image_8cpp-example.html">mesh_3D_weighted_image.cpp</a>.</p>

<p>Utilizing tetrahedral mesh generation from labeled images, incorporating both feature detection and weighted labels,
presents challenges. A new method that combines feature detection and weighted labels has been
designed and implemented in CGAL, achieving smooth and feature preserving output meshes.
This method leverages the best of these two new functionalities.</p>


<br>
<h3>Approximation Criterion on Feature Edges</h3>

<p>A Delaunay refinement algorithm is guided by meshing criteria that trigger Steiner vertices insertions,
until they are satisfied.
The list of CGAL meshing criteria has been enriched with a new criterion that enables the user to
define an upper bound on the distance between the input feature graph and the output feature edges.</p>

<p>The following example shows how to use this new criterion, called <i>edge_distance</i>:
<a href="https://doc.cgal.org/6.0.1/Mesh_3/Mesh_3_2mesh_polyhedral_domain_with_edge_distance_8cpp-example.html">
mesh_polyhedral_domain_with_edge_distance.cpp</a>.</p>

<div style="text-align:center;">
<a href="../../../../images/mesh3_edge_distance_stool.png"><img src="../../../../images/mesh3_edge_distance_stool.png" style="max-width:65%"/></a><br>
<br><small>Mesh generation from polyhedral surface with varying <i>edge_distance</i> meshing criterion.
The quality improvement is important on the lower end of stool feet.</small>
janetournois marked this conversation as resolved.
Show resolved Hide resolved
</div>


<h3>Status</h3>

<p>All these new improvements have been integrated in CGAL-6.0.1, which has just been officially released.</p>

<i class="bi bi-book"></i>
<a href="https://www.cgal.org/2024/10/22/cgal601/">CGAL-6.0.1 announcement</a>
<br>
<i class="bi bi-book"></i>
<a href="https://doc.cgal.org/latest/Manual/packages.html#PkgMesh3">Documentation of the Tetrahedral Mesh Generation package</a>
<br>
<i class="bi bi-arrow-down-circle"></i>
<a href="https://github.com/CGAL/cgal/tree/master">CGAL master branch on GitHub</a>
Binary file added images/mesh3_edge_distance_stool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mesh3_triple_lines_protection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mesh3_weighted_images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.