I’m trying to brute force a solution to a problem where I want to make a curve of a fixed length and have it constrained by two angles at each end of the curve. To achieve this, I’ve chosen the Tangent Curve block.

For my problem, this works in the way where I’ve fixed one of the end points (End Point A), and I move the other end point 1mm at a time to make somewhere in the range of 1000 End Point Bs. I then give the desired tangents to each set of end points, and look at the Length output of the Tangent Curve block, and select the one curve that is closest to my desired curve length [1].

The issue arises when I try to use this to create multiple output curves [2] based on multiple starting angles. i.e. it only works when I provide it one pair of tangents that it matches with each 1000 pairs of end points.

A solution to this in my mind, is to simply duplicate the entire tree of points (for a range of 75 tangents, this would be duplicated 75 times, making 75,000 pairs of end points… hence the brute force). I.e. currently the points are in a tree structure {A}, where A is from 0->1000, but I would want it in a structure {A;B}, where A is 0->75, and B is 0->1000. I would then provide each of the 75 lists of lists to each 75 pairs of tangents. From this notation you probably can tell that I tried path mapper, but failed to really make it work well.

I have no idea if any of this has made sense… because I’m finding it hard to even understand the tree/data management in my own head, so hopefully please just ask questions and I will clarify.

[1] I realise this is inefficient and could probably be solved better with Kangaroo or similar, and I welcome suggestions for how to best solve this problem, but that is not the main point of this thread. [2] The reason I want to do this for a range of angles/tangents is because this is for programming a robotic arm, and I want to control the motion in between the starting point which would be a flat piece of wood, and therefore I need all the tangents and end points.

I’m now having a bit of trouble getting the output structure exactly how I need it for downstream processing. I can split the curve output into the branches I want using these methods, but they have a weird output where the first and last branches seem to have their indices split amongst them? I.e. they should all be length 1001.

Something like this?
I assumed your “1001” value came from the range earlier.
It’s always better to reuse the same variable than duplicating one (ex when you were writing it manually in a path mapper). Means easier code maintenance

Sorry, yes you’re right I should have supressed that Replace component!

Hmmm, I agree that what you’ve provided is indeed {A;B}, where A is 0->75, and B is 0->1000, But I think what I meant was {A}(i) where A is 0->75, and i is 0->1000*. So I’m basically there already with the Path Mapper and Replace approach, but for those first and last branches that have weirdly been split in two.

Definitely agree that I want the 1001 to come from a List Length component like you suggest, but right now the Path Mapper works much faster than the Replace approach, but I don’t think there a way of getting an input like that into the Path Mapper block?

You can eliminate the need for the Flip Matrix component by reversing the inputs and outputs of the Cross Reference component and using the C output of the lower Tree Statistics component as the S input to the Partition List component (again 1001 branches each with 76 items):