offsetting cross sections of sweep by curvature - how to?

   1139   2   0
User Avatar
Member
106 posts
Joined:
Offline
Hi,
currently I am sweeping some road surfaces using polyline curves. I am using a curvature attribute to modify a @pscale attribute that scales the cross sections in the sweep if the road curve has steep curvature. This works just fine. However, it would be great if there was an easy way to, in addition, offset the cross-sections (on creation) such that the "inner" part of the road surface remained at the same curvature as the backbone curve, whereas "outer" part gets the scaled offset. This, in order to avoid that the inside gets too pinched when the turns are steep. It would have to work in such a way that it responds to left vs. right turns correctly. I am calculating a sign variable that could be used for this...
Currently most of what I already have is solved via vex, so a vex solution would be preferable, but I'm open to any suggestion.

Thanks,
Dag
User Avatar
Member
152 posts
Joined: Aug. 2012
Offline
Orient Along Curve's "out" vector attribute can be used with a Peak operation
v@P += v@out * chf("offset")
. You can use measured curvature to control the offset, thus controlling the offset placement of cross sections along the original curve.
Edited by Fenolis - Jan. 29, 2025 19:51:21
User Avatar
Member
106 posts
Joined:
Offline
@Jikian - yes, of course! Thanks for the tip. I've done this now, and with a little bit of added logic it works perfectly fine and is controllable. Thanks again!
  • Quick Links