How to create uv along the line vector in Polyexpand2d ?

   3237   9   2
User Avatar
Member
54 posts
Joined: 10月 2017
Offline
Your text to link here… [www.sidefx.com]
this can make poly roads ,but how to create correct uv? any example?thanks!
User Avatar
Member
670 posts
Joined: 9月 2013
Offline
You can activate the edgedist attribute from polyexpand for one UV-direction.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
54 posts
Joined: 10月 2017
Offline
Konstantin Magnus
You can activate the edgedist attribute from polyexpand for one UV-direction.
thanks~,but still hard to get the uv…. edgedist is only v direction to get,how to get the u direction?
Edited by dreamerflyer19 - 2019年5月9日 06:31:36

Attachments:
roaduv.jpg (190.6 KB)

User Avatar
Member
191 posts
Joined: 10月 2018
Offline
You can create a “u” attribute on the curves as a point attribute using $PT/($NPT - 1). Then polyexpand2d turning on the edgedist, then promote the u to vertices and in a vertex wrangle use this:
v@uv = set(f@u, f@edgedist / `ch("../polyexpand2d1/offset")`, 0);


But for another process, how about using a sweep sop? Use your curves for your road with a “u” attribute, then a straight line with a “v” attribute for the road width. And combine them later as the uv attribute.

I did have to make the u a point attribute in both cases and promote it to vertices after doing the polyexpand or sweep…
User Avatar
Member
54 posts
Joined: 10月 2017
Offline
mkps
You can create a “u” attribute on the curves as a point attribute using $PT/($NPT - 1). Then polyexpand2d turning on the edgedist, then promote the u to vertices and in a vertex wrangle use this:
v@uv = set(f@u, f@edgedist / `ch("../polyexpand2d1/offset")`, 0);


But for another process, how about using a sweep sop? Use your curves for your road with a “u” attribute, then a straight line with a “v” attribute for the road width. And combine them later as the uv attribute.

I did have to make the u a point attribute in both cases and promote it to vertices after doing the polyexpand or sweep…
thanks your idea,but i think , it is hard for outside point to set the “u” attribute according the center curve's point.
User Avatar
Member
670 posts
Joined: 9月 2013
Offline
Maybe this file helps:

Attachments:
polyexpand_tex.hipnc (173.4 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
54 posts
Joined: 10月 2017
Offline
Konstantin Magnus
Maybe this file helps:
thanks a lot!Get some problem ,intersection and end part of the line,UV distort very hard,how fix it?
Image Not Found
Edited by dreamerflyer19 - 2019年5月11日 01:05:41

Attachments:
polyexpand_tex.hipnc (210.8 KB)
intersectuv.jpg (669.0 KB)

User Avatar
Member
670 posts
Joined: 9月 2013
Offline
Better treat crossings and road segments separately. I haven't seen too many convincing solutions for crossings, though.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
31 posts
Joined: 3月 2017
Offline
Anyway, in reality you have only a few types of crossings like: X shape, T shape and ring.. If you want quads only, then you can extrude each curve separately which will result in overlaping intersections. Then you can offset intersecting polygons along Y axis a little bit to avoid Z-fighting.
My take on this - quads only, except for crossings.

Attachments:
road_uv.hipnc (214.8 KB)

User Avatar
Member
54 posts
Joined: 10月 2017
Offline
rpopovici
Anyway, in reality you have only a few types of crossings like: X shape, T shape and ring.. If you want quads only, then you can extrude each curve separately which will result in overlaping intersections. Then you can offset intersecting polygons along Y axis a little bit to avoid Z-fighting.
My take on this - quads only, except for crossings.
great idea! want make better~~,whether can add new point on the triangle at the end of each line ,I think will make a correct uv~ u dir is from middle point ,and outside is v dir .
Edited by dreamerflyer19 - 2019年5月11日 14:12:28

Attachments:
uvTri.png (711.8 KB)

  • Quick Links