problem/bug with CGAL::Polygon_mesh_processing::is_outward_oriented()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem/bug with CGAL::Polygon_mesh_processing::is_outward_oriented()

Hugo Ledoux
Greetings,

I have one mesh whose normals are pointing outwards, but the function
CGAL::Polygon_mesh_processing::is_outward_oriented() returns
otherwise.

I have checked the code and the average of the normals of the faces
incident to the min-vertex is used, which conceptually I doubt should
work… And it doesn’t work in my case (unless I made a mistake
somewhere), you can download my OFF file, along with the code I used,
there:
https://www.dropbox.com/sh/49as9yt139v6kxk/AABXI3Nh4ZfqCEDWHyv8Q-Zja?dl=0

If other ways to compute the normal were used (eg by using the area of
the face as a weight), then the x-component of the vector could be
negative (as is used by cgal), but I am wondering if that would always
work. I think not.

Any comments appreciated, cheers,
Hugo Ledoux

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem/bug with CGAL::Polygon_mesh_processing::is_outward_oriented()

Jane Tournois
Hi Hugo,

thanks for your report. I am having a look at it.

Best,

Jane.


Le 06/04/2017 à 11:27, Hugo Ledoux a écrit :

> Greetings,
>
> I have one mesh whose normals are pointing outwards, but the function
> CGAL::Polygon_mesh_processing::is_outward_oriented() returns
> otherwise.
>
> I have checked the code and the average of the normals of the faces
> incident to the min-vertex is used, which conceptually I doubt should
> work… And it doesn’t work in my case (unless I made a mistake
> somewhere), you can download my OFF file, along with the code I used,
> there:
> https://www.dropbox.com/sh/49as9yt139v6kxk/AABXI3Nh4ZfqCEDWHyv8Q-Zja?dl=0
>
> If other ways to compute the normal were used (eg by using the area of
> the face as a weight), then the x-component of the vector could be
> negative (as is used by cgal), but I am wondering if that would always
> work. I think not.
>
> Any comments appreciated, cheers,
> Hugo Ledoux
>

--
Jane Tournois, PhD
R&D Engineer at GeometryFactory
http://www.geometryfactory.com/


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem/bug with CGAL::Polygon_mesh_processing::is_outward_oriented()

Jane Tournois
The normal computed at the minimal vertex p connects these points
p        = 93748.5625 463832.4375 0
p + n = 93748.69634598933 463831.60433620599 -0.53658488932336901

the normal is correct, but the test is wrong. We will try to fix it asap.

Thanks again,
Jane.

Le 06/04/2017 à 17:35, Jane Tournois a écrit :

> Hi Hugo,
>
> thanks for your report. I am having a look at it.
>
> Best,
>
> Jane.
>
>
> Le 06/04/2017 à 11:27, Hugo Ledoux a écrit :
>> Greetings,
>>
>> I have one mesh whose normals are pointing outwards, but the function
>> CGAL::Polygon_mesh_processing::is_outward_oriented() returns
>> otherwise.
>>
>> I have checked the code and the average of the normals of the faces
>> incident to the min-vertex is used, which conceptually I doubt should
>> work… And it doesn’t work in my case (unless I made a mistake
>> somewhere), you can download my OFF file, along with the code I used,
>> there:
>> https://www.dropbox.com/sh/49as9yt139v6kxk/AABXI3Nh4ZfqCEDWHyv8Q-Zja?dl=0 
>>
>>
>> If other ways to compute the normal were used (eg by using the area of
>> the face as a weight), then the x-component of the vector could be
>> negative (as is used by cgal), but I am wondering if that would always
>> work. I think not.
>>
>> Any comments appreciated, cheers,
>> Hugo Ledoux
>>
>

--
Jane Tournois, PhD
R&D Engineer at GeometryFactory
http://www.geometryfactory.com/


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem/bug with CGAL::Polygon_mesh_processing::is_outward_oriented()

Jane Tournois
In reply to this post by Hugo Ledoux
Hi Hugo,

we have created a pull request [1] that should fix this function. It
will be tested in the coming days before it is integrated to the master
branch, but you can already experiment with it.

Best regards,

Jane.


[1] https://github.com/CGAL/cgal/pull/2057


Le 06/04/2017 à 11:27, Hugo Ledoux a écrit :

> Greetings,
>
> I have one mesh whose normals are pointing outwards, but the function
> CGAL::Polygon_mesh_processing::is_outward_oriented() returns
> otherwise.
>
> I have checked the code and the average of the normals of the faces
> incident to the min-vertex is used, which conceptually I doubt should
> work… And it doesn’t work in my case (unless I made a mistake
> somewhere), you can download my OFF file, along with the code I used,
> there:
> https://www.dropbox.com/sh/49as9yt139v6kxk/AABXI3Nh4ZfqCEDWHyv8Q-Zja?dl=0
>
> If other ways to compute the normal were used (eg by using the area of
> the face as a weight), then the x-component of the vector could be
> negative (as is used by cgal), but I am wondering if that would always
> work. I think not.
>
> Any comments appreciated, cheers,
> Hugo Ledoux
>

--
Jane Tournois, PhD
R&D Engineer at GeometryFactory
http://www.geometryfactory.com/


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem/bug with CGAL::Polygon_mesh_processing::is_outward_oriented()

Hugo Ledoux
Thanks Jane, I had not noticed you replied.

Testing is rather complex but I see you tested with my case, and I
read the algorithm and I am pretty sure it works.

Thanks for solving this that fast!
Hugo

On Fri, Apr 14, 2017 at 5:54 PM, Jane Tournois
<[hidden email]> wrote:

> Hi Hugo,
>
> we have created a pull request [1] that should fix this function. It will be
> tested in the coming days before it is integrated to the master branch, but
> you can already experiment with it.
>
> Best regards,
>
> Jane.
>
>
> [1] https://github.com/CGAL/cgal/pull/2057
>
>
> Le 06/04/2017 à 11:27, Hugo Ledoux a écrit :
>>
>> Greetings,
>>
>> I have one mesh whose normals are pointing outwards, but the function
>> CGAL::Polygon_mesh_processing::is_outward_oriented() returns
>> otherwise.
>>
>> I have checked the code and the average of the normals of the faces
>> incident to the min-vertex is used, which conceptually I doubt should
>> work… And it doesn’t work in my case (unless I made a mistake
>> somewhere), you can download my OFF file, along with the code I used,
>> there:
>> https://www.dropbox.com/sh/49as9yt139v6kxk/AABXI3Nh4ZfqCEDWHyv8Q-Zja?dl=0
>>
>> If other ways to compute the normal were used (eg by using the area of
>> the face as a weight), then the x-component of the vector could be
>> negative (as is used by cgal), but I am wondering if that would always
>> work. I think not.
>>
>> Any comments appreciated, cheers,
>> Hugo Ledoux
>>
>
> --
> Jane Tournois, PhD
> R&D Engineer at GeometryFactory
> http://www.geometryfactory.com/
>
>
> --
> 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


Loading...