Skip to content

GSoC 2025: Hexahedral Mesh Generation - #9045

Closed
hofwe wants to merge 124 commits into
CGAL:mainfrom
hofwe:gsoc2025-hexahedral_mesh_generation-syamazaki
Closed

GSoC 2025: Hexahedral Mesh Generation#9045
hofwe wants to merge 124 commits into
CGAL:mainfrom
hofwe:gsoc2025-hexahedral_mesh_generation-syamazaki

Conversation

@hofwe

@hofwe hofwe commented Aug 28, 2025

Copy link
Copy Markdown

Soichiro Yamazaki's GSoC 2025 Submission

Mentor: Guillaume Damiand

Implementation of the paper Owen et al. 2017

Release Management

  • Affected package(s): Linear cell complex

TODO

  • implement parallel version

theo97490 added 30 commits June 19, 2024 08:21
Working example for 1/2 template substitution
* Detection of "sandwiched" volumes (that share only a edge with the plane)
* Related: Traversal takes into account problematic 1/2 templates faces
* Repair impossible markings (wip)
* 3 templates outside of iteration plane are not refined
* Issue: I think 3 templates should be allowed outside of the plane, since we check for 3 templates validity only inside the plane
* Solution: Either a propagation issue ( keep older 1/2 templates propageable )  or else its a non issue and properly detect the 3 templates outside the plane.
* WIP Expansion of initial identified set, for additional level of refinement
* WIP Creation of new iteration plane for the next level.
=> Uses Union_find, to create connected components, for the algorithm to avoid iterating outside of the current level context
( Local rebase of 5 commits )

@afabri afabri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure if CGAL/hexmeshing/ is not too general.

////////////////////////////////////////////////////////////////////////////////
/*!
* \brief Copy marked darts from lcc1 to lcc2.
* BECAREFUL: depending on which darts are marked, can produce an invalid map!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use the doxygen command "\warning"

/*!
\ingroup PkgLinearCellComplexConstructions

generates a pure hexahedral mesh from a triangle mesh using the two refinement algorithm described in \cgalCite{cgal:owen2017template-based}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As the title of the publication is "A Template-Based Approach for Parallel Hexahedral Two-Refinement" the function could be called hexahedral_two_refinement().
And in a text there should be a - between "two" and "refinement".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The two refinement is actually applied on a "raw" hexmesh that is produced using voxeliaation. The function is a combination of both.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you want to say that there could be two functions, one turning a triangle mesh into a hex mesh, and a second one refining the obtained hex mesh?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The first step is "only" the creation of a regular grid.

\param tmesh a triangle mesh
\param cube_cells_per_dim number of grid cells, per dimension
\param nb_levels How many times to perform refinement
\param trim `true` to apply trimming, i.e.\ remove volumes that are entirely outside of the surface mesh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
\param trim `true` to apply trimming, i.e.\ remove volumes that are entirely outside of the surface mesh
\param trim `true` to apply trimming, i.e., remove volumes that are entirely outside of the surface mesh

namespace CGAL::internal::Hexmeshing
{
template<typename Tree>
bool is_intersect(double x1, double y1, double z1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is -> does

std::vector<Dart_descriptor> edges_to_subdivide;
LCC& lcc = hdata.lcc;

auto arrete_done = lcc.get_new_mark();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

french?

};

template<typename LCC>
bool import_from_moka(LCC& lcc, const char* filename)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mael had made a huge effort to unify IO, so it would be nice if this would become CGAL::IO::read_MOKA()`

Comment thread Linear_cell_complex/include/CGAL/Hexmeshing_render_results.h Outdated
Comment thread Linear_cell_complex/test/Linear_cell_complex/lcc_jacobian.h Outdated
{
// all volume cells need to have attribute
inline
int __get_signal(LCC& lcc, Dart_descriptor vertex, size_type inner_mark)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Functions should not start with underscores

@sloriot

sloriot commented Aug 25, 2026

Copy link
Copy Markdown
Member

/build:v1

@github-actions

Copy link
Copy Markdown

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/9045/v1/Manual/index.html

\param cube_cells_per_dim number of grid cells, per dimension
\param nb_levels How many times to perform refinement
\param trim `true` to apply trimming, i.e., remove volumes that are entirely outside of the surface mesh
\param smooth `true` to smooth the hexahedral mesh, using a 3D laplacian smoothing method

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
\param smooth `true` to smooth the hexahedral mesh, using a 3D laplacian smoothing method
\param smooth `true` to smooth the hexahedral mesh, using a 3D Laplacian smoothing method

@gdamiand

Copy link
Copy Markdown
Member

/build:v1

@github-actions

Copy link
Copy Markdown

There was an error while building the doc:

This round already exists. Overwrite it with /force-build.

https://github.com/CGAL/cgal/actions/runs/32842509651

@sloriot

sloriot commented Aug 25, 2026

Copy link
Copy Markdown
Member

Replaced by #9613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Check size Conflicts gsoc gsoc-2025 Not yet approved The feature or pull-request has not yet been approved. Small feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants