Making curve shorter

   1673   2   0
User Avatar
Member
44 posts
Joined: 4月 2017
オフライン
Hi! I have very simple task, but for some reason, its not working, and this drives me crazy.
Basically, I create curve from 2 points. This works.
I want to make it shorter - not working.

Node network itself is quite simple:



Inside "attribwrangle3", get 2 points, then substract them to get normalized direction



Then I simply prepare data to feed into curve node



And finally I can pretty looking curve



Now, if you look at the curve creation code, those lines:

if(reverse > 0)
{
eachPoint += @pointMoveDirection * -1;
reverse *= -1;
}
else
{
eachPoint += @pointMoveDirectionInverse * -1;
reverse *= -1;
}

they must move end points of curve towards each other and make it shorted. Instead, points are being move in some other direction.
But why? How? I substract P2-P1 and normalize. I have clean line as results. And still.

eachPoint += @pointMoveDirection * -1;

moves points in weird direction, and there are only 2 points within "connected1" group

Attachments:
node.png (15.4 KB)
ptt1.png (33.3 KB)
pp2ppr2.png (46.4 KB)
curvegood.png (342.9 KB)

User Avatar
Member
504 posts
Joined: 7月 2005
オフライン
Hi,

probably v@xyz is missing in the vector attribute (write v@xyz and not @xyz). Have you tried carve node, it works on every curve.
User Avatar
Member
44 posts
Joined: 4月 2017
オフライン
thanks!! you are a lifesaver carve node did exactly what I need
  • Quick Links