# Solid-difference in API

Hi

Hi, I want to get solid difference of the unit within its minimum bounding box using rhinoscriptsyntax. Is there any solution?

Hi, this part of the sentence makes no sense. I guess if you want help, you should better describe your problem. A small sketch usually helps in motivating others to help.

I dont think you can do a Boolean Difference when one object is completely inside of another. So you would probably have to divide the bounding box, something like this:

``````import rhinoscriptsyntax as rs

bb = rs.BoundingBox(sph)
lpnts = bb[0:4]
upnts = bb[4:8]
mpnts = [(i+j)/2 for i,j in zip(lpnts,upnts)]

boxs = [lbox,ubox]

a = [rs.BooleanDifference(i,sph,False)[0] for i in boxs]

``````
1 Like

Of course you can (but is tricky: remember R is a Surface modeller). Use this Method:

So for this case the outer is the MinBBox (as Brep) - the white above - and the inner the brep - the black above. (Red is a â€śsliceâ€ť for viz purposes).

As an entry level intro into the freaky stuff see attached:

Brep_hollow_ops_Intro_V1.gh (121.9 KB)

2 Likes

This is not what he wrote. A shape inside a minimal bounding box is not equal to a shape inside another shape. It can be outside the initial shape and still be inside the minimal bounding box. But still itâ€™s unclear what is meant by â€śunitâ€ť here.

Well â€¦ if we replace â€śunitâ€ť with â€śa given brepâ€ť â€¦ I guess that he wants to apply the freaky Merge Method using the min Box and the (obviously enclosed) solid Brep.

But the big thing is: what could be the fastest way to cut the mustard on that min Box (by Volume I guess) puzzle? A bounce solver? Some heuristic? Something else? Karma?

That said Radovan did some similar stuff some time ago (I found it a bit slow, mind),

1 Like

There are an infinite amount of shapes possible where a not fully enclosed solid Brep is inside still inside the minimum bounding box. This means itâ€™s not obvious at all. Just imagine having a short sausage inside a hot-dog roll. That meat is fully enclosed by the bounding box of the roll, but is still not baked into.

(BTW, the unit here would be â€śkcalâ€ť)

1 Like

Uno momento prego:

Given N GeometryBase things we can get a sum Box out of them, right? Now â€¦ if we want to find the Plane of the min (by Volume up to some rational tolerance) Box (out of a myriad ones) â€¦ by what means is this ambiguous? (or â€¦ find ALL the Boxes if â€śequalâ€ť ones are around â€¦ or â€¦ find the ordered first 666 etc etc).

BTW: a classic:

an_bounding_box_fall.pdf (1.7 MB)

BTW: the best (by the best):

1M Q: if we replace the sausage with a plastic is fantastic Bic Mac (and/or french fries) â€¦ does this help?

BTW, the unit here would be â€śMCAL(s)â€ť

â€¦but that Big Mac inside that paper box is not water tight, and as such doesnâ€™t qualify for solid intersections! Anyway, I go and grab some lunch.

I do hope some vegan thing.