Subtract One Surface From Another Surface

Hi all,

I have a surface (facade which contains windows) and polylines which make another surface group (extended windows). I want to subtract the extended windows from the facade surface. I am using Solid Difference but it is only subtracting the extended portion of the windows, not all the windows. I intended to get the facade surface subtracted totally from the windows as well as their extended portion and get the end result in the form of a polyline which is failing. Your help will be much appreciated.
(Please ignore one window surface that is missing)

Thanks a lot!

Subtract1.gh (15.7 KB)

Something like this?


Subtract1_re.gh (17.6 KB)

oh yes, that’s awesome. I just have one question. I see that you used -1 for the List Item and Cull Index but -1 is not the index of the previous list. Why did you use that?

And thank you so much, Kim, you always come up with asimple and very useful solutions!

Index “-1” in item selection usually means(equals) the last item (index).

1 Like

I see. Thankss again :wink:

Kim, I tried to add some additional curves into the script, however, the Region Difference node is not working. Initially, the error was " Solution exception:Object reference not set to an instance of an object" and I thought it was due to a polyline that was not closed, and after improving it, it still does not work.
Could you please have another look at it?
Thanks very much for your time and help!!!

Subtract2.gh (23.8 KB)

According to your data status, it seems you don’t quite understand the concept of data tree and data matching.

You have completely different two lists of data trees for region diff operations, and this kind of behavior is not recommended in GH in general…

I don’t want to respond to every other variation from you because I have no idea how your walls and windows are created. I can only give you advice that you are better off starting your project with nice and well-organized (ie. by preparing the same data tree structures for walls and windows)initial data from the first place.

Attached is a kind of brute force example for this and I can’t guarantee that It always work for your future variations further down the road.


Subtract2_re.gh (22.1 KB)

I am happy that you mentioned the underlying issue which I did not have any grasp on. I will now try to build my knowledge and explore in depth how data structure works.
Thank you for pointing this out! It’s better for me to address the root cause instead of posting differing questions.