Efficient way to subtract two solids

Hi there!
I’m new to the software so my question will probably sound very basic so sorry in advance. I have a basic model where i want to model an helicoidal stair with constraints. The way i did it, i created the upper face of the steps, extruded it downwards, the underface of the stairs (flat), extruded it upwards and intersected the two volumes. This works as intended except that the computational time is
Also i noticed that when i move the slider, the computation takes place immediatly. Is there a way to delay it until i stopped moving the slider? That would prevent a lot of useless computations.
Thanks in advance, have a nice day!


stairs.3dm (64.1 KB)

Your Rhino file is empty. Please upload the grasshopper definition.

1 Like

My bad, here’s the file.
stairs [Jan-15 '24, 1152].gh (31.5 KB)

Every iteration of the slider is calculated, which is often not desired. I usually don’t suggest to slide the slider manipulator on large definitions or heavy calculations for that reason.

You can put a data dam behind the slider. It requires you to click the arrow to let the data pass through.

The Solid Intersection works more reliably when you’re using closed polysurfaces.

Your ‘bounding box’ is an open extrusion. Using cap to close it, the result looks correct.

stairs [Jan-15 '24, 1152].gh (35.7 KB)

So the empty R8 Rhino file is pointless and irrelevant?

Looks like it works in R7, with this error:

  1. Boolean Intersection set is empty

Because the bottom step isn’t fully cut by the extruded box (which is not solid).

P.S. A different way to do this is to make the box solid (Cap Holes) and use SDiff instead of SInt. The bottom step is still an issue but easily solved.


stairs_2024Jan15a.gh (23.0 KB)

1 Like

Thanks a lot for this quick and enriching reply, i will take these two suggestions into account. The main issue though is the process time of the other Solid Intersection, between the two extrusions of my steps (the one from above and the one from below)

Thanks a lot for this reply! The thing is i want to use a SInt since i want everything that’s inside the bounding box. What’s more the issue comes from the step before, the SInt between my two pre-stairs (from above and from under) which has an extremely laggy construction time…

OH :exclamation: Then use SInt.


stairs_2024Jan15b.gh (22.8 KB)

You probably want to subtract the center column?

Oh, whatever. :zzz:

1 Like

Yes that’s exactly what i want to do, but this specific step here really makes the process laggy. I wondered if i the double extrusion + SInt is the optimized way to do it. Trying to attach a screenshot as well as a drawing using my best Paint skills so i’m sure it’s understandable.


I’m a new GH user as well, and I found this video https://youtu.be/-YGR9jQ-1w4?si=imP9KylzDHMfyvAa very helpful. It focusses on calculation speed / efficiency, and has many examples where working with meshes is more desirable than solids.

There are other ways to do this but enabling the Profiler on your posted GH file (‘Display | Canvas Widgets | Profiler’), I see nothing especially “laggy”? Longest time is 531ms which is barely half a second, so why worry about it?

That’s because it isn’t actually 500ms, when i move the slider (or change the input manually to avoid using the slider), it takes like 30s to compute…

Capture

Thanks a lot will definitely take a look tomorrow!

Which slider? You answered this yourself in your first post and @martinsiegrist elaborated on the same issue. Dragging sliders in this case fires a series of re-computations that each take half a second, so they add up. Clearly the file opens quickly computing just one set of slider values.

It’s better to double-click a slider and enter a specific value rather than drag a slider when there is this much lag downstream. Or use a Data Dam as Martin suggested.

I didn’t focus on this aspect of your model because you didn’t post a GH file at first, and the R8 Rhino file was a waste of time. Using meshes for this is a bad idea.

Hi again,
You’re right, as i mentioned, i took this account and now change the input manually. I also tried the dam as suggested. It doesn’t solve the issue and the computation still takes 30s. So to be perfectly clear i don’t use the slider component anymore.
The issue is clearly caused by the SInt between the two extrusions, and being new i don’t know if this is the optimal way to process, but i didn’t find a way to build a Brep between my two surfaces…
Again sorry for posting the wrong file at first, only the GH one is relevant.

Be careful about jumping to conclusions. The more carefully l look at your model, the more questionable methods I see. In general, solid Boolean operations are to be avoided as much as possible. There are many hidden details about them that affect speed and quality of results.

For example, I just increased ‘Step width’ to 3200 by the “quick” double-click-to-enter-value method and the Profiler time on SInt jumped to 1.8 minutes :exclamation: :exclamation: :exclamation: None of our discussion accounts for that! The problem now is the extruded ramp shape is very weird somehow, altogether a different issue than data dams or other means to avoid slider delays.

I assure you that there are other ways to construct stairs that are far more responsive to sliders. I’ve done quite a few spiral stairs myself and seen others do them. Here is one, for example:

You can say “my stairs are different” and that is true. But I’m pretty sure I could make your kind of stairs from the above without the sluggish response you are seeing. I’m not willing to do that work right now but you need to know that there are other ways that are quicker than what you posted.

2 Likes