Skip to content

Missing tetrahedra near feature corners in CGAL 3D mesh generation #9338

Description

@rokgm

Issue Details

Unexpected behavior

Image

I am generating a 3D volume mesh from a surface mesh using:

MeshCriteria(
    CGAL::parameters::facet_size(longestSurfaceEdge)
      .cell_size(longestSurfaceEdge)
      .facet_distance(facetDistance)
      .edge_min_size(0.1 * minTubeLength)
      .edge_size(longestSurfaceEdge)
      .cell_radius_edge_ratio(2)
      .facet_angle(30)
  );
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using MeshDomain = CGAL::Polyhedral_mesh_domain_with_features_3<Kernel>;
MeshDomain domain(surface);
domain.add_features(<"the red polylines seen below">);

C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(
    domain, criteria, CGAL::parameters::no_exude().no_perturb());

At feature corners circled above, you can see the missing cells.

Here is the surface mesh, which bounds the domain, with feature polylines, colored in red:

Image

Here you can see the polylines (the ones colored red above). They are constructed from edges of the surface mesh which bounds the domain. Each corner of the polyline is red, while the blue vertices are the intermediate points of the polyline:

Image

Observations

  • Removing edge_min_size parameter does not fix the issue, just makes the missing cells smaller.

  • domain.add_corners() function causes exactly the same problem.

  • I also tried removing polylines that are close to the domain surface (the ones that form the hexagon, on the tube border were not removed), which fixed the problem. The problem then is that, I do not preserve the features that I need.

  • Different facet_topology criteria parameters, produce the same results.

  • I tried adding some polylines, around the corners, on the patch where the cells are missing, in an effort to shrink down the protecting balls. It did not work well.

Hypothesis

My understanding why the problem exists is, because the protecting balls (placed on polyline vertices) are interfering with the surface, where the cells are missing.

Because the domain surface around the two missing cells is not perpendicular to the polylines that are inside the tube, the protecting balls overlaps with the domain surface, which causes problems.

You can see in other corners where the surface is more or less perpendicular to the polylines inside the tube, there is no problem.

Questions

  1. How could the missing cells be fixed?
  2. Is there a better way to preserve features without creating this issue?

Environment

  • Operating system: Linux 64 bit
  • Compiler: g++ (GCC) 14.2.0
  • Release or debug mode: Debug
  • Specific flags used: CGAL::Sequential_tag (for CGAL::Mesh_triangulation_3<>), -DCGAL_DISABLE_GMP=1
  • CGAL version: 6.1
  • Boost version: 1.89.0
  • Other libraries versions if used (Eigen, TBB, etc.): /

Activity

  1. sloriot commented on Feb 25, 2026

    @sloriot
    Member

    Can you try

    C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,CGAL::parameters::manifold().no_exude().no_perturb());
  2. rokgm commented on Feb 25, 2026

    @rokgm
    Author

    The function parameters::manifold() is used to drive the meshing algorithm for surfaces.
    It ensures that the surface of the output mesh is a manifold surface without boundaries. The manifold property of the output mesh can be achieved only if the input surface is a manifold. Note that the meshing algorithm provably terminates only if the input sharp edges have been protected, using the feature protection (see Protection of 0 and 1-dimensional Exposed Features).

    The domain surface mesh is a manifold. But, I cannot yet get the meshing to terminate, if I specify the manifold parameter. I suspect it is because of the sharp edges in other parts of the domain, like this narrow spike:

    Image The sharp edges of the domain are protected with polylines (45 degree angle between normals), but it still doesn't work.
  3. added theissue type on Feb 25, 2026
  4. added this to the 6.1.2 milestone on Feb 25, 2026
  5. sloriot commented on Feb 25, 2026

    @sloriot
    Member

    You should indeed try without edge_min_size()

  6. rokgm commented on Feb 26, 2026

    @rokgm
    Author

    Without edge_min_size() the spike looks like this (also no facet_angle() and cell_radius_edge_ratio(), this should help meshing the spike):

    Image
    MeshCriteria(CGAL::parameters::facet_size(longestSurfaceEdge)
            .cell_size(longestSurfaceEdge)
            .facet_distance(0.005 * longestSurfaceEdge)
            .edge_size(longestSurfaceEdge)
        );
    
    Image

    If I additionaly specify .manifold() I get this error:

    CGAL ERROR: assertion violation!
    File: CGAL-6.1/include/CGAL/Mesh_3/Refine_facets_3.h
    Line: 881
    Explanation: (-10.069859440638886 -14.284545081491338 135.65578021991388 0) is already inserted on surface.
    

    the point (circled red dot below) with this coordinates lies here in the domain surface mesh. It is not on any edge or vertex:

    Image
  7. sloriot commented on Feb 26, 2026

    @sloriot
    Member

    You shouldn't get issue with the spike. Do you have self-intersections in the input?

    Maybe you can share a minimal reproducible example?

  8. rokgm commented on Mar 17, 2026

    @rokgm
    Author

    Unfortunately, I can’t share the original input mesh because it contains proprietary information.
    I’ll see whether I can create an anonymized reproducible example that still triggers the same issue.

  9. anjanikumari12 commented on Mar 25, 2026

    @anjanikumari12
  10. modified the milestones: 6.1.2, 6.1.3 on Jun 10, 2026
  11. modified the milestones: 6.1.3, 6.1.4 on Sep 4, 2026
  12. janetournois commented on Nov 17, 2026

    @janetournois
    Member

    Hello @rokgm ,
    thanks for your report.
    The PR #9855 should fix this issue, provided you add the new facet_normals_variation(90) angle bound on neighbor facets normals.
    We would be happy to know if this PR solves this issue on your data.
    Best,

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions