Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Mesh with criteria containing scalar fields does not work as intended

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Mesh with criteria containing scalar fields does not work as intended


Chronological Thread 
  • From: Bryn Lloyd <>
  • To:
  • Subject: Re: [cgal-discuss] Mesh with criteria containing scalar fields does not work as intended
  • Date: Mon, 24 Aug 2015 14:25:08 +0200

Hi Robin

It looks like you are setting the subdomain index in 'facetSizingField', althouth you probably want to set a surface patch index (Surface_patch_index ).
Try using the function 'index_from_surface_patch_index' instead.

Bryn




On 8/23/2015 10:28 PM, Robin A wrote:
Dear CGAL community,
I am trying to get a tetraheader mesh from a voxel-based (medical) image.
However i need a very high resolution for two materials/subdomains.
Therefore two scalar fields (facet_size and cell_size) are used for the
criteria. However, the output mesh does not meet the criteria (more specific
information below). The code of the program is fairly long and has several
classes so i only post code fragments for now:


struct K: public CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef CGAL::Labeled_image_mesh_domain_3<CGAL::Image_3,K> Mesh_domain;
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3
 C3t3;
typedef CGAL::Mesh_criteria_3
 Mesh_criteria;
typedef CGAL::Mesh_constant_domain_field_3<Mesh_domain::R,
Mesh_domain::Index>   Sizing_field;

using namespace CGAL::parameters;

... // creating image

// Mesh criteria
double           facetAngle     = 30;
double           facetSize      = 3;
double           facetDistance  = 3;
double           cellRadiusEdge = 3;
double           cellSize       = 9;

Sizing_field sizingField(cellSize);
Sizing_field facetSizingField(facetSize);

sizingField.set_size(0.6,3,domain.index_from_subdomain_index(32));
sizingField.set_size(0.6,3,domain.index_from_subdomain_index(33));

facetSizingField.set_size(0.3,2,domain.index_from_subdomain_index(32));
facetSizingField.set_size(0.3,2,domain.index_from_subdomain_index(33));

C3t3 mesh;
Mesh_domain domain(image);

Mesh_criteria criteria(facet_angle = facetAngle, facet_size =
facetSizingField, facet_distance =            
facetDistance,cell_radius_edge = cellRadiusEdge, cell_size = sizingField);

//make_mesh is actually called in a separate function 
C3t3 mesh = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(),no_exude() );

... //rotate, then convert C3t3 to VTK file

The Voxel size is 0.4^3.
Note that i can compile this program without errors. However two problems
occur:

- changing the facet size of the subdomains 32 and 33 does not seem to have
any influence on the output mesh (mesh is the same for 0.001, 0.1 or 0.3
facet size for subdomain 32 and 33 even if the cell size is set to a global
value of 9)

- if the cell size is set to low values like 0.6 for the subdomains 32 and
33 (e.g in the code above), a "random" subdomain that is connected to these
subdomains (32,33) is set to 32,33 and has therefore high resolutions. The
rest of the mesh seems to be meshed correctly. 
If only a few voxels of the input image are varied, other subdomains (e.g.
9, 41) that are adjacent to 32 or 33 are set to 32 or 33 or the program gets
killed after several minutes. Note that only parts (for instance half of the
subdomain 9) are set to a wrong value. 

I don't suppose the mistake to be the input image, given the fact, that the
"falsely set" subdomains are always adjacent to the subdomains, that are
supposed to have high resolution.

I don't know if the information i gave you is enough to solve these problems
but maybe someone has already encountered the same problem.

I would gladly appreciate any hint that might help me to solve this problem.
Sincerely Robin





--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Mesh-with-criteria-containing-scalar-fields-does-not-work-as-intended-tp4661090.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page