Undable to create brep from box?!

hi guys,

i´ve an error in my python script and don´t know how to handle it.
maybe someone here knows.

test.gh (9.1 KB)

nice greets.
i hope someone can help me

Hi Philipp,

A couple of things:

  • If I understood your code correctly, you are trying to planarize your spiral surface with some boxes. Making a box from that previous mesh faces is not a good approach - the size of all mesh faces is not equal - meaning you will have different mesh boxes, and more importantly: not all mesh faces have four vertices (there are some with 3 too), meaning you can’t create a box which will have 6 vertices. Even if you would have all your mesh faces to be quadrilateral, the box generating points would need to be in counter-clockwise bottom-top order, which is not easy to achieve.
    Instead of this, check the attached component at the bottom of this post. It planarizes the initial Spiral surface with panels, and then makes boxes out of those panels (extrudes them).
  • There is a difference between the way rhinoscriptsyntax functions work in RhinoPython and in grasshopper. In RhinoPython you would just call a certain rhinoscriptsyntax geometry generating function and it would add the geometry to the Rhino document (meaning you would be able to see it in Rhino). In grasshopper, the fact that a certain rhinoscriptsyntax geometry generating function had added a geometry to grasshopper document, does not mean, it will be visible (in Rhino). You have to add it to some list/reference it to the variable, and then reference that list/variable to particular output parameter. Example:
pt = rs.AddPoint([4,2,0])
a = pt
  • Do not set your output to grasshopper document geometry (geometry = ghdoc.Objects.Geometries). Use variables/lists instead to reference/add the geometry to them (check back the previous point for further explanation)
  • Do not use rs.EnableRedraw(False) function in Grasshopper. Grasshopper uses display conduits to render objects not an actual Rhino objects, so there is no need to disable screen redrawing (like you would do in RhinoPython). It can actually slow down your grasshopper components solve time.
  • I can see you used the meshing solution from here. I would be grateful if you could post back there, and comment that the solution works.

test3.gh (13.3 KB)

hi djordje,

thank you for your detailed answer.
i am a newbie in python scripting so excuse some beginner mistakes.

file works, BUT as you can see on the screenshot, the panels are not on the same position as the other element.
i hope you know what i mean, my enlgish is not the best.

it is of course just a testobject, but if it where real, the panels should be holded by the point-elements…

Hi Philipp,

Can you bake your spiral surface, and attach the .3dm file please?
Thank you.

here is the baked spiral.

spiral-baked.3dm (181.1 KB)

thanks for your engagement.

The “other element” are your spheres and cylinders? Of course they are not on the same position, you are generating them (spheres and cylinders) from mesh geometry, while the boxes are generated from planarized surfaces. In order for them to be on the same position, they have to be generated from the same source. Check the attached file.

I would advise you to read Grasshopper Primer. It will clear much of these beginner grasshopper questions. It’s a bit old though (data matching has changed since its release) but it has very good explanation on surface paneling.

test4.gh (14.4 KB)

just a note @djordje - modelab has totally rewritten the primer, it’s now up to date with the latest GH, and quite good! http://modelab.is/grasshopper-primer/

Hi @andheum.
I know that. But the section on paneling surfaces and the use of IsoTrim component was removed from the third edition.
Second edition still has this section, and it’s quite useful for the problems samphi faced in this topic.

Ah! didn’t realize there had been sections removed.

thank you verry much djordje! (again ;))