Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] How to obtain vertex UV from HalfEdge

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] How to obtain vertex UV from HalfEdge


Chronological Thread 
  • From: ben morris <>
  • To:
  • Subject: Re: [cgal-discuss] How to obtain vertex UV from HalfEdge
  • Date: Sat, 16 Jan 2021 22:14:24 +0000
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:nLQfoxCIPkMx3eBxwrHkUyQJP3N1i/DPJgcQr6AfoPdwSP37rsiwAkXT6L1XgUPTWs2DsrQY0ruQ6/yrADFRqdbZ6TZeKcMKD0dEwewt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEtfre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZmJ6or1hfErXREd/lWyG5sOFmfmwrw6tqq8JNs7ihduegt+9JcXan/Yq81UaFWADM6Pm4v+cblrwPDTQyB5nsdVmUZjB9FCBXb4R/5Q5n8rDL0uvJy1yeGM8L2S6s0WSm54KdwVBDokiYHOCUn/2zRl8d9kbhUoBOlpxx43o7UfISYP+dwc6/BYd8XQ3dKU8BMXCJDH4y8dZMCAOUPPelar4fzqVgAowagCwawH+7g0CNEi2Xs0KEmz+gsEwfL1xEgEdIUt3TUqc34O7wMXuCz0aLIyDLDb+lM2Tf884jDbxcsruqSUrJ2asre008vGxnAjlWXs4zlJTKV1v8WvmiU6OpgUu2vi2o5pAF0uDevx8MshpPViYISz1DJ7CN0y5s6KtOkUkB0e8KkEIdOuCGAMYt7WswvTn9stSs1yLALpJy2cScFxpooxxDSafOKfoiM7x79WuucIzN1iXF4dL+7gxu/80utxO3zW8Wo0FtEoCVIn9rKu3sQ2RLT7c2HReF8/kenwTuAyw/T5ftAIUwukqrbMZEhzqYxlpoVq0TDHzX5lF/4jK+McEgv5+um6/z/b7n4upORM5V4hwL+P6g0h8CyAOY1PhIOUmSG/+m3yaft8lfjQLpQi/07iqnZv47eJcQcvqO5BhVa0ocn6xqmCzem3skUkWAJLF9FZR6LlYfpO1bJIPD3CfewnU6gnytsx/DDJrHhA5PNIWbfkLr5Y7px90pRxBAwwN1f/Z5YF7AMLfDpVkLxqdDUFho5PBa1w+bjBtV9zIQeWWeXD6CCLqzSt0SI6fgpI+WWYY8Vvyz9K+Ik5/71lnI5llgdfa6m3ZsTdn+4G+5pI0SdYXb2ntgBFmIKshIkTOP2kF2CTSJTZ3GqUq0g6TE0EoamAZ7eSYCsm7yOwDq7HoZNZm1dEVCNEXLod52eVPsWaSKSJNVhkj0eWrS7RY8hz0LmiQnh1rAyLvbI4jZK8tX4xd1t7qvSkwsz/Hp6FYOGwmSVRiZ1mG0PADQ51aQ6rU1mwUqYyvtFhedFH/xP4vccUhsmLYWOiKthGtXqU0TAeM2IQRCoWJK9EDQpR5UwxdEJJE1yEtHnghHY1DexGOwokaeWDqA54r6J32TtP90vjDHdxaw5hh8nRNFOPCuonOlk5g3LDsnIlUue0K2lfKBZ0C/W/3qY1jmyuxRTXwd0FKnERnsCfVD+rNLj50qEQaX9J64gN15LxMjKL6xQcNzyxQFMSfH4MdKYZmWrgWarLRmPwbyIYY/jemFb1yLYXhtX2zsP9GqLYFBtThyqpHjTWWQ3SADfJnj0+Ow7k0uVC085ywbQMh9k3ruxvxob3LmSFqpV0bUDtyMs7T5zGQTlho6EO5+7vwNkOZ5kT5Yl+l4eizDWsAtyOpGlJqFmwFUZdlYv5hK851BMEoxF1PMSgjYvxQt2J7if1QofJTyf2p/0N7jeK2209xeqOffb

Many many thanks Maxime :-)

On Sat, Jan 16, 2021 at 5:41 PM Maxime Gimeno <> wrote:
Hi,
The UV map is per halfedge because you can have different values per vertex, depending on the face you are. If you don't care and only need one value per vertex, you can use 
`foreach(vertex v : vertices(mesh)` to iterate the vertices, and `halfedge(v, mesh)` to get a halfedge associated to the vertex v. With those you should be able to get what you want.


Le sam. 16 janv. 2021 à 13:21, ben morris <> a écrit :
Hi, I've generated a UV map for a closed mesh using the orbifold parameterization example below: 


The UVs are stored in the half edges (uvmap) but I need to obtain the UV for each vertex (not half edge). Could you point me to an example that, given a property map of half-edge to UV (the uvmap variable in the above example) how I can obtain the UV for each vertex? I see the HalfEdgeDS has a vertices_begin()/end() api so should I, for each vertex, iterate over all half-edges, then for each vertex in the half edge if it matches my vertex accumulate the UV half edge value and then divide at the end by the number of half-edges that contributed to the vertex's UV? If this is naive, or expensive what would be the best approach?

Many thanks in advance,
Ben

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




Archive powered by MHonArc 2.6.19+.

Top of Page