Poly strips to curve/spline
2917 11 0- swarmagent
- Member
- 17 posts
- Joined: March 2017
- Offline
- animatrix_
- Member
- 4516 posts
- Joined: Feb. 2012
- Offline
Hi,
It depends on the topology but if you have the base edge known, you could walk the side edges, gather them in an array, create midpoints for these edges and then connect them all in VEX if you wanted:
This might also give you some ideas:
It depends on the topology but if you have the base edge known, you could walk the side edges, gather them in an array, create midpoints for these edges and then connect them all in VEX if you wanted:
This might also give you some ideas:
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
- swarmagent
- Member
- 17 posts
- Joined: March 2017
- Offline
Thank you animatrix_!
Your suggestion and the video was educational. I should expand on my google search keywords.
I've spend several days trying solving my problem and I'm not really sure how to proceed.
In the image you can see one of the worst case scenarios. The hair strand is f'd up to the max! It's triangulated, points are out of order, no uv, and the normals are out of whack. How in the world am I supposed to create a new strand/curve from that?
The goal is to either reconstruct the card to quads, set proper point order, and uv's map it to 0-1. Ideally I'd like to make a curve our of the mesh for good measure and future control.
I really want to just delete those strands, and just be done, but my OCD and hunger for a challenge says otherwise. That hair strand is just one of the instance, it's part of a game dev file I cannot share, but I can isolate it and share it if anyone need's the hip file.
I thank anyone who is up for the challenge and willing to help he out.
Your suggestion and the video was educational. I should expand on my google search keywords.
I've spend several days trying solving my problem and I'm not really sure how to proceed.
In the image you can see one of the worst case scenarios. The hair strand is f'd up to the max! It's triangulated, points are out of order, no uv, and the normals are out of whack. How in the world am I supposed to create a new strand/curve from that?
The goal is to either reconstruct the card to quads, set proper point order, and uv's map it to 0-1. Ideally I'd like to make a curve our of the mesh for good measure and future control.
I really want to just delete those strands, and just be done, but my OCD and hunger for a challenge says otherwise. That hair strand is just one of the instance, it's part of a game dev file I cannot share, but I can isolate it and share it if anyone need's the hip file.
I thank anyone who is up for the challenge and willing to help he out.
Edited by swarmagent - Feb. 13, 2022 14:07:27
- tamte
- Member
- 8555 posts
- Joined: July 2007
- Offline
Yes, you should isolate and send the file or geo if you are expecting a solution that works for your case or a tangible solution instead of just steps
But in a nutshell you can just
- keep only border edges
- split it at corner points based on some threshold
- keep 2 longest curvers ( out of 4 that you will get)
- resample both to the same number of points
- create third with average point positions between them or just blend one of them mid way
But in a nutshell you can just
- keep only border edges
- split it at corner points based on some threshold
- keep 2 longest curvers ( out of 4 that you will get)
- resample both to the same number of points
- create third with average point positions between them or just blend one of them mid way
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- mrCatfish
- Member
- 731 posts
- Joined: Dec. 2006
- Offline
- swarmagent
- Member
- 17 posts
- Joined: March 2017
- Offline
Thank you tamte and mrCatfish.
I've tried your methods and it sparked a few new ideas, but I'm still stuck and dumb.
Also for some reason my for loop really messed up the normals (seen on my initial image). Resetting the cheche fixed it. Here is clean and insolated example of my work in progress. Also pardon all of my typos (freezing fingers) :P
I've tried your methods and it sparked a few new ideas, but I'm still stuck and dumb.
Also for some reason my for loop really messed up the normals (seen on my initial image). Resetting the cheche fixed it. Here is clean and insolated example of my work in progress. Also pardon all of my typos (freezing fingers) :P
Edited by swarmagent - Feb. 14, 2022 14:39:03
- tamte
- Member
- 8555 posts
- Joined: July 2007
- Offline
- swarmagent
- Member
- 17 posts
- Joined: March 2017
- Offline
- tamte
- Member
- 8555 posts
- Joined: July 2007
- Offline
- swarmagent
- Member
- 17 posts
- Joined: March 2017
- Offline
- Vivimagic
- Member
- 10 posts
- Joined: March 2017
- Offline
Sorry to bring this topic out but I have been given a alembic file which has come from Maya using the hair cards method.
I am trying to get splines for each hair card and I am not having any luck with any of the setups provided above.
Any idea on how I can get a spline for each polygon hair strip?
I am trying to get splines for each hair card and I am not having any luck with any of the setups provided above.
Any idea on how I can get a spline for each polygon hair strip?
Edited by Vivimagic - Feb. 9, 2024 09:35:17
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Hi Vivimagic,
you could make use of the hair cards' texture coordinates.
To project curves along the center of polystrips, maximize their UV islands and sample their world space positions to a new set of curves. Optionally, also transfer the path information from the first primitive found within each class.
you could make use of the hair cards' texture coordinates.
To project curves along the center of polystrips, maximize their UV islands and sample their world space positions to a new set of curves. Optionally, also transfer the path information from the first primitive found within each class.
// vertex wrangle string geo_uv = geounwrap(0, 'uv'); int class = prim(0, 'class', i@primnum); string grp = '@class==' + itoa(class); vector bb = relbbox(geo_uv, grp, v@uv); v@uv = bb;
// point wrangle // PARAMETERIZATION float u = vertexcurveparam(0, i@vtxnum); vector uvw = set(0.5, u, 0.0); // POSITION string grp = '@class==' + itoa(i@primnum); vector pos = uvsample(1, grp, 'P', 'uv', uvw); // PATH int pr = findattribval(1, 'prim', 'class', i@primnum, 0); string path = prim(1, 'path', pr); // ATTRIBUTES v@P = pos; s@path = path;
Edited by Konstantin Magnus - Feb. 9, 2024 12:44:48
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- Quick Links