3D Mesh: How to use an image for edge_size

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

3D Mesh: How to use an image for edge_size

Michael Bieri
Hi everybody,

I'm currently using CGAL to mesh a segmented image. I define the criteria as follows:

Image_sizing_field cell_size_fct(elem_size_image);
Mesh_criteria criteria(facet_angle=30, facet_size=cell_size_fct, facet_distance=cell_size_fct, cell_radius_edge_ratio=3, cell_size=cell_size_fct);

I'm not quite sure whether it's ok to use the cell_size_fct also for facet_size and facet_distance, but so far, it works for me. I'm open for advices on that.

Now, the Problem: When I add 1D features basically with "CGAL::polylines_to_protect" to protect the bounding box, I get very nasty results. The mesh along the boundary gets very coarse, it seems like no other points were allowed close to the boundary. I can fix the problem by specifying edge_size to a lower, constant value. BUT as soon as I try to use the Image_sizing_field cell_size_fct as edge_size, I get a compile error: 

In file included from /usr/local/include/CGAL/Mesh_criteria_3.h:32:
/usr/local/include/CGAL/Mesh_edge_criteria_3.h:63:38: error: no type named
'Point_3' in 'Image_sizing_field'
typename Sizing_field::Point_3,


Is it not possible to use a Image_sizing_field as edge_size criteria? Or how could I do this?

(You find the whole code attached.)

Best regards,
Michael




imagemesh_elem_size_img_snap.cpp (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 3D Mesh: How to use an image for edge_size

Sebastien Loriot (GeometryFactory)
On 05/02/2017 01:16 PM, Michael Bieri wrote:

> Hi everybody,
>
> I'm currently using CGAL to mesh a segmented image. I define the
> criteria as follows:
>
> Image_sizing_field cell_size_fct(elem_size_image);
> Mesh_criteria criteria(facet_angle=30, facet_size=cell_size_fct,
> facet_distance=cell_size_fct, cell_radius_edge_ratio=3,
> cell_size=cell_size_fct);
>
> I'm not quite sure whether it's ok to use the cell_size_fct also for
> facet_size and facet_distance, but so far, it works for me. I'm open for
> advices on that.
>
> Now, the Problem: When I add 1D features basically with
> "CGAL::polylines_to_protect" to protect the bounding box, I get very
> nasty results. The mesh along the boundary gets very coarse, it seems
> like no other points were allowed close to the boundary. I can fix the
> problem by specifying edge_size to a lower, constant value. BUT as soon
> as I try to use the Image_sizing_field cell_size_fct as edge_size, I get
> a compile error:
>
> In file included from /usr/local/include/CGAL/Mesh_criteria_3.h:32:
> /usr/local/include/CGAL/Mesh_edge_criteria_3.h:63:38: error: no type named
> 'Point_3' in 'Image_sizing_field'
> typename Sizing_field::Point_3,
>

Adding typedef Point Point_3; inside Image_sizing_field makes it compile.

Sebastien.

>
> Is it not possible to use a Image_sizing_field as edge_size criteria? Or
> how could I do this?
>
> (You find the whole code attached.)
>
> Best regards,
> Michael
>
>
>


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Loading...