Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] 3D Mesh creates extremely small elements

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] 3D Mesh creates extremely small elements


Chronological Thread 
  • From: Michael Bieri <>
  • To:
  • Subject: Re: [cgal-discuss] 3D Mesh creates extremely small elements
  • Date: Wed, 4 Oct 2017 19:59:58 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:MWkeOhG/XoJrnlpFiYMijJ1GYnF86YWxBRYc798ds5kLTJ76oMSwAkXT6L1XgUPTWs2DsrQf1LqQ7viocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWE1iMJAhj0KSZyI+30HMaS05X2hKiO/MjYbAxMwTa8erhvNw6erAPLt8BQj5ExBLw2z07so3BIculSjUlpKEiS10L5582x8YRi2ytVsvMlscVHVPOpLOwDUbVEAWF+YCgO78rxuEyfHAY=

One more question and a remark come in mind:

- Question: Would it be a valid workaround to create that polyline structure externally with more "reasonable" point density and then feed it to the mesher? (That's possible with my current code, but a bit too much work to just try...)
- Remark: The plot was done by some custom visualisation, just in case you're surprised how it looks.

On Wed, Oct 4, 2017 at 7:55 PM, Michael Bieri <> wrote:
Hi Laurent

I investigated the problem by plotting the polylines. You can find increasingly more zoomed images here: https://www.dropbox.com/sh/lz8xmwhr3fg23qu/AAAZEpWnKzJyrjhNB006_-fVa?dl=0

Points of the polylines are plotted in yellow, while the connecting lines are in blue. YES, there are so many points that the lines basically appear yellow. When zooming in, one can see that the polylines follow the pixels of the image. When zooming in even more, one can see that the pixel boundary is not just made up of one polyline, but of quite a number of points/lines. Why is this?

So...if the mesher actually wants to preserve ALL those features, no surprise that elements are getting extremely small. BUT I also see that in many parts of the mesh, elements along material boundaries are MUCH larger than the smallest 1D features. So I wonder - what's the rule, when is a polyline/feature exactly kept, and when does the mesher just approximate it?

Thanks and best regards,
Michael


On Wed, Oct 4, 2017 at 5:38 PM, Laurent Rineau (CGAL/GeometryFactory) <> wrote:

Le Wednesday, October 4, 2017 3:00:44 PM CEST Michael Bieri a écrit :

> So finally it would be possible that the features from the grid vs. the

> features from the 2-material+surface intersection are extremely close,

> thus forcing extremely small elements?

 

Yes, that is plausible.

 

> Would it make sense to extract all the 1D features and plot them in 3D?

> (I'm just thinking how to achieve this...)

>

>

> // For the 1D-features

> bool add_1D_features(const CGAL::Image_3& image,Mesh_domain& domain)

> {

> typedef K::Point_3 Point_3;

> typedef Mesh_domain::Image_word_type Word_type; // that is `unsigned

> char` std::vector<std::vector<Point_3> > features_inside;

> std::vector<std::vector<Point_3> > polylines_on_bbox;

> CGAL::polylines_to_protect<Point_3, Word_type>(image,

> polylines_on_bbox,features_inside.begin(), features_inside.end());

> domain.add_features(polylines_on_bbox.begin(), polylines_on_bbox.end());

> return true;

> }

 

In that function, you can dump the `polylines_on_bbox` in a file:

 

std::ofstream out("dump.polylines.txt");

for(auto polyline: polylines_on_bbox) {

out << polyline.size();

for(auto point: polyline) out << " " << p;

out << "\n";

}

 

(Note that I used C++11 for-loops.)

 

Then that file dump.polylines.txt can be opened with the demo from CGAL-4.11/demo/Polyhedron if you have compiled its target named `polylines_io_plugin`.

 

--

Laurent Rineau, PhD

R&D Engineer at GeometryFactory http://www.geometryfactory.com/

Release Manager of the CGAL Project http://www.cgal.org/

 






Archive powered by MHonArc 2.6.18.

Top of Page