Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] make_mesh_3 missing disjoint components from polyhedral surface.

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] make_mesh_3 missing disjoint components from polyhedral surface.


Chronological Thread 
  • From: "Laurent Rineau (CGAL/GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] make_mesh_3 missing disjoint components from polyhedral surface.
  • Date: Wed, 02 Oct 2019 09:34:43 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=None
  • Ironport-phdr: 9a23:6sjaXRDPFGozyFqV6OGOUyQJP3N1i/DPJgcQr6AfoPdwSPTypsbcNUDSrc9gkEXOFd2Cra4d0KyK7uu5AD1IyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfL1/IA+5oAjRucUanJZuJ6IswRbVv3VEfPhby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnDUBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulSwKMSMy/mPKhcxqlK9VoAyvqQFxzYDXZ4GaNvR+cazSc9wGXmdBQttfWjZdDo+gc4cDEewMNvtYoYnnoFsOqAOzCQeqCuz11z9InGH53asm0+88DQ/G3QogEMwUv3TJsd75MLkfX+GpwafO1jnNbu1Z2TD46IfWbhAhu/GNU7JqfsXN1UkvEBnFj1WVpYDrIjiY0eANvHKG7+p6S+2vjXInpxtrojiuwMcjlJPGhp8Ox1/Y+iV22oI1Kce/SE5hbt6pCZ1dvDyUOYtxR8MtWWBouCAix7Iatp60ZiwKxI4gxx7FZPyLa4eI7QzkVOaUPzh4mGhlebKxhxmo7Ueg1ur8VtO00VpQsiVFldzMu3YQ3BLQ8siKUuZx8lml1DqVygze7uVJLVowmKfaMZIszaI8moINvUjZAyP7mF/6gLKZe0gm4OSk9fjrb7Hgq5SBLYF7kBv+Pb4rmsGnAeQ3LAwOX2+D9OS6yrLj81f1T6tMjv0tiKXZvoraKdwapq6/HQBVzp4u5wuhAzqiytgUgH0KIVZfdB+DjoXlIV7DLOzgAfe6mVuskTNrx/7cPr3mB5XANnzDn638fbZn9UFczhYzwcpF55JVDLEOPuj8WlLqudPEAR82KQi0z/zgCNVn2YMSQXiPDbOBMKPOrV+I4foiLPWDZIAPvDbxMuUq5//1jXAlhF8dZrKp0IAMaHG4G/RmO1+WbWDtgtcHC2cKvxAxQPbkiF2YAnZvYCO5UKs4oz06E4m7FpzrR4a3gbXH0j3oMIdRYzUMLlmRC3rua82+WvEBYT/aYuROuxhDerWmToI9zwCAvQTmzKB2b6CcrikRqIju0sQz/ezVmBgv3Td7BsDb1HuCGTIn1lgUTiM7ifgs6Xd2zU2OhPAh365oUOdL7vYMaT8UcIbGxrUiWdv9UwaHec2GGg7/H4eWRAopR9d0+OcgJkZwH9L71ELF0iTsDrkO0bKRVsRto/DsmkPpLsM48E7okawojl0oWMxKbDX0jaF2807UHYGbyEg=
  • Organization: GeometryFactory

On Tuesday, October 1, 2019 9:15:48 PM CEST rdzhao wrote:
> I've played with your code. It successfully captures all the components.
> That's great!
>
> Your offered treatment incorporates a subset of surface vertices as seeds.
> But when I changes the seeds at a set of points inside the surface, the
> program crashes with segmentation fault.
>
> What should I do to insert only interior points as seeds?

What you call the seeds are documented in functor Construct_initial_points of
the MeshDomain_3 concept:

> A function object to construct a set of initial points on the surface of
> the domain.

https://doc.cgal.org/4.14.1/Mesh_3/classMeshDomain__3.html#abcf45d5a98576cad24711008e940b98f


They have to be on the surface of the domain.

If you want to insert initial points in the interior of the domain, then you
will have to do the initialization of the c3t3 object by handle, using a
loop, and then:

C3t3 c3t3;
C3t3::Triangulation& tr = c3t3.triangulation();

for(auto pi: seeds) {
Vertex_handle v = tr.insert(pi);
// `v` could be null if `pi` is hidden by other vertices of `tr`.
CGAL_assertion(v != Vertex_handle());
c3t3.set_dimension(v, 2); // by construction, points are on surface
c3t3.set_index(v, index);
}

See an example if the the documentation:
https://doc.cgal.org/4.14.1/Mesh_3/index.html#title26

But be particularly careful with the line

c3t3.set_dimension(v, 2);

For points that are inside the interior of the domain, the 2 has to be a 3:

c3t3.set_dimension(v, 3);

Your custom initialization could be made of two loops:

C3t3 c3t3;
C3t3::Triangulation& tr = c3t3.triangulation();

for(auto pi: seeds_on_surface) {
Vertex_handle v = tr.insert(pi);
// `v` could be null if `pi` is hidden by other vertices of `tr`.
CGAL_assertion(v != Vertex_handle());
c3t3.set_dimension(v, 2);
c3t3.set_index(v, index);
}
for(auto pi: seeds_in_the_interior) {
Vertex_handle v = tr.insert(pi);
// `v` could be null if `pi` is hidden by other vertices of `tr`.
CGAL_assertion(v != Vertex_handle());
c3t3.set_dimension(v, 3);
c3t3.set_index(v, index);
}


--
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