1
$\begingroup$

I have a sequence of splines which its being resampled with a fix number each one, this number represents how many instances each spline will be instancing and its is saved in an field coming from somewhere else of my nodetree (not relevant right now for my question).

sequence of splines

enter image description here

Next, I'm using a another curve to divide my splines, this produces a new spline creating a incoherence between the number of splines (now there are four) and my field of integers with the resampling count for each spline, filled with 3 integers, this, as you can see in the images below, creates unwanted results as there is a missmatch between the number of splines and the number of integers.

enter image description here

enter image description here

So, how can I make GN distribute the points according to the new splines? So for the given example the splitted spline should instance one object for the first spline and two for the second spline, while the untouched splines should keep instancing 3 objects each one.

I'm providing a blend file with an example.

EDIT

From the comments let me share a simple sketch of what I'm looking for:

enter image description here

$\endgroup$
5
  • 3
    $\begingroup$ i am sorry, but also after reading 3 times, i have no idea what you want to do. Maybe a "i have this" sketch/image and a "i want this" sketch/photo would help? and it is not clear to me, how another spline "divides" your spline? as a cutter object? or how? $\endgroup$
    – Chris
    Mar 30 at 11:27
  • 1
    $\begingroup$ How would the split curve know you wanted 1 on the left and 2 on the right, as opposed to the other way round? $\endgroup$
    – Robin Betts
    Mar 30 at 11:28
  • $\begingroup$ @Chris my question can be confusing as I'm trying to simplify as much as possible the issue which is part of a much bigger project. In the blend file provided you can see how the splines are split and how this affects how instances are distributed. But to be super clear: 3 splines are resampled, each one with a count of 3, then the first spline is splitted into two, now I have 4 splines in total, the unsplited splines should be resampled with a value of 3 each one and the first (which has been splitted into two) should have one spline resampled with a count of two and the other with one $\endgroup$ Mar 30 at 12:34
  • 1
    $\begingroup$ @RobinBetts This is something I'm aware its very tricky, I would use the total length of the spline and the size of the instance as to decide how many intances fit into each spline $\endgroup$ Mar 30 at 12:40
  • $\begingroup$ Hi, @JuanManuelLynch ! Just a thought.. IMO, you would be better off defining your 'business rules' for the distribution of instances very closely, before presenting the technical aspect of the problem for solution, There's a risk that folks invest in solving the wrong problem for you :) $\endgroup$
    – Robin Betts
    Mar 31 at 7:32

1 Answer 1

1
$\begingroup$

This setup will move the instances that are instanced on the "removed" geometry to the nearest point that is left: Geometry Node Setup using Sample Index to move points away from deleted gemoetry

It has two major problems: It does not redistribute the moved points on the "remaining splines" (leaving piles if the geometry removes more than 1 point) and it only moves the points to even positions along the original curve in chunks decided by the Resample Curve-node right above the Raycast-node.

$\endgroup$
1
  • $\begingroup$ This is a nice solution but as @Alpine points out it doesn't redistribute the moved instances, maybe we can use it to rebuild the field attribute which contains the count for each spline. As you may already noticed the problem comes from the mismatch between indices from the attribute field which contains the count for each spline and the spline indices. When the spline gets split we have 1 more index in comparison to the attribute field with the count number. $\endgroup$ Mar 31 at 8:12

You must log in to answer this question.

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