# How to create a surface with a 'void'/hole from curves

Hi there,

How would I go about creating a surface everywhere except the box in the top right. The image is showing a preview of area.boundries (curves) when I have selected 1 area which happens to have another area inside of it.

I cannot simply create solids from both and difference boolean them because I may want to select multiple areas rather than just one.

I am trying to find all elements of a certain category which intersect within the selected areas. Currently I am pulling the area boundaries and creating solids and then using a node from Bimorph to find any that intersect with the solid.

In the second image I should be able to select either the red area, blue area or both and have it work.

In this snip I have just the red area selected however it creates two solids because it is connecting both curves (exterior and interior)

Hello, here is an approach going through using solids in dynamo

cordially
christian.stan

Hi Christian,

Thanks for the swift response. I am not sure this solution will help. My goal is to select 1 area or multiple and find the data devices which are intersecting and then give them a parameter based on whether this is true or not. The following script works for areas which do not have areas inside of them but in the example I showed above that is sometimes the case.

I am able to do a solid difference but this would only work In the specific example where the first area selected has an area inside of it and not all use cases.

For example I may select the area with the area inside (1 selection) or I may select both (2 selection (or more)). The script needs to handle both situations. The current problem is that if an area with an area inside is selected it creates a solid for the first area boundary (the whole rectangle which is too big) and also the interior boundary (which was not specifically selected in the first place.

I believe the ideal solution would be for the script to create a solid based on the exterior area boundary and the inner area boundary but not the interior of the inner boundary.

1 Like

Isn’t it possible for you in this case to generate 2 separate branches

edit: Seemed weird not having surface subtraction nodes (lack of knowledge on my part, found)
here is a possibility to manage surfaces with voids

Cordially
christian.stan

For each area (so list level 2 from the Area.Boundaries node):

1. Group the curves using a group curves method (Archi-Lab and discussed elsewhere on the forum)
2. Build a polycurve of each group.
3. Patch each to a surface
4. Get the largest surface (I believe List.MaximumItemByKey node makes short work of this)
5. Use a Surface.TrimWithEdgeLoops node where the largest area surface is the surface, and the edge loops are the polycurves before patching them.
6. Thicken the surface into a Solid as desired
1 Like

hi, we can also classify polycurves by perimeter length
Oulalala the dumpling, did not take into account the message, I keep to assume my stupidity, it will make Mr. Jacob laugh
Cordially
christian.stan

1 Like

Perimeter does not indicate if a curve loop of a surface is the exterior loop or an interior one.

Case in point: go find a tile and measure it’s perimeter. Then cut a length of string that is 2x the perimeter measurement and tie the ends together. Now try and layout the string on the tile so it doesn’t overlap itself and doesn’t spill outside of the tile’s extents. If you can do this, perimeter isn’t always useful for identifying the edge loops.

1 Like

it’s a tile (humor ) for sure.
Cordially
christian.stan

1 Like

Thanks for this Jacob. I’ll give it a try when I have some time. Just wondering, would this work if there were more than 2 areas? Ideally it should be able to handle something like below

If you imagine each colour was a different area it should work the same if I select 1 area or all 4 areas. The initial problem above is just a particular edge case (albeit a common one) that I am trying to resolve.

I can’t remember if when I select 1 area with an area inside of it, if it produces a nested list or just a list after each other. If I could apply your solution to just the nested lists I think this would work for all cases?

Just guessing at the moment though, will give it a shot when I have some time.

It should, but I don’t know offhand.

Can you share that as a sample RVT?

Thanks Jacob, might take me a while to give it a shot but lets see if I can figure it out first with your suggestion from earlier. I am pretty new to Dynamo so would like to learn as much as possible without people on the forums solving it for me! Obviously if I am lost I will share a sample .RVT at a later date.

Many thanks!

1 Like

How would I go about removing the 2nd (1) value from each nested list?

I think I want to remove 0 List Index 1 and 2 List Index 1

Is there a solution that will only keep the first (0) item from each sublist?

List.RemoveItemAtIndex, but that will error out when you have a single item in the list.

You can use `List.FirstItem` to return only the first index of each list.

Thanks Jacob I actually solved this before reading this but thank you anyways!

Now the script runs as intended when only the outside areas are selected (because it boolean differences the inside areas) but I dont want to do this when all are selected.

Basically in this image if the list.counts are the same (which there are in this example) I dont want to run the solid.difference and instead I can plug the list.takeitems directly into the next part.

Is there a way to do that?

I’ve changed the scenario slightly here to test something else, multiple areas within an area.

In this example I would like both List.RestOfItems to be differenced from the main area

For some reason only the first in the list is being applied?

I was using the wrong union facepalm