16
$\begingroup$

enter image description hereI want to create array on curve with geometry nodes, but I am unable to merge the instances so I get a continuous mesh, like a rail.

I tried to use the weld modifier but it does not work with geometry nodes and it won't weld loose parts.

Is it possible to merge vertices of the instances on a curve in geometry nodes, like the array modifier merge by distance function?

$\endgroup$
5
  • $\begingroup$ maybe you could provide a sketch or a screenshot of what you want to have? $\endgroup$
    – Chris
    Dec 7, 2021 at 10:45
  • 2
    $\begingroup$ Weld modifier works but you need to add a Realize Instances node just before the geometry output $\endgroup$
    – Gorgious
    Dec 7, 2021 at 10:58
  • $\begingroup$ that seems to weld the vertices of the instance, tried to define a vertex group for t what I want to weld, but it still ruins the topology $\endgroup$ Dec 7, 2021 at 12:40
  • $\begingroup$ .. I think you would need to deform the realised mesh along the curve.. $\endgroup$
    – Robin Betts
    Dec 7, 2021 at 17:17
  • $\begingroup$ How do I do that with geometry nodes? curve deform node is scheduled for 3.1 from what I see $\endgroup$ Dec 7, 2021 at 22:54

1 Answer 1

38
$\begingroup$

In order to have the vertices at the ends of your array-elements coincide closely enough to be welded, the array will have to be deformed to the curve.

This GN Group will create an array of your elements along the element X-axis:

enter image description here

This GN Group will deform geometry to a given curve, with its X-axis along it; a limited version of the Curve modifier:

enter image description here

It works by collapsing the mesh in Y and Z onto a curve, with its X stretched along it by the original length of the mesh, starting from length Offset along the curve. It then 're-inflates' the mesh, mapping the original Y and Z coordinates of the vertices on to the curve's Normal and (Normal x Tangent) vectors, at the relevant X.

These groups can be combined into an 'Array along Curve' group:

enter image description here

The result is similar to the use of Array and Curve modifiers, but giving you more access under the bonnet, should you need it.

enter image description here

(Blender 3.0)

$\endgroup$
8
  • 2
    $\begingroup$ amazing, thank you! $\endgroup$ Dec 13, 2021 at 7:02
  • 1
    $\begingroup$ @Nathan Here you go ... Not super-chuffed with it yet. 1. Sample Curve doesn't give you Radius. 2. You can't transfer attributes from a curve-target. So the only way I could think of, so far, is to resample the curve as points, and transfer from the new points. But I really want to sample the radius exactly at the collapsed mesh-points, so no sampling error. Just up the street of your ingenuity, surely? ; ) ... $\endgroup$
    – Robin Betts
    Jan 26 at 20:03
  • 1
    $\begingroup$ @Nathan Ahhhh.. I've got a way, I think.. but it's a lot more nodes, and too late here, today. $\endgroup$
    – Robin Betts
    Jan 26 at 20:12
  • 1
    $\begingroup$ Thanks for looking-- I'll just ask a new question, with how far I've gotten so far. Seems like there should be something more elegant, not sure why radius isn't handled the same as tilt.... $\endgroup$
    – Nathan
    Jan 26 at 23:37
  • 1
    $\begingroup$ Hi @Nathan ! I had to be away today.. have had a look at the whole problem since.. the only solution I can find is over-sampling the curve on a 'transfer radius' target branch, so the 'Nearest' error is as small as possible. Very frustrating. I think the best I can do as an answer to your other Q is to explain why I'm stuck.. If only Sample Curve returned the radius along with everything else.. then no problem. If Transfer Attribute could interpolate over other domains than faces, no problem either. (Once a curve is in GN, only linear interpolation is available, it loses settings)... :( $\endgroup$
    – Robin Betts
    Jan 27 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.