csg-toolkit icon indicating copy to clipboard operation
csg-toolkit copied to clipboard

UV not calculated for boolean operations

Open Yatsomi opened this issue 7 years ago • 5 comments

hi dude, i think its usefull to calculate uv after boolean ops, in many cases we have a mesh with texture on it to cut. tnx

Yatsomi avatar Aug 15 '17 13:08 Yatsomi

Hi. I have looked at this, its not really very simple when dealing with intersections and joins. The objects need to become multiple objects (per material join) which complicates things in the code.

You are welcome to have a look and see if you can create a patch for it.

dlannan avatar Aug 17 '17 14:08 dlannan

i looking for a tool to do csg on Quad in unity in entire internet, but its just ur tool, and im not that pro to write a csg for myself :). i just use subtract operation on Quads, its all i want, subtract a quad with 1 material, is it still so hard to achieve this? tnx dave

Yatsomi avatar Aug 26 '17 12:08 Yatsomi

omg such a noob i'm! its just a quad. uv generated by vector2(1 - vertice.x , vertice.y) :) quad sub

Yatsomi avatar Aug 26 '17 20:08 Yatsomi

Hi, Not quite right, it depends on a few things (the uv needs to be scale to the object size) - 1.0 - (vert.x / objwidth) and vert.y / obj.height . Its not exactly this, if the texture mapping has repeats and previous mapping offsets. You can do the above in texture space, and there should be shaders/materials available that you should be about to use to do this anyway.

Heres a solution that would work for your use case: https://stackoverflow.com/questions/41362625/how-to-calculate-uvs-of-a-flat-polygon-mesh

I cant really apply this. I may make a cubemap available but its not very useful in three dimensions. Hope the above helps.

dlannan avatar Aug 27 '17 02:08 dlannan

y ur right, tnx so much dave, that was exacly what i looking for! wish u best bro :)

On Sunday, August 27, 2017 7:02 AM, dlannan <[email protected]> wrote:

Hi, Not quite right, it depends on a few things (the uv needs to be scale to the object size) - 1.0 - (vert.x / objwidth) and vert.y / obj.height . Its not exactly this, if the texture mapping has repeats and previous mapping offsets. You can do the above in texture space, and there should be shaders/materials available that you should be about to use to do this anyway.Heres a solution that would work for your use case: https://stackoverflow.com/questions/41362625/how-to-calculate-uvs-of-a-flat-polygon-meshI cant really apply this. I may make a cubemap available but its not very useful in three dimensions. Hope the above helps.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Yatsomi avatar Aug 27 '17 18:08 Yatsomi