7
$\begingroup$

The spiral curve node in geometry node is the shape of circle by default, how can I change the shape of the spiral by using my curve outline?

Like this picture below, it's using rectangle outline.

enter image description here

curve.blend

$\endgroup$

2 Answers 2

7
$\begingroup$

Here's another take on it:

enter image description here

This GN modifier takes any provided 2D curve, and converts it to a parametric spring. (The curve can be closed, but must not be filled.. that changes it to a mesh, which doesn't work, here)

  • It cracks the curve open. (We only need the points, it doesn't need to be cyclic).
  • It generates a straight-line curve, with incoming * turns points.
  • Position is transferred to the line from the incoming template, by Index mod(number of points in template) resulting in the line winding round and round the template, in the flat.
  • Finally, the points of the wound line are offset in Z by a provided multiple of their Spline Parameter.

enter image description here

You could generate the spring-shape inside the group, instead, or replace the circular wire-profile with some other curve cross-section, if you wanted.

Here's the Blend (Blender 3.1b, but could work in 3.0, by replacing the DomainSize node with an Attribute Statistic node, to make the point-count.. as here )

$\endgroup$
3
  • 1
    $\begingroup$ WOW!!!It's really solved my problem, please let me call you The Spring Master, thank you again! $\endgroup$
    – Ben
    Mar 3, 2022 at 20:49
  • 1
    $\begingroup$ man, that's fabulous! and i love that it works for all curves! $\endgroup$
    – Chris
    Mar 4, 2022 at 3:39
  • $\begingroup$ @Chris Thanks! But.. doooh.. I just realized I could get rid of quite a few nodes by deforming a ready-made spiral, the way ben suggested, instead of starting from a line. Never mind.. leave it. :) $\endgroup$
    – Robin Betts
    Mar 4, 2022 at 7:12
4
$\begingroup$

Sorry, but my mathematics isn't the best so i have this dirty solution which works - but i am sure Robin can make it better ;)

What a basically do is making a rounded rectangle shape, turn that into a curve and give that curve enough count and with that count i just stretch the points on z. "Normally" with a clean mathematics you could calculate all these points.

So here is my node setup:

enter image description here

and this is my result:

enter image description here

$\endgroup$
5
  • $\begingroup$ Thank you very much! I would like to ask an additional question, because I already have a closed section of the curve, how should I correctly replace the first half of your nodes, I can't try it out right now. I have uploaded the curve segment file. $\endgroup$
    – Ben
    Mar 3, 2022 at 19:41
  • 1
    $\begingroup$ Phew! That's quite a sweat! What's your version? Have I 'cheated' by using a later one? $\endgroup$
    – Robin Betts
    Mar 3, 2022 at 20:18
  • 1
    $\begingroup$ No, I am always using the latest alpha 🤗 $\endgroup$
    – Chris
    Mar 3, 2022 at 20:26
  • 1
    $\begingroup$ You can fillet a curve-rectangle in 3.1+, to round its corners, but I have to say, i've found it a bit janky. I did cheat by outsourcing the shape :) $\endgroup$
    – Robin Betts
    Mar 3, 2022 at 20:33
  • $\begingroup$ @RobinBetts Thank you for giving me an easier way! $\endgroup$
    – Ben
    Mar 3, 2022 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .