Surface.SubtractFrom bug?


Hi people :slight_smile:

Files :
Desktopsurfs_opn.sat (11.0 KB)
Desktopsurfs_walls.sat (21.7 KB)
subtract.dyn (18.0 KB)

I have encountered a bug (?) this afternoon (at least I’m guessing it is one). Here it is :

  • I have a list of surfaces representing walls, and list of surfaces representing openings (doors and windows).
  • I want to cut the openings off the walls.
  • My idea was to : use Surface.Thicken (inputs = surfaces that represent the openings), use Solid.ByUnion to get a unique solid, finally use Surface.SubtractFrom (surfaces = walls, trimming entities = solids from Surface.Thicken).

Here are the elements :

These two nodes have always worked perfectly fine for me, until now. It was the first case I have ever encountered that presents two openings (n°0 and n°4) which share a corner (and a corner only). I did not get the list of Surfaces I was expecting, rather a list filled with Empty lists. The problem also happens if those two surfaces are the only surfaces in the list… :confused:

Is this a known issue ? Am I missing something ?

Expected output :




Hi again,

FYI, a way to bypass the problem is to use Surface.SubtractFrom in a Python loop : you have to compute the result opening by opening (and cannot. Note that this solution may result in a crash of Dynamo if the project is too big.

Still interested if any one can explain this behaviour or give an alternate solution.

(Should I report this at the GitHub ?)



1 Like

Reported at GitHub :


How did you bypass the problem. Could you share the python script?



Here is a file that sums up everything (download link under the figure).

SubtractBug.dyn (19.1 KB)

Here is the python script of the .dyn :

import clr
from Autodesk.DesignScript.Geometry import *

origi_surf = IN[0]
opns = IN[1]

result = origi_surf

for opn in opns:
	result = Surface.SubtractFrom(result,opn)[0]
OUT = result

I try to use python to bypass the problem but the result is empty list.
Could you show the python of your project in the topic?



My Python script was designed to work with one surface only and its openings, not a list of Surfaces with their respective openings.

The script I used is the same you used in your screenshot.

The fastest way to bypass the problem would be to encapsulate the Python Script into a custom node and feeding it the lists with the appropriate levels.

The cleanest way to do it would be to re-write the python script and add an additional loop.