Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Only keep the part of a surface-mesh which is inside a Polyhedron

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Only keep the part of a surface-mesh which is inside a Polyhedron


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Only keep the part of a surface-mesh which is inside a Polyhedron
  • Date: Tue, 26 Apr 2016 21:11:54 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:zsR3FxDeIiY7SMwSPEdtUyQJP3N1i/DPJgcQr6AfoPdwSP79ocbcNUDSrc9gkEXOFd2CrakU26yJ4uu5AzBIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/nh6btqtaKOVkArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9Kq83RLgdADU9OH0u/+XqswPCRE2B/CgySGITx1BzDgLM9w37U5G5lizgt+1hkGm1MMrzQKwuSBqr5LtsUg6pwm9TLDo+6mDQlop1iIpUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEDyE=
  • Organization: GeometryFactory

In the Boolean operation world, what you are looking for is called the
intersection. The only official way to do that for now is to use
the Nef_polyhedron package, and in your case this function:

http://doc.cgal.org/latest/Nef_3/classCGAL_1_1Nef__polyhedron__3.html#a4f7d5c63440b89153cb971e022e0ef76

This example is a good start:
http://doc.cgal.org/latest/Nef_3/Nef_3_2handling_double_coordinates_8cpp-example.html for I/O from polyhedron.


Sebastien.


On 04/19/2016 02:26 PM, vertber wrote:

Hi, I'm kinda new with CGAL and i have a question for you ! (And sorry for
my bad english,it's not my native language so i'll try my best. )

I have an .off file (a 3D Indoor Room) which is read and stocked into a
Surface_Mesh Object (couldn't use a Polyhedron cause i've got some error,
probably because it's not a manifold polyhedron).
On the other hand I have a pyramidal Polyhedron (which symbolize a camera's
field of view) and I would like to manage to cut off all the surface mesh
which is not in this pyramidal Polyhedron.
With the help of this code
(https://www.codefull.org/2016/03/cgal-point-in-polyhedron-algorithm/) I
managed to mark each vertices of my surface_mesh which is not inside the
polyhedron as removed, and then called the garbage collection in order to
remove them completely.
But Surface_Mesh provide only Low-Level Removal Functions, so my
Surface_mesh result is not valid anymore and I can't write it into a new off
file.

I can also just keep the Points of my surface mesh which are inside the
pyramidal Polyhedron and stock them other place, but by doing that the
result is a Point cloud whereas I would like to obtain a Mesh.

So my question is: Does it exist a way to keep the part of a surface-mesh
which is inside a Polyhedron ?

Thanks for reading !



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Only-keep-the-part-of-a-surface-mesh-which-is-inside-a-Polyhedron-tp4661848.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page