Closed KeepFaithMe closed 4 years ago
There is nothing working out-of-the-box but as pointed out by @maxGimeno here, you can use a uv-map per vertex and even track what happened using the visitor concept like in this example.
@KeepFaithMe Hello, have you solved your problem? Now I have this problem
The cgal can't handle this problem,can you show your problem detailed?
------------------ 原始邮件 ------------------ 发件人: "simonasdmd"<notifications@github.com>; 发送时间: 2020年1月8日(星期三) 上午9:50 收件人: "CGAL/cgal"<cgal@noreply.github.com>; 抄送: "张川"<1071244263@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [CGAL/cgal] Is the CGAL ability to simplify the texture? (#4385)
@KeepFaithMe Hello, have you solved your problem? Now I have this problem
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
The cgal can't handle this problem,can you show your problem detailed? … ------------------ 原始邮件 ------------------ 发件人: "simonasdmd"<notifications@github.com>; 发送时间: 2020年1月8日(星期三) 上午9:50 收件人: "CGAL/cgal"<cgal@noreply.github.com>; 抄送: "张川"<1071244263@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [CGAL/cgal] Is the CGAL ability to simplify the texture? (#4385) @KeepFaithMe Hello, have you solved your problem? Now I have this problem — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@KeepFaithMe
I want to simplify the model with texture mapping. But CGAL only simplifies the vertex mesh. There is no processing of the texture.
The cgal can't handle this problem,can you show your problem detailed?
That's not what I said. You do have access to the two vertices being merged before it is done thanks to the visitor. That way you can apply the operation that is relevant for your application on the texture map.
@sloriot hi~ You mean to store two copies of vertex and texture coordinates. Then use "SMS:: edge_collapse" to simplify. And put them together?
Maybe I did not understand the initial question. I thought that the question was "how to simplify a texture while simplifying a mesh".
@sloriot Your understanding is correct
Then look at my initial comment about the visitor. The doc is linked and it should be easy to give it a try.
@sloriot I want to simplify an obj file with textures. However, the current process of reading "surface" and then using "SMS:: edge" collapse "does not deal with the texture. Please tell me how to do this. I read the link, but I didn't get useful information. Can I mark it if I can. Thank you very much for your help.
The first step to to get the UV map (i.e. the 2D parameterization) of the texture at each vertex of the input mesh. Then using the visitor upon the merge, you can update the value in the UV map for the vertex kept.
there is a paper named Simplifying Surfaces with Color and Texture using Quadric Error Metrics,You can reade it,and the algorithm is in the vcglib,you can use the lib simplify you mesh with texture.
------------------ 原始邮件 ------------------ 发件人: "simonasdmd"<notifications@github.com>; 发送时间: 2020年1月8日(星期三) 下午2:33 收件人: "CGAL/cgal"<cgal@noreply.github.com>; 抄送: "张川"<1071244263@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [CGAL/cgal] Is the CGAL ability to simplify the texture? (#4385)
@sloriot I want to simplify an obj file with textures. However, the current process of reading "surface" and then using "SMS:: edge" collapse "does not deal with the texture. Please tell me how to do this. I read the link, but I didn't get useful information. Can I mark it if I can. Thank you very much for your help.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@KeepFaithMe Have you implemented it with vcglib
@sloriot I see what you mean.
That's where the visitor comes in. I assume you have a mapping vertex -> UV. The simplification works by collapsing edges, meaning at each step two vertices get merged, only one being kept (and it s point coordinate being updated). Using the visitor, you have access to the two points being merged, the one kept and the updated coordinates (called placement). Then you can update the UV map of the vertex kept before each collapse and maintain the texture mapping.
@sloriot I understand the process. Last question. How to use visitor. Is it in the process of "SMS:: edge_collapse"? If you can take a screenshot and say the additional location or example.
the vcglib implement this algorithm,you can use it directly
------------------ 原始邮件 ------------------ 发件人: "simonasdmd"<notifications@github.com>; 发送时间: 2020年1月8日(星期三) 下午3:06 收件人: "CGAL/cgal"<cgal@noreply.github.com>; 抄送: "张川"<1071244263@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [CGAL/cgal] Is the CGAL ability to simplify the texture? (#4385)
@KeepFaithMe Have you implemented it with vcglib
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@KeepFaithMe I haven't used vcglib. I still want to use CGAL if possible. Can you provide your process code? I want to use it as a reference. thank you very much.
firstly CGAL can't handle this problem you have met,secondly the vcglib have examples which you can see .
------------------ 原始邮件 ------------------ 发件人: "simonasdmd"<notifications@github.com>; 发送时间: 2020年1月8日(星期三) 下午3:30 收件人: "CGAL/cgal"<cgal@noreply.github.com>; 抄送: "张川"<1071244263@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [CGAL/cgal] Is the CGAL ability to simplify the texture? (#4385)
@KeepFaithMe I haven't used vcglib. I still want to use CGAL if possible. Can you provide your process code? I want to use it as a reference. thank you very much.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@sloriot I understand the process. Last question. How to use visitor. Is it in the process of "SMS:: edge_collapse"? If you can take a screenshot and say the additional location or example.
See this example. I would say you only need to implement the OnCollapsed(profile, placement)
function (you can remove the other one as default will be inherited). The vertices to be collapsed can be found in the profile.
@sloriot I didn't find a place to call in this example. I don't know when to judge the use of it.
Have a look at the gist
It is simplisitc in the sense that I just take the midpoint of the uv-values of the two vertices that get collapsed, but it illustrates what Sébastien had in mind.
This could be a nice topic for CGAL@GSoC2020
@afabri I can't access your link. Can you take a screenshot.
It'is public and on github. You can also git clone it https://gist.github.com/717c64e84f248a1c78cfdfbadd9eb9f9.git
@afabri @sloriot @KeepFaithMe @MaelRL I have to try. None of the cases we discussed before are feasible. Because we have to put the case on the premise that "a vertex corresponds to a texture coordinate (one-to-one relationship)", but in fact, a vertex has multiple different texture coordinates.
This is an example of 3DMAX export.
Maybe have a look at the section Cutting a Mesh in the manual. There we associate the uv-value to a halfedge (the target vertex). It won't solve your problem out of the box, but at least it illustrates how we deal with several uv-coordinates for the "same" vertex.
@afabri This is also how I implemented the ply version of surface_mesh for saving textured meshes. here is an example of how to add these properties to a SM
CGAL does not read 'VT' for obj
After I simplify the triangulation, I don't know how to operate it.
CGAL does not read 'VT' for obj
Indeed, we use ply for meshes with UVs.
hi @maxGimeno I don't think CGAL should be limited to ply. Obj has a wider scope. Can we support it later?
Sure, just fill a feature request
Sure, just fill a feature request
or develop and contribute, or pay for the development, in case it is important for your business.
Please use the following template to help us solving your issue.
Issue Details
I use the CGAL to simplify the mesh,and the mesh contains the texture coordinates.When I execute the process of simplifying the mesh,the geometric vertex changed,at the same time, I need the texture coordinayes to change in order to fit my geometric vertex . Whether there is a method to handle it??
Source Code
If your issue arises by using CGAL in your own source code, please provide a minimalist example that we can compile easily to reproduce the bug. If your issue arises from using a CGAL program (demo, example, etc.), please let us know which one. Helping you solving an issue is much easier and efficient if we can reproduce it.
Environment