Grasshopper

algorithmic modeling for Rhino

Hello,

I have been trying to code a number of components using GHPython, which involve a BooleanIntersect operation.  As the attached file shows, I have been getting desperate by trying out a bunch of different ways of performing the operation.  Most of my attempts to perform booleanIntersect with RhinoCommon or Rhinoscript do not succeed (apparently from the finicky-ness of BooleanIntersect).

I have, however, found one way of getting the correct result but it is quite possibly one of the most cumbersome and clumsy ways of doing it (see the image and the GH file attached).  I essentially need to write the geometry into the Rhino scene, pass the GUID out of the python component and through a brep component, and into another python component that performs the BooleanIntersect.  I was tempted to just wrap all of this up into a cluster component and distribute it but thought that this is probably not how the creators of Grasshopper and GHPython envisioned my using their interface

Still, I may be forced to do this if it is the only way to get a successful BooleanIntersect operation for the time being.  Please let me know if there is any hope of this issue getting cleared up in the near-future.

Thank you,

Chris Mackey

Views: 1840

Attachments:

Replies to This Discussion

I don't have GH in front of me, so I'll just ask: What's the outcome of doing the BooleanIntersect in RhinoCommon before you add it to the RhinoDoc and then bring it back in to GH?

If there is a difference, have you tried examining the Brep geometry before you put it into the RhinoDoc? You could check SolidOrientationIsValidFlipCompact, or just try reconstructing the BRep. Assuming a difference, The question to ask yourself (and McNeel) is: What is being done to the Geometry of the BRep as it is added to and retrieved from the RhinoDoc?

Hi Chris

thank you for reporting this, which is definitely strange behavior, if not a bug. I would like to know how you created those Brep'ses in the first place, as this is vital information to understand what is happening. You can also contact me via email (see below).

It's easy to see that Grasshopper is affected in the same way, using these Breps'es. It cannot compute the Boolean Intersection (Solid Intersection).

That being said, I will help investigate this issue right away. I have no availability of a time for a fix or a final explanation at present. I've changed your script so that it will add the polysurfaces to the document, then perform the boolean intersection, and then delete them, all in one component, thereby circumventing the issue.

I'll let you know how this develops and please let me know the origin of those Breps'es.

Thanks,

Giulio

--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Attachments:

Thank you, Ben and Guilio for responding so quickly.

Ben, thanks for clarifying my question, which should be “What is being done to the Geometry of the BRep as it is added to and retrieved from the RhinoDoc that allows the BooleanIntersect to be successful?”  To summarize the answers to your questions, if I try to do the BooleanIntersect before adding and retrieving the geometry from the RhinoDoc, I get a “Null” output from the BooleanIntersect operation.  I will put a post up soon regarding all of the properties of the initial BReps that you mentioned.

Guilio, thanks so much for the improved script that will provide a nice temporary fix to the problem.  The breps were generated using a fairly lengthy GHpython script that Mostapha and I wrote and were planning to include in the next release of the Ladybug components.  Specifically, the script finds the solar envelope for any site surface and set of sun vectors.  Geometrically speaking, the solar envelope is the solid intersection of all extruded solids of this planar sie surface in the direction of each sun vector.  For ease of our own coding, we have lofted the site boundary curve with a curve projected to a plane instead of actually extruding it (we could try extruding it if we think it will get the booleanIntersect to work).  The issue that we have posted in this ticket arose when we realized that some initial site boundary curves successfully produced a single solid result for the solar envelope while some were causing the script to fail and return multiple non-intersected solids.

The attached GH file shows this full solar envelope python script both in a case that the component worked and when it did not.  Also, for clarification, I have the GHPython component output both the initial non-intersected solids (the solar fans) and the final result that we get when we try to booleanIntersect all of them (the solar envelope).  Please let me know if you need any more information and, of you would like to contact me at my email, you can at chris@mackeyarchitecture.com.

Giulio,

Very sorry but I forgot to include the Ladybug classes in the file I sent you and so it would not have run correctly if you opened it.  Please use the new file attached if you would like to see the origin of the breps.

Attachments:

Hi Chris,

Thank you very much for your help troubleshooting this problem. We were able to pinpoint the problem because of your input. Here is an explanation of the cause, and a way to efficiently avoid if at present. We will work on fixing this in a future release of Rhino.

The origin of this error is due to SplitKinkyFaces(), which is automatically applied when you add a Brep and Rhino is set to its default behavior.

This means that a simple addition to your script will have this error fixed relatively easily. I took the liberty to update my own script, and suggest that you use this updated version for now. In future versions of Rhino/Grasshopper/RhinoCommon/GhPython, we will make sure that this is no longer happening, or find ways to alert the user.

Thanks a lot again for your help with this.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Guilio,

This is great to hear!  I am implementing you new method right now on my existing components and I have a feeling that I will be using it several times in the future.

Thanks again!

-Chris

Hi Guilio,

This is great to hear!  I am implementing you new method right now on my existing components and I have a feeling that I will be using it several times in the future.

Thanks again!

-Chris

Hi Guilio,

I am sorry that I did not realize this earlier but, for some reason, your new code is not working on my system.  I am still getting a "null" result out of the boolean intersection and the python component.  Please see attached screenshot.

Do you have any ideas for what might be going on?

-Chris

Attachments:

It's my fault. This should work, now. I've deleted that old attachment. I'm still looking into this, though.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Attachments:

Thanks Giulio,

The new code in your attached file is definitely working.  I will write it into my Ladybug GHPython components later today.

-Chris

Hi Guilio,

I have new problem for you in which the boolean intersection in Rhino Common is failing.  I understand that this may be a slightly different problem from the one that I initially posted, which you are currently investigating but, in the event that it is related, I am posting it here.  Please see the attached file, which shows you two breps (including the method that was used to generate them) and the failed intersection operations.

I tried intersecting them with the grasshopper solid intersection component, a python component that splits the kinky faces and then intersects them, and a python component that puts them into the Rhino Document and then tries to intersect them.  All of them are failing for some reason.  Let me know if you manage to get any insights into this.

Thanks again for all of your help.

-Chris

Attachments:

Ben, part of the answer to your questions are below.  I checked a bunch of the properties of the Breps and I can say they are as follows:

IsSolid - both are solid

SolidOrientation - both are outward

IsValid - both are valid

IsManifold - both are manifold

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