Composit Input list structure following a module like OFFSET

List Hell Pt 3 )

The input list has curves grouped by “station”

After offsetting them, they are to be used to create a surface and must be in the SAME structure as the input (other operations follow that must also return the curves to the same list structure after their operations)

ReconstructListStructure 01.gh (13.2 KB)

What you’re looking for is the mythical PShift (Shift Paths) component. :slight_smile:

1 Like

… and slowly the mysteries of the ages were revealed to the neophyte…

ss

While this works, the list is not consistent.
Which magical module do I use to create the same structure
because later down the pipeline, this is going to box me into another corner…

ReconstructListStructure 03.gh (16.8 KB)

As @diff-arch mentioned, use Shift Paths or Trim Tree.


ReconstructListStructure 01_re.gh (21.8 KB)

2 Likes

Thank you for that, but I cant have two stations with the same number. Each station is 1m apart

sds

Do I have to recomposit the list with REPLACE?


ReconstructListStructure 03_re.gh (18.7 KB)

Thank you so much for your time, but I am creating lists using a proxy for the model I am working with (the example file). Please ignore the geometry and just consider the lists

The set of logic that creates a list with stations of the same number is vastly more complex than the example I have posted.

There are multiple operations that occur to the curves as a function of their location and other geometry.

I have had to stop working on geometry to try to get my head around lists because I keep getting boxed into impossible corners with lists.

For this project, the only way I can see to manage the curves that in each set, that processed by multiple different functions is to keep the input and output list format consistent, ie grouped by station (numerically sequential)

Each operation results in some different list format and I must rearrange the list to again match the input - in this instant case, renumber the stations to eliminate two stations with the same number

I took another look, and - apart from what @HS_Kim already pointed out -, you can simplify your definition a lot. In fact, you can get rid of all the tree operations, like this:

Since, you already have the insertion indices, you can use these to inject your items in the right order into the main list.

ReconstructListStructure 04.gh (19.2 KB)

I love that but…
How do I answer the question: what is the total surface area at station 16 (cos thats a weight, CofG and moment of inertia issue)

Would it help if I posted hull sections to explain this?

I don’t get it. Sorry.

Of course.

Can’t you just get the surface at index 16 and compute the area?

but there are multiple surfaces at station 16 )

Standby Ill post a fuller example

DELETED. Not relevant

I am REALLY reluctant to post this because its just another proxy for the model I am working on that is much more complex so PLEASE DO NOT MAKE THIS EXAMPLE WORK. This thread is a list problem NOT a geometry problem.

It is just to help you visualize how there can be many curves at each section.

In the example I posted, to find the area at station 16 I would have to know what item in the list station 16 is for each curve:

e

The list needs to be structured so that at ITEM 16 (station 16) ALL the surfaces at that section pop out of the tree for further processing by more functions

d

so really the problem is back to transforming this list
er

into a sequential list that matches the input

The start of the problem is the composited list (not just one set of lines)

ReconstructListStructure 08.gh (13.7 KB)

The essence of the problem is that most operations (REPLACE, DISPATCH, SUBCURVE, LOFT, YOUNAMEIT) either require a flat list, or produce a flat list that must then be transformed to match the input ie, each curve/surfacebrep at the corresponding station (item number)

Its beginning to look like I need to just construct the list from scratch after every operation using the x value of the curve end points. Is there an APPEND module that appends items onto a list (complete with all the branches) ?

ReconstructListStructure 10.gh (21.4 KB)

If you can do it in less than 18 modules, you are a GH LIST GOD!

That is officially a LIST NIGHTMARE !

OK, so do I understand this correctly? Your curve is divided into an x-amount of “stations”, and each station had one or two surfaces that belong to it? In this scenario, I don’t exactly understand to which station the surfaces belong that seem to lie between two?

ReconstructListStructure 03b.gh (10.1 KB)

Fixed the first example so surfaces are planar in YZ. Appologies

There many be many curves at each station. (the surfaces are constructed from the curves

I don’t know if it helps you out, anyway please mind the data matching and check the difference.


ReconstructListStructure 03b_re.gh (17.3 KB)

1 Like

ReconstructListStructure 12.gh (16.9 KB)

This example creates a list of planar curves jumbled in their location within the list to represent some operation f(x) upon the curve (with unpredictable order in the resulting list)

The second section of code, uses their X value to arrange and group them at their respective x locations in order within the list such that item 12 corresponds to the 12th X location, in this case 12 units along the X axis.

Comments welcome:

Each component automatically picks an input parameter as the guiding one for creating output data. Usually it’s the input with the most complex tree structure, but the logic is more complicated than that. By manually assigning a principal parameter you override that choice and force all output data to adhere to that particular structure.