7

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

Ben
  • 91
  • 2

2 Answers2

7

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 )

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • 1
    WOW!!!It's really solved my problem, please let me call you The Spring Master, thank you again! – Ben Mar 03 '22 at 20:49
  • 1
    man, that's fabulous! and i love that it works for all curves! – Chris Mar 04 '22 at 03:39
  • @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. :) – Robin Betts Mar 04 '22 at 07:12
4

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

Chris
  • 59,454
  • 6
  • 30
  • 84
  • 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. – Ben Mar 03 '22 at 19:41
  • 1
    Phew! That's quite a sweat! What's your version? Have I 'cheated' by using a later one? – Robin Betts Mar 03 '22 at 20:18
  • 1
    No, I am always using the latest alpha – Chris Mar 03 '22 at 20:26
  • 1
    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 :) – Robin Betts Mar 03 '22 at 20:33
  • @RobinBetts Thank you for giving me an easier way! – Ben Mar 03 '22 at 20:50