Normal corners-Replicate "Stretch Around Corners" from sweep

   2394   4   1
User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
Hello,
I need to get the correct normal length on the points corners like the sweep node does with the "Stretch Around Corners" option turned on or when using PolyExtrude.
Thank you

Attachments:
ReplicateStretchAroundTurns.hiplc (143.3 KB)
StretchAroundCornersSweep.png (47.8 KB)
StretchAroundCornersExemple.png (787.4 KB)

User Avatar
Member
495 posts
Joined: July 2005
Offline
Hi,

multiply the normal with 1/sin(0.5 * angle), where angle is the angle between the neighboured points.

@but this will only work for special cases like planar curves ...
Edited by Aizatulin - March 28, 2021 04:13:27

Attachments:
ReplicateStretchAroundTurns_mod.hipnc (159.3 KB)

User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
Hey, thanks a lot !
It's working fine for planar curve indeed. Do you have an idea how to adapt that to primitives like in my example ?
I will find a way to adapt your solution to my problem otherwise.
Thank you !
User Avatar
Member
495 posts
Joined: July 2005
Offline
Here is another method using projections, which should work better for non planar curves. It seems to give similar results compared to sweep but not exactly the same. The main idea is projecting the (modified)up vectors on different planes, to keep the distance of the offset segments constant.

I've used up vectors, because v@N is used as tangent very often. But you can always remap the attributes if you like. My example should work for open and closed curves.
Edited by Aizatulin - March 30, 2021 10:37:06

Attachments:
stretch_around_turns.hipnc (111.1 KB)
stretch_around_turnsA.hipnc (140.7 KB)

User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
Wow, this is great! Thanks a lot!
  • Quick Links