Hi,
i am meshing implicit surfaces and sometimes the result is inside out (the vertex order of triangles is wrong). I attached three meshes and the code to show what i mean: * 'sphere_r_const_1_1.000000.off' is correct * 'sphere_r_const_2_1.000000.off' is inside out * 'sphere_r_const_4096_1.000000.off' is correct In both cases i meshed a unit sphere. The only difference when creating the spheres is the squared radius i passed to 'Sphere_3' when creating my 'CGAL::Implicit_mesh_domain_3'. The first sphere got the exact squared radius '1' and the second the larger value '2' and the third the value '4096'. Hence i the issue can't be a too large bounding sphere. Why does this happen and how can i prevent this? Best regards, Raphael -- Karlsruhe Institute of Technology (KIT) Institute for Anthropomatics and Robotics (IAR) High Performance Humanoid Technologies (H2T) Raphael Grimm (M.Sc.) Research Scientist Adenauerring 2 Building 50.20, Room 334 76131 Karlsruhe, Germany Phone: +49 721 608-47133 Fax: +49 721 608-48270 Email: [hidden email] Web: http://h2t.anthropomatik.kit.edu/ KIT - The Research University in the Helmholtz Association sphere_r_const_1_1.000000.off (58K) Download Attachment sphere_r_const_2_1.000000.off (57K) Download Attachment mesh_implicit_spheres.cpp (3K) Download Attachment sphere_r_const_4096_1.000000.off (57K) Download Attachment smime.p7s (6K) Download Attachment |
We added some functions in PMP to handle this kind of issues.
See CGAL::Polygon_mesh_processing::orient() https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gafe035adcc4ff061b4438cc9dae591d00 Sebastien. On 06/12/2018 11:31 AM, Raphael Grimm wrote: > Hi, > i am meshing implicit surfaces and sometimes the result is inside out > (the vertex order of triangles is wrong). > > I attached three meshes and the code to show what i mean: > * 'sphere_r_const_1_1.000000.off' is correct > * 'sphere_r_const_2_1.000000.off' is inside out > * 'sphere_r_const_4096_1.000000.off' is correct > > In both cases i meshed a unit sphere. > The only difference when creating the spheres is the squared radius i > passed to 'Sphere_3' when creating my 'CGAL::Implicit_mesh_domain_3'. > The first sphere got the exact squared radius '1' and the second the > larger value '2' and the third the value '4096'. > Hence i the issue can't be a too large bounding sphere. > > Why does this happen and how can i prevent this? > > Best regards, > > Raphael > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss |
Hi Sebastien,
Thank you for the comment. I actually encountered this problem as well, and the method you suggested should solve it well. Only one question remains, however: is there anyway to get a Surface_mesh from c3t3 directly, besides calling export_surface_to_off() and then reading it back? Thank you. Best, Zesen On Tue, Jun 12, 2018 at 6:44 AM, Sebastien Loriot (GeometryFactory) <[hidden email]> wrote: > We added some functions in PMP to handle this kind of issues. > See CGAL::Polygon_mesh_processing::orient() > > https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gafe035adcc4ff061b4438cc9dae591d00 > > Sebastien. > > On 06/12/2018 11:31 AM, Raphael Grimm wrote: >> >> Hi, >> i am meshing implicit surfaces and sometimes the result is inside out (the >> vertex order of triangles is wrong). >> >> I attached three meshes and the code to show what i mean: >> * 'sphere_r_const_1_1.000000.off' is correct >> * 'sphere_r_const_2_1.000000.off' is inside out >> * 'sphere_r_const_4096_1.000000.off' is correct >> >> In both cases i meshed a unit sphere. >> The only difference when creating the spheres is the squared radius i >> passed to 'Sphere_3' when creating my 'CGAL::Implicit_mesh_domain_3'. >> The first sphere got the exact squared radius '1' and the second the >> larger value '2' and the third the value '4096'. >> Hence i the issue can't be a too large bounding sphere. >> >> Why does this happen and how can i prevent this? >> >> Best regards, >> >> Raphael >> > > -- > You are currently subscribed to cgal-discuss. > To unsubscribe or access the archives, go to > https://sympa.inria.fr/sympa/info/cgal-discuss > > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss |
try facets_in_complex_3_to_triangle_mesh()
https://doc.cgal.org/latest/Mesh_3/group__PkgMesh__3Functions.html#ga68ca38989087644fb6b893eb566be9ea Sebastien. On 06/12/2018 04:45 PM, Zesen Qian wrote: > Hi Sebastien, > > Thank you for the comment. I actually encountered this problem as > well, and the method you suggested should solve it well. Only one > question remains, however: is there anyway to get a Surface_mesh from > c3t3 directly, besides calling export_surface_to_off() and then > reading it back? > > Thank you. > > Best, > Zesen > > On Tue, Jun 12, 2018 at 6:44 AM, Sebastien Loriot (GeometryFactory) > <[hidden email]> wrote: >> We added some functions in PMP to handle this kind of issues. >> See CGAL::Polygon_mesh_processing::orient() >> >> https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__orientation__grp.html#gafe035adcc4ff061b4438cc9dae591d00 >> >> Sebastien. >> >> On 06/12/2018 11:31 AM, Raphael Grimm wrote: >>> >>> Hi, >>> i am meshing implicit surfaces and sometimes the result is inside out (the >>> vertex order of triangles is wrong). >>> >>> I attached three meshes and the code to show what i mean: >>> * 'sphere_r_const_1_1.000000.off' is correct >>> * 'sphere_r_const_2_1.000000.off' is inside out >>> * 'sphere_r_const_4096_1.000000.off' is correct >>> >>> In both cases i meshed a unit sphere. >>> The only difference when creating the spheres is the squared radius i >>> passed to 'Sphere_3' when creating my 'CGAL::Implicit_mesh_domain_3'. >>> The first sphere got the exact squared radius '1' and the second the >>> larger value '2' and the third the value '4096'. >>> Hence i the issue can't be a too large bounding sphere. >>> >>> Why does this happen and how can i prevent this? >>> >>> Best regards, >>> >>> Raphael >>> >> >> -- >> You are currently subscribed to cgal-discuss. >> To unsubscribe or access the archives, go to >> https://sympa.inria.fr/sympa/info/cgal-discuss >> >> > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss |
In reply to this post by Zesen Qian
Le Tuesday, June 12, 2018 4:45:08 PM CEST Zesen Qian a écrit :
> Hi Sebastien, > > Thank you for the comment. I actually encountered this problem as > well, and the method you suggested should solve it well. Only one > question remains, however: is there anyway to get a Surface_mesh from > c3t3 directly, besides calling export_surface_to_off() and then > reading it back? In CGAL-4.12, there is that function: void CGAL::facets_in_complex_3_to_triangle_mesh (const C3T3 &, TriangleMesh &); https://doc.cgal.org/latest/Mesh_3/group__PkgMesh__3Functions.html#ga68ca38989087644fb6b893eb566be9ea -- Laurent Rineau, PhD R&D Engineer at GeometryFactory http://www.geometryfactory.com/ Release Manager of the CGAL Project http://www.cgal.org/ -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss |
Thank you Laurent, it works perfectly.
On Tue, Jun 12, 2018 at 12:10 PM, Laurent Rineau (CGAL/GeometryFactory) <[hidden email]> wrote: > Le Tuesday, June 12, 2018 4:45:08 PM CEST Zesen Qian a écrit : >> Hi Sebastien, >> >> Thank you for the comment. I actually encountered this problem as >> well, and the method you suggested should solve it well. Only one >> question remains, however: is there anyway to get a Surface_mesh from >> c3t3 directly, besides calling export_surface_to_off() and then >> reading it back? > > In CGAL-4.12, there is that function: > > void CGAL::facets_in_complex_3_to_triangle_mesh (const C3T3 &, TriangleMesh &); > > https://doc.cgal.org/latest/Mesh_3/group__PkgMesh__3Functions.html#ga68ca38989087644fb6b893eb566be9ea > > -- > Laurent Rineau, PhD > R&D Engineer at GeometryFactory http://www.geometryfactory.com/ > Release Manager of the CGAL Project http://www.cgal.org/ > > > > > -- > You are currently subscribed to cgal-discuss. > To unsubscribe or access the archives, go to > https://sympa.inria.fr/sympa/info/cgal-discuss > > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss |
Free forum by Nabble | Edit this page |