tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/6769-points-and-curvesNodeBox: Discussion 2022-05-24T18:27:55Ztag:support.nodebox.net,2012-11-01:Comment/542852722022-05-14T12:26:37Z2022-05-14T12:26:37ZPoints and curves<div><p>Floris,</p>
<p>I simplified and fixed your spiral network (screenshot and zipped files attached).</p>
<p>In the top of your network you make a nice ball by zigzagging points around a circle and smoothing out the path with my old fit_curve node. I simplified the zigzagging part, but it still works just like your original.</p>
<p>In the bottom half you form a point table, siphon off all the red (type 3) point rows, then attempt to move the first and last of those points before putting everything back together. The mistake you make was using a make_point node to insert the modified points. Make_point always creates type 1 points.</p>
<p>As it turns out, there is a much easier way to do this. Simply use a translate node. Translate moves a point without changing its type. I made a simple subnetwork to do this and then used it on the first and last red points using the values you supplied.</p>
<p>If you render the end result and change the offsets for those two points, you can see the red dots moving - which in turn causes the string on either end of your ball to curve a bit. You could use this same principle to change all the red dots.</p>
<p>Your final result is indeed cool, but is quite different that the ball you started with. This has nothing to do with mucking with those two red dots. It happens because you applied a second fit_curve to the already curved path, producing meta curves. If you wanted to see your modified ball, all you had to do was lookup the points and connect them. In my version I show the modified ball in blue and your meta curve in red.</p>
<p>As an added bonus, I threw in another node I made recently: set_type. This simply takes a point and changes its type to 1, 2, or 3. You don't need it for what you are currently doing, but it might come in handy in some future projects.</p>
<p>As for the fit_curve node, I dropped it from my library because I realized there was already a standard NodeBox node that does the same thing: round_segments. Actually, though, it's not <em>quite</em> the same. It transforms a polyline path into a curved spline, but the curves come out slightly different. Most of the time this doesn't matter, but sometimes it does.</p>
<p>I have also on occasion had to go back and dig out fit_curve, so I guess it was wrong of me to remove it from the library. I will put it back in the next version.</p>
<p>Hope that clears things up. Please keep the conversation going if you have any more questions.</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/542852722022-05-24T18:27:46Z2022-05-24T18:27:46ZPoints and curves<div><p>Thanks John. So, to iterate, what I did wrong is that I stacked a fit_curve node onto a fit_curve node, thereby altering the curvature. Another thing I didn't know was that the make_point node would always result in a type 1 point. Thanks for the bonus node as well. As I said, I just got into these points and curves, but it might prove useful. Your help already has been.</p>
<p>Floris</p></div>florisdejonge