Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL Problem when generating mesh (make_mesh_3) from segmented 3d image

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL Problem when generating mesh (make_mesh_3) from segmented 3d image


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL Problem when generating mesh (make_mesh_3) from segmented 3d image
  • Date: Thu, 19 Jan 2017 16:52:48 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:leFkdRcewmU8qOLf0v0qn3vplGMj4u6mDksu8pMizoh2WeGdxcS9Zh7h7PlgxGXEQZ/co6odzbGH7+a8ACdfut6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCzbL52Ixi6twrcutQZjYZgJKs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9ZwgbpGrhy/qRxxw4nUboKbOvVwcazSf88VS2VaU8ZNVSFMGJ+wY5cBAucBO+tTsonzp0EJrRu7HQSgCv7hxSFTiXDsxq06z+UhHh/A3Ac9GdwOt27UrNTyNKcOTOu5yKjGwivEb/NTxzj99JLIcxAhr/6WQb1wbc3RyVMvFg/AgFmbtIvoPyiR1uQKqWib7u1gVf61h24irwF8uTevxsI2hYnIgoIZ0EzL9SJ8wIssI9CzVUB1YdmhEJRKtiGaMZN7QsU4TG5zoyk6zqMJtYSncygNzZQr3wLQa/OdfIiM+B7jU/yRITh+iXl4e7y/nw6//Eqvx+HmS8W4zlZHojBGn9XSrHwA1xPe5tCFR/Z+5EutxzmC2gHJ5u1ZJU05m7DXJpwhz7M2i5Edq17MHjXsl0XzlKKWdlsr+uyv6+n/Z7XpvJ6cN4tthgDwN6QihtWzAeo4PwUBRWSb9uO81Lrs/U39XrpGlOE5kq7csJzCJMQboLC2AxNN34sh5BuzFSqq3MoYkHUdL19JZgiLgojmNl3WJfD3F/a/g1CikDdxwPDGO6XsAo7JLnjEirfhfLF961JGxAo2ydBS/J1UCrQbL/LyXk/9rsDXDhg8MwCs2eboFM191p8CWWKIGqKWLKzSvkWM5u42PuaMZZQVtyrgK/g+/P7jlmQ5mF8Yfamxx5QbcnG4HvJ8I0WYe3XgmNkBEX1Z9jY5GeflgVnHXT9IbGupRIo94Cs6AcSoF9TtXIeo1fa60S2yBYFXa2YOLleWEHD0P8WrVvAJZT6IM+FomSADT6ngAcd1zhWprg791/xiKsLb/yQZsdTo090jtL6brg076TEhV5fV6GqKVWwhxm4=
  • Organization: GeometryFactory

You can try boundary_to_off()
http://doc.cgal.org/latest/Mesh_3/classCGAL_1_1Mesh__complex__3__in__triangulation__3.html#af1d55be1242c37384224de9b235057cd

Sebastien


On 01/19/2017 04:44 PM, gori23 wrote:
Hi all,

I solved above problem with loading the Image_3 data

The trick was changing the size parameter in createImage to 2 bytes
_image* image11 = _createImage(dim, dim, dim, 1, 1.f, 1.f, 1.f, 2, WK_FIXED,
SGN_UNSIGNED);

I now sucessfully generated tetrahedral meshes with different domains. I am
struggling with extracting just the surface triangles of the domains

this is briefly what I am doing right now after generating the mesh:

for (Complex_Cell_Iterator it = c3t3.cells_in_complex_begin(); it !=
c3t3.cells_in_complex_end(); ++it)
{

const Tr::Cell c(*it);
const C3t3::Vertex_handle i1 = c.vertex(0);
const C3t3::Vertex_handle i2 = c.vertex(1);
const C3t3::Vertex_handle i3 = c.vertex(2);
const C3t3::Vertex_handle i4 = c.vertex(3);

//v1-4 are 3d points with the coordinates of the vertices i1-4
// addTri adds an opriented triangle to my mesh structure

if(c.is_facet_on_surface(f4.second)) addTri(v1, v2, v3);
if(c.is_facet_on_surface(f3.second)) addTri(v1, v2, v4);
if(c.is_facet_on_surface(f1.second)) addTri(v4, v2, v3);
if(c.is_facet_on_surface(f2.second)) addTri(v1, v4, v3);
}

now when I run above code without the if(c.is_facet_on_surface) conditions
(and simply add all triangles) I get the tetrahedras, already nicely
oriented. I had assumed by just getting the surface it also would be
oriented, but it isn't like that, the orientations seem to be random.

Is there a better way to extract the surface mesh in a oriented way?

Cheers,




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/CGAL-Problem-when-generating-mesh-make-mesh-3-from-segmented-3d-image-tp4661387p4662475.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page