Geometry Nodes

Split Curve.

Does anyone know how to split a curve using the exact control points positions? (using GN)
I need each curve segment separate.
I think I can do using the trim curve node, but how to get the factor or length of control points positions?

Here is my take on it :

The .blend : Split Curve.blend (142.2 KB)

The basic idea is :

  • store the handles position
  • convert the curve to polyline , then to mesh, then split edges
  • convert back to spline, set type to bezier, handle type to free
  • restore handle position

In the screen capture I’ve randomized the point position to make sure it works, that’s why there is a little gap between points.

It may fail in a few case where the curve handle isn’t by default…
You should see if that fit what you’re looking for !

4 Likes

I’m doing similar thing in my “curve mergeByDistance” group node, but I thought that has some way to convert control points position to curve factor parameter.

Anyway thank for your tip. :slight_smile:

1 Like

You already have access to that value :


But if you use that in the trim curve you’ll only end up with one segment.

Following the tutorial and using simple test models.

Need some tweaks on some rocks rotation following faces, but already very pleased with results and how powerfull some nodes are.

2 Likes

I followed this tutorial.

Looks good.
But from top view there is apparent gaps because fences do not orient to the next fence.
Is there a way to align object instance to next object instance ?

1 Like

It’s probably possible , but quite involved…

To align to the next instance I’ll do it this way : you need to access the next point with a field at index node, then create a vector by subtracting next position with the current one, and use it in an align euler to vector node. But there is probably a simpler way of doing it in the tutorial.
The curve tangent should be already pointing in the same direction.

I suggest you redo it or investigate why it works in his case.

1 Like

His example is a line with rotation only on Z, no rotation from top down view.
This is the Blender file if anyone interested in checking it.

Ok !!

I tried to align to the next point, it works…
The last one don’t because there isn’t a “next point” anymore…

procedural 4.blend (1.4 MB)

I’ve also simplified curve sampling.

2 Likes

Note about alignment:


… the resample length is a lie.
This is how you get the actual spline-segment length:

@sozap, you can use the Poly-Cuve-Info node in my Z-Curve-Sweeper pack to get the poly-tangent… works for multiple curves and cyclic curves also.

End-Point excluder should take into account cyclic curves:
image

Good luck.

7 Likes

GroupNode to get edge segment lenght and direction:

Using above group node to calc object instances orientation and length.


3 Likes

Hey guys, I’m pretty sure this is a bug but in case I’m just being stupid I’m posting this here too. I’m having the issue that, when I render with adaptive subdivision, any attributes I’ve passed from geometry nodes to the shader editor are lost. For example, in this test file I have passed the Normal from the mesh to an attribute, ‘testnormal’, in geometry nodes. I’ve then used the attribute in my shader, and this works fine in material preview and rendered view with normal subvision. However, with adaptive subdivision, it goes black. Is there a fix for this?


Good solution using object index to get next object, then use the vector for rotation.

Only thing to do is discard latest object otherwise it does not follow the curve, perhaps getteing the max “object index” and discard it.

So the resample node need some improvment ?

I’ll try your way also.
Thanks.

No… you just need to be aware that it does a “best-fit”.

Good luck.

2 Likes

Yes, you can use the domain size node to get the point count , so you know the last index…
Then maybe by using the same technique with field at index you get the orientation value of the penultimate object, and apply it to the last. Or simpler, just delete the last point or instance.
If you really need it I can look at it, but it could be a good exercise if you got time to learn !

1 Like

Interesting !
It’s probably not implemented, I don’t know if it’s a known missing feature , planned todo or simply a bug (like this was working before and after a rewrite it doesn’t anymore) .
You can try with vertex color , because it’s similar to attributes , to see how it react, and try to submit a bug… Could be great to test it in latest master (3.2 Alpha) and an older version like 3.0 / 3.1. To see if that’s already fixed, or if it was working before.

I tried changing the output attribute type in geometry nodes to colour and then reading the attribute in as a colour in the shader editor and now it works! It seems like the issue is only with attributes written to vectors.

Cool ! Well done !

@higgsas
Hi, the blend file you attached does not give the result in the image.
I use Blender 3.0, maybe that’s the reason?
Object “Plane” has no visible geometry in the viewport. (tabbing into edit mode shows me a plane alright, so does disabling the geometry nodes modifier)

Hi, yea the “3D points grid” node group fails because of “Float Compare” node is different in 3.1
Here is test file for 3.0
points_inside_volume3_0.blend (119.5 KB)

2 Likes