Grasshopper

algorithmic modeling for Rhino

Hello, 

I'm having an issue where closed breps I'm creating in ghpython are not boolean unioning using the SolidUnion grasshopper component, or the rs.BooleanUnion command. 

However when I bake the breps, and then input them back into grasshopper and use the SolidUnion component - it works fine. 

I've reproduced the problem in the attached file (or check the screenshot):

Thanks, 

S

Views: 1826

Attachments:

Replies to This Discussion

Hello,

I am not using rhinoscript syntax so I can't possibly know why this is not working.

But the following is certainly gonna work .

import rhinoscriptsyntax as rs
import Rhino as rc
import random

curve_lst = x
L = []

for curve in curve_lst:
my_box = rc.Geometry.Extrusion.Create(curve, random.randint(1,20),True)
my_brep = my_box.ToBrep()
L.append(my_brep)

a = L
b = rc.Geometry.Brep.CreateBooleanUnion(L,rc.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance)

Best,

M.

Hi Saeran,

I have been experiencing this problem before, too.
It has to do with rs.ExtrudeCurve function - it does not create an extrusion, but a sumsurface. Capping a brep made from this sumsurface is something boolean union does not like. Looks like baking it before using boolean union, converts it to "regular" brep.

Use the Extrusion.Create method instead. It has a nice option to Cap the extrusions too.

EDIT: Sorry for not refreshing the page Marios.

Attachments:

Hahahah,

No worries. Djordje. :)

Hi Saeran, hi guys,

I am aware of some cases where the only way to actually Boolean (union/difference/intersection) some solids is to bake. These cases are directly dependent on some inner splitting logic in Rhino, and do not depend on the SDK. I.e.: they will fail in Grasshopper, RhinoCommon, AND GhPython.

The good news is that they are very few, and usually have to do with solids created from curves that have been imported from other programs. McNeel is working on a general fix. The only way to know for sure, though, is if you were to post the sample curves that give the issue. That would really be helpful.

Thanks. I'll try to troubleshoot that a.s.a.p. when you post the file.

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

Hey Marios, Djordje,

So I tested out the script using Rhino Common and it works! Thanks guys. I also noticed simply converting the guid's to breps will automatically fix the problem as well (using rs.coercegeometry).

@Giulio: I'm not actually importing any curves. The geometries I'm using are actually procedurally generated - specifically I'm recursively splitting geometries, as part of a larger shape grammar engine I'm developing: https://github.com/saeranv/cactus/blob/master/framework/python_scri... . If I run into problems again using imported curves - I'll let you know!

Thank you,

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