Subject: CGAL users discussion list
List archive
- From: quaternionboy <>
- To:
- Subject: Re: [cgal-discuss] How I get the right normals of facet?
- Date: Mon, 17 Aug 2020 11:56:12 -0500 (CDT)
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
- Ironport-phdr: 9a23:VkBq+RMPhBX6Y0hgGWAl6mtUPXoX/o7sNwtQ0KIMzox0I/T+rarrMEGX3/hxlliBBdydt6sazbOO7+u5AyQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagYL5+Ngi6oRneu8UZnIduNLs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gyoBKjU38nzYitZogaxVoByvuR9xzIzaYI+IO/VxYqzTcMgGRWpYQspdSzBNDp++YoYJEuEPPfxYr474p1YWtBu+GBOjBP/xxT9SgH/23Ko60+I6HgHB3A0rAtUDsG3JrNrvKKcdT/q1zK/JzTXEafNZwjD96YjTfxAupPGDR7Nwcc7LxUYzEAPFi0ydpIr4NDyayuoDqXKU7/Z8Ve2xkW4nrRl8rzegyMswi4TEmoIYx0zL+Ch3wIs5Od22RU5/bNCkHpZduD2XOohqTs4mTWxlpCk0x6AEtJOneCUHxogrygLRZfGBboOG7BXjVOOLLjd5gnJoYK6whxmo/kik0OH8UdO00FlSoipElNnMrHEN2AbJ5siJUPtx5kGh1iyU2A/I7uFLP1o4mrbcK54kxLM7i5kdsVzbEyPrnEj7iLWae0sn9+Sy6OnqY6/qq56dOoJylwrwKL4hmtalDuQ9KgUOX3aU+eC71LD7+030T69GjvssnabCq5/aIdoUqrSlDA9S14Yv8xe/DzG439QEhXQLMVZIdRadg4XnOFzCOvP1APalj1mtkTpn3/XGMafgApXJIHjDirDhfbNl5k5F1Qo818xf6IxOCrEHIfLzXUnxu8ffDh45KAG0zOPnB8981oMaQ26AHqiZMKbKvV+S+u0vO/WMZJMSuDvlN/cl6OThjXsglVAAfKmpxocYaG2jHvR9OEiZenrtgtIZEWgQpAY+TerqiEeDUTFJfXqyUbg8tXkGDpm7B9LDWpy1m+7GmzyqG4VfIGFAEFGFV3nyMJ6VXu8FLyOULMgmmTMNUf2tSpQqyAq15zL80KdtEufE5ngYqY77z4oyoPbCkAk7sz1yFcWUlW+XCHplm3sBAD4w0qc4qkN0zhKP0LNznudDRuBUsvhGWwN/OZ/HxPFhEPjzXBjAd5GHUgWIWNKjVCgsR8482dkPZEB3HMTq2gne1janGbkUkLqBA40c/afV3ny3LMF4nSWVnJI9hkUrF5McfVatgbRyolCKWtz51n6BnqPvTpwymS7A8GDakDiI4AdeWQR6VaiDVncaNBKP8YbJo3jaRrrrMowJdxNbwJfbeKRPY9zty15BQaW7YYWMUyeKg261QC2w6PaJZYvudX8a2XyEWkcBmgEXu32BMFplCw==
Tried to manage parity but still get not consistent normals... Any ideas?
for (CGALTriangulation::Finite_facets_iterator it = T.finite_facets_begin();
it != T.finite_facets_end();
it++)
{
std::pair<CGALTriangulation::Cell_handle, int> f = *it;
const Point& p0 = f.first->vertex((f.second))->point(); //not a
facet point, opposite
const Point& p1 = f.first->vertex((f.second+1)&3)->point();
const Point& p2 = f.first->vertex((f.second+2)&3)->point();
const Point& p3 = f.first->vertex((f.second+3)&3)->point();
//normals
auto n = ( f.second % 2 == 1) ?
CGAL::normal(p1, p2, p3) :
CGAL::normal(p1, p3, p2);
n = n/std::sqrt(n.squared_length());
teillaud wrote
> Hi
>
> see http://doc.cgal.org/latest/TDS_3/index.html#title0
> and in particular a sentence in paragraph "Validity"
> ====
> The set σ 4 of permutations of (0,1,2,3) has cardinality 24, and the set
> of positive permutations A4 has cardinality 12. Thus, for a given
> orientation, there are up to 12 different orderings of the four vertices
> of a cell.
> Note that cyclic permutations are negative and so do not preserve the
> orientation of a cell.
> ====
>
> whether vertices (i,i+1,i+2,i+3) (mod 4) are positively oriented depends
> on the parity of i
>
> --
> Monique Teillaud
> http://www.inria.fr/sophia/members/Monique.Teillaud/
> INRIA Sophia Antipolis - Méditerranée
> Institut National de Recherche en Informatique et Automatique
>
> Le 29/11/13 04:17, WChXiong a écrit :
>> Hi, I'm new on CGAL.
>> When I use CGAL::make_surface_mesh() to get surface mesh, I need to get
>> consistency normals of every facets.Here my code:
>> for (C2t3::Facet_iterator face= c2t3.facets_begin(); face !=
>> c2t3.facets_end(); ++face)
>> {
>> C2t3::Cell_handle ch;
>> ch = face->first;
>> int index = face->second;
>> Point pt0 = ch->vertex((index+1)&3)->point();
>> Point pt1 = ch->vertex((index+2)&3)->point();
>> Point pt2 = ch->vertex((index+3)&3)->point();
>>
>> Vector normals = CGAL::cross_product(pt1 - pt0, pt2- pt0);
>> normals = normals / CGAL::sqrt(normals * normals );
>> }
>> But the result is not correct. The normals is not consistent. The
>> points(pt0, pt1, pt2) of face are not oriented ?? How I can get
>> consistency
>> normals of every facets. Thank you.
>>
>>
>>
>> --
>> View this message in context:
>> http://cgal-discuss.949826.n4.nabble.com/How-I-get-the-right-normals-of-facet-tp4658491.html
>> Sent from the cgal-discuss mailing list archive at Nabble.com.
>>
>
>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- Re: [cgal-discuss] How I get the right normals of facet?, quaternionboy, 08/17/2020
- Re: [cgal-discuss] How I get the right normals of facet?, Sebastien Loriot (GeometryFactory), 08/18/2020
- Re: [cgal-discuss] How I get the right normals of facet?, quaternionboy, 08/18/2020
- Re: [cgal-discuss] How I get the right normals of facet?, Sebastien Loriot (GeometryFactory), 08/18/2020
Archive powered by MHonArc 2.6.19+.