3D CAD Tria

30 views
Skip to first unread message

Silviu Predoiu

unread,
Jun 18, 2025, 2:59:00 PM6/18/25
to deal.II User Group
Hi all,

And I apologize in advance for posting a question that might break several of the "how to post a question" rules.

The Issue
I'm trying to use a .STEP file to load a 3D geometry that is a bit more complex - it has holes, for instance. I would like meshes to get closer to the original geometry, upon refinement. To this end, I tried a number of approaches (listed below), and eventually settled on using my own custom-made manifolds (more details below). Starting with a somewhat coarse grid, each of the original cells has its own manifold, and refinement produces points using transfinite interpolation. The problem is that the ChartManifold::pull_back is called with points that seem very far away from the manifold itself. I expected that if vertices v0, v1, v2, v3 were the corners of a quadrangle representing a face, pull_back would be called with a point that is not too far from the said quadrangle. Instead, I get this (which seems to sugest that perhaps pull_back is called on the wrong manifold; below, the point is the argument of pull_back, while the colored curves are the 4 lines bounding the quadrangle):
Figure_1.png
Does anyone know what kind of points ChartManifold<3, 3, i>::pull_back is supposed to handle? (i = 1, 2, and 3).  

What I Tried
I looked at step-54 (and the source code/header of opencascade/manifold_lib and related utilities), and step-65 (transfinite interpolation). I wasn't able to use the NormalToMeshProjection since some of the holes are cylinder shaped, and an error was raised when computing the normal (the vectors that were averaged had a close to 0 sum). I also had issues with TransfiniteInterpolation, which was unable to complete the pull_back for some of the cells. In addition, there were a few other failed attempts, where the faces were already shattered into small quads prior to using the NormalToMeshProjection + TransfiniteInterpolation. I didn't have much luck with the other classes in opencascade/manifold_lib (e.g. Opencascade NURBS).

The Current Approach
I'm currently using the gmsh API to create a coarse mesh, and create the triangulation using the create_triangulation function. After that, I assign manifold_id (with set_manifold_id) and manifolds to each line/edge of each cell, whether internal or boundary (using wrappers around Opencascade functions, as needed), then do the same for each quad, and finally, for each cell. 

I'm using version 9.7.0 of deal.II (version found in /usr/local/lib/cmake/deal.II/deal.IIConfigVersion.cmake).

Thank you.
Best regards,
Silviu

Wolfgang Bangerth

unread,
Jun 18, 2025, 3:46:43 PM6/18/25
to dea...@googlegroups.com
On 6/18/25 12:39, Silviu Predoiu wrote:
>
> *The Issue*
> I'm trying to use a .STEP file to load a 3D geometry that is a bit more
> complex - it has holes, for instance. I would like meshes to get closer to the
> original geometry, upon refinement. To this end, I tried a number of
> approaches (listed below), and eventually settled on using my own custom-made
> manifolds (more details below). Starting with a somewhat coarse grid, each of
> the original cells has its own manifold, and refinement produces points using
> transfinite interpolation. The problem is that the ChartManifold::pull_back is
> called with points that seem very far away from the manifold itself. I
> expected that if vertices v0, v1, v2, v3 were the corners of a quadrangle
> representing a face, pull_back would be called with a point that is not too
> far from the said quadrangle. Instead, I get this (which seems to sugest that
> perhaps pull_back is called on the wrong manifold; below, the point is the
> argument of pull_back, while the colored curves are the 4 lines bounding the
> quadrangle):
> Figure_1.png
> Does anyone know what kind of points ChartManifold<3, 3, i>::pull_back is
> supposed to handle? (i = 1, 2, and 3).

Silviu:
good detective work already!

I agree that the expectation would be that pull_back() would only be called
for points that are "not too far" from the face on which the surrounding
points are located. I think a good test would be to add something like the
following to your custom manifold:
diameter = some kind of measure of the distance between the surrounding
points
center = some way of defining the center of the surrounding points
Assert (point is less than diameter away from center, ExcInternalError());
This way, your program will abort when you get into a situation as you show in
the figure. If you run the program in the debugger, you can get a backtrace
and see how it happened that a function called your manifold with points
located in that way. Perhaps that reveals a bug, or at least a situation you
may not have anticipated.

Best
W.
Reply all
Reply to author
Forward
0 new messages