Subtract entire sublist

Hi there, there’s a question and I hope someone can help me! :slight_smile:
I want to subtract a sublist from a list, but everytime I try to do it, it take off the single points instead.
I cannot use the item at index because I need to create a code which works always. maybe a Python script would be helpful
There’s the picture of what happens

Try DesignScript

What do you mean?

Hi, try this…

1 Like

Part of the problem here is that you’re trying to do an object comparison for geometry, which is difficult computationally, and prone to inaccuracy in every system I have seen.

One thought is to join the list of points you want to cull and the sublists from the other list. Said another way - add the points to remove onto the front of the sublists. You can then use a Point.PruneDuplicates (with the associated tolerance set to what your project needs) to remove the later matching points, and then drop the number of items which was joined from the sublists.

@JacobSmall could be easier if I create a dictionary?

How would you ensure the points have the relevant names that match? It would be a big ugly nested dictionary at that as you could have a point in multiple sublists.

What are you after in the larger workflow?

The thing is that I had to create these panels and I should give a name to each point because I need to recreate this list but instead of having the point I need to have a list with the same structure of the nested one but with a “name” that is associated with the point. And also I have to take off the square which corresponds to the opening.

Still isn’t clear to me - can you shed more light? Perhaps when you created the panel you could have incorporated the points then?

I basically need to do this

so to each point I give a name and create a list with these names as shown (without creating a list corresponding to the door)

There is definitely a better way to get the data you are after… Let me think on this for a few… likely isocurves based on the parameterization of the overall shape, which can then be used to divide the overall surface, which will then return partial surfaces from which you can query and sort the points as you may desire…

Somewhat of a fun problem so I may spend some time on this after hours tonight. No promises though.

This may help:

I couldn’t decipher the order you wanted on the points, but the counterclockwise sequence should allow you to do some indexing to get the values you want in the order you want them.

The resulting graph on periodic mode provides a nice animation of the C shape for each panel.
Panelifier V0

You may want to add a Curve.Reverse for polycurves where the tangent vector is not equal to the direction of the wall’s curve. This will ensure you have a consistent direction on the paneling.

LunchBox for Dynamo have some specific node for this task.

Like this?

Panel.dyn (22.0 KB)

I don’t think this is an exercise in fitting panels of one size on a surface (at least not as I understood the sketch), but about finding the natural divisions on a surface based on the opening location(s). Watch the end of that GIF carefully - the last wall is a 3x3 set of panels (with the center one cut out).

I did tried like this!