Grasshopper

algorithmic modeling for Rhino

hi
i have a problem, i want to make a substraction between two breps, one is included into the other.
i tried using "solid difference" but it doesnt work since the brep that i want to substract is completley included into the other brep. ( just like in rhino-boolean diffrence ).
in the picture, i want to substract the red brep from the green brep
any help?

Views: 3337

Replies to This Discussion

Rhino has no volumetric solid NURBS objects, only closed continuous surfaces. A mesh can have cavities though, by simply joining the non-touching inner/outer surfaces into a single selectable mesh definition. Essentially you are already done as far as NURBS is concerned. Now it's sometimes possible to hack it though, I've done so I vaguely recall manually, by splitting the overall model in two with a cutting plane, capping the open division sides onto NURBS solids then Boolean unioning them together. That *may* make the resulting inner/outer surfaces selectable as one model. Since it's such a fundamental problem, reduce it to first playing with a sphere or two inside a sphere.

Why do you want to do a subtraction anyway? What would look different on the screen besides unit selectability as you work?

With a mesh model as final output you can tweak it by flipping the inner surfaces before joining into a single mesh definition so that a Rhino clipping plane will actually show the cross section as a capped solid.

Thanks a lot

You can not do it with polysurfaces in grasshopper.
There's an old trick given by Chuck Welsh from McNeel, on how this can be done with polysurfaces in Rhino, with baked shapes from your grasshopper definition:

It would be easier to help, if you could attach your grasshopper files files along with your questions, for any future issues.

Attachments:

Thanks alot

Hi djordje and Nik

Just spotted that one. In fact you can do it (inside GH) rather easily by flipping the "engulfed" breps and perform a merge. I guess that djordjie would translate that to Python.

Have fun - load R file first - with the attached demo (far more complex cases also available, V1 woks without Lists and not actually asking the right questions: blame boredom, he he).

happy NY (i.e. money and Ducatis, what else?), Peter

Attachments:

Thanks for sharing it Peter.
This is really useful solution!

Happy New Year too!

When translate C to P don't forget to automate the flip part of the equation (if this brep is "engulfed" [i.e. box contains box] then flip it if not don't).

best, Peter

Wow, so some sort of merge for NURBs is equivalent to joining a mesh with Join into a formally single unit after flipping the inner surfaces?

But your script has a black box C# script.

I would indeed prefer much simpler Python.

How do I do this manually in Rhino, as a lesson? The MergeAllFaces does not work after I bake your script's Merge output that I run into a Brep component, then explode the solid and try to recreate the unified object.

This reinforces my impression that I was doing this with a kludge of Boolean joining solids in a way that created a unified object that contained a cavity.

Er ... the Merge used is this ... er ... not recommended merge not some other merge. Not sure if this exists as component in GH (maybe it does).

BTW: Not aware of some Rhino command that does this.

BTW: Black box ... well ... what could be the difference if this (+ a lot of code more to prevent any oops moment(s)) was some sort of add-on thingy? Additionally the fact that is open instead of a compiled sealed thing ...means that anyone can do any mod desirable.

But since you speak Python .. do the C > P translation (I'm sure that djordie has this in the pipeline).

Wow, so some sort of merge for NURBs is equivalent to joining a mesh with Join into a formally single unit after flipping the inner surfaces?

I say: wow too! It works (separate breps can be merged) even without flipping.
This is great find Peter!

I wonder if it acts in the same way "Join" of meshes does (saves up the memory when a couple of different meshes are joined into a single mesh).


To my knowledge also, there is no grasshopper component (at least not default one) which uses Brep.MergeBreps method.

The attached python component below follows Peters explanation on Flipping and Merging breps. It still does not check whether or not the inner brep is inside some outer one (and therefor needs to be flipped), which is what can be checked with Intersection.BrepBrep method.

For Rhino replication of this NonmanifoldMerge and CreateRegions commands need to be called, as per upper link.

Attachments:

Yes, this is what the author of mentioned commands order (Chuck Welsh) basically said:

"You can do this in Rhino with polysurfaces. It is generally not recommended, since the result may not behave as expected in other Rhino operations, but should be fine for your purposes."

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service