Grasshopper

algorithmic modeling for Rhino

I'm trying to boolean intersect two extruded surfaces through the ghPython component using the rs.BooleanIntersection() method. For some reason its returning two unioned geometries rather than the intersection. 

So I started testing the BooleanIntersection() method in the surface.py script, and while testing it in ghPython I realize it doesn't seem to recognize the utility module. I'm getting the following error message:

"Runtime error (ImportException):No module named utility"

Mind you I see the utility.py script in the RhinoPython folder. However I'm not sure how ghPython works with RhinoPython to access this / if it accesses this....

So (a) is there any way to get ghPython to recognize the utlity module ?

and (b) is that's what wrong with the rs.BooleanIntersection method?

- Saeran

Views: 1007

Replies to This Discussion

Hi Saeran,

I've quickly tested the ghPython 0.5.1 component in Grasshopper 0.9.56 and rs.BooleanIntersection seems to work fine. I am attaching an example.

If this does not work, have you by any chance (even accidentally) edited the standard RhinoScript modules in Rhino 5?

I hope this helps,

Giulio

--

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

Attachments:

Hi Guilio, 

Thanks for testing it. I tried your definition and it works fine. I've managed to replicate my problem in the attached file. 

The code looks like this:

import rhinoscriptsyntax as rs

ptlst1 = rs.CurvePoints(x)
ptlst2 = rs.CurvePoints(y)
line = z

srf1 = rs.AddSrfPt(ptlst1[:-1])
srf2 = rs.AddSrfPt(ptlst2[:-1])

solid1 = rs.ExtrudeSurface(srf1,line,cap=True)
solid2 = rs.ExtrudeSurface(srf2,line,cap=True)
a = rs.BooleanIntersection([solid1],[solid2],False)

I'm inputting two curves to the component, turning them into a surface, then extruding the surface. When I try and boolean interesect the resulted extruded surface it's giving me a union rather than a difference. 

When I bake the extruded surfaces, and boolean interesect them manually it works fine....

- Saeran

Attachments:

Hi Saeran

it's hard to reproduce exactly the case without the original Rhino file. Can you attach it, too, please? From my quick test, the functionality works (but I'd have to check what happens with extrude).

Thanks

Giulio

--

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

Sorry, here is the .3dm file. 

Saeran

Attachments:

Yes, in this case I can clearly see how this is working in an odd way.

I also noticed that it seems to actually incorporate the direction of the base polyline as part of the inwards-outwards calculation. I used the _Flip command and it stated to work properly.

I am not sure, though, if this is the supposed behavior. I'll ask someone to have a look at this.

Thanks for reporting this,

Giulio

--

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

Attachments:

Awesome, and the flip command gives me a temporary work around - thanks. 

- Saeran

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