Trim surface with surface, and return modified surfaces in original tree

Hi,

Challenge:
There is list A: containing multiple surfaces (red)
There is list B: containing multiple surfaces (green, openings)

I would like to trim the surfaces in list A, with the surfaces in list B.
And return a list C: with the trimmed surfaces + the unaffected surfaces.

There is a way to do it with the region Difference --> Boundary --> surface. However, when I do this I am ‘loosing’ the surfaces which lay on a different plane. (don’t fully understand why this is the case).
This while I would like to have a list in the end containing:
Trimmed surfaces + All surfaces which are unaffected.

2020-05-21 Trim surface with surface and retaining all other surfaces.gh (31.5 KB)

[2020-05-21 Trim surface with surface and retaining all other surfaces.gh|attachment]
Is there a generic way of selecting all the surface which are not affected by the Region difference tool?
Or maybe there is even a better way to do it :slight_smile:

Any suggestions?

Thanks :slight_smile:

The link in your post seems to be broken.

Ahh thank you, It is uploaded :slight_smile:

RegionDiffrence
RegionDiffrence.gh (22.1 KB)

Ahh perfect! :+1: :+1:

This is a very small addition (cyan group) to a solution presented five days ago:

match surface to fully enclosed surface-wall_2020May21a
match surface to fully enclosed surface-wall_2020May21a.gh (47.8 KB)

Hi,

Thank you once again :slight_smile:.
Unfortunately, when I implemented it, I ran into 2 new challenges:

  1. If there are surfaces located ‘behind’ each other, the ‘opening’ will also be made/cut in the surface behind. This is not intended.
    image

  2. It is important that the output list C is restored into the original List A (with corresponding branch names) .
    I tried the ‘unflatten’ command to rename the list back in accordance with list A. In most cases this works, however:
    When there is an opening, covering an entire surface, this surface is deleted (that is good), however as a consequence the ‘unflatten’ command does not any longer do the trick, because there is 1 item missing.
    2020-05-21 Trim surface with surface and retaining all other surfaces_RE_re.gh (28.7 KB)

Do you have any suggestions?

Thanks again! :slight_smile:


RegionDiffrence.gh (27.9 KB)

2 Likes

Ahh very nice!
Thank you very much! :slight_smile:

Hi,

Thanks again for your help, I really appreciate it. :slight_smile:
Unfortunately, when implementing, I ran into another challenge:

It is possible that List B contains surfaces (representing openings), which are present on multiple/different planes and also in other plane direction (line XZ, YZ or something in between).

I noticed, that If the openings are not all in the same plane, The surfaces are not trimmed in the correct way. (it looks like the surfaces which are making contact are fully deleted, instead of trimmed).
2020-05-21 Trim surface with surface and retaining all other surfaces_RE_re_RE_re.gh (61.4 KB)


Is there a way to modify the script, in a way that the location and direction of the openings do not matter. But that they automatically ‘detect’ which surface they are influencing/has to be locally trimmed?

Thank you again very much :slight_smile:

Are you looking for something like this?


RegionDiffrence 01.gh (30.6 KB)

Or maybe this?


RegionDiffrence 02.gh (38.0 KB)

Hi Mahdiyar,

Thank you once again!

I think we are almost there but there are only 2 small questions remaining.

A RegionDifference 01.–> It makes the correct openings! :slight_smile:
challenges to go:

  1. Surfaces in List A which are on a plane which are not affected at all are deleted/not returning in the end list. This should be the case.
  2. The surfaces are trimmed/deleted in a correct way.
    However, the surfaces should be returned based on the original branch names in list A. Because List A has to be flattened this information is lost in the RegionDiffernce command. I am not sure but I think the ‘region difference command’ makes its own branches based on surfaces on the same plane. Unfortunately this is not correct. It is really important that it returns the surfaces in the branch they where at in List A (and not dependent on the plane).

Do you have any suggestions?

Thank you very much! :slight_smile:
2020-05-21 Trim surface with surface and retaining all other surfaces_RE_re_RE_re_RE01_re_re.gh (72.8 KB)



I posted it twice so here is some extra text to get int online :slight_smile: