Grasshopper

algorithmic modeling for Rhino

Hi!

I'm new in Grasshopper and rhinoscript and I'm facing a problem concerning geometry decomposition of Brep volumes which is surely simple but I can't find a solution.

My volumes are rather are simple (surfacic volumes with flat faces), but can contains faces with more than 4 points.

I'm creating the Breps (from a polyline representing the base, followed by Extrusion (given an height) and Cap Hole) and I want to extract all the geometry of each surfaces (3D coordinates of all vertices of all surface).

The problem is I want also to keep all object's faces orientation (to be sure of what is inside or what is outside), and export this geometry to a 3D file (in pythonscript).

I can't make assumption on what is what, only on the Brep consistency...

But I didn't find a good way to do this using components or rhinoscript (python) on Brep primitives and even on surfaces primitives.

It seems that the way the vertices are described in surface is not consistent after deconstruction (or by duplication or reconstruction). For some surfaces they turn clock-wise (CW) but reverse way (CCW) for others.

For Grasshopper component I tried to use "Deconstruct Brep" followed by "Explode" on surfaces to get all vertice of the faces (and their coordinates) (see attached file). You can visualize each vertice of each face using the sliders (Face index, Vertice index).

You can see that some face's vertices are rotating CW, others CCW...

For Rhinoscript (which is what I'll need to use later) I tried to use several approaches to decompose from Brep to vertices (or segment) but with the same bad result since the moment I must use the surface primitives...

Could you please give me an advise for the way I should do this, using component and/or rhinoscript.

Thanks by advance.

Best regards.

Views: 4896

Attachments:

Replies to This Discussion

For whatever it's worth, the white group shows the difference between surface normal vectors and frame 'Z' vectors, coming from the same 'EvalSrf' component (use the value list switch).  Surface normal vectors are always "Out", while 'Frame Z' vectors are "Out" on some faces and "In" on others - and which surfaces are affected depends on whether you 'Extrude' the polyline curve or the 'Surface' ('Flip' surface is doing nothing).

Attachments:

Hi Joseph!

Thank you for your explanations and the proposed way to retrieve (and visualize) the good surfaces' orientations (normals toward outside).

Your solution is working at surface's primitive's level but it I would like to work at vertice level.

I really thougth that  it could have been simpler to extract oriented surfaces directly from some components (like an option to "Explode Brep" or an alternative component) as I work (at the moment) only with polyhedral objets and planar faces (even with more than 3 points by faces).

All I would like to get (as output) is the list of vertices of each (sur)faces of the base geometry (of a generated Brep) sorted in a consistant way, so that the rotation (ie CCW) in the vertice's order allways give me the outside direction...

At this time, I only know the "Explode" component to get the all the vertices from a polygonal geometric object (my object's planar faces) but it is working at "curve" level, not directly at "surface" level. And the implicit conversion inbetween maybe could give unattended results on surface with more than 4 points (considered as "Trimmed Surface"). I'll will test it shortly...

Or maybe is there an other, more elegant, more efficient solution?  Even using rhinoscipt?

You sound a little mixed up.  For whatever it's worth, the vertices for each face can be sorted with 'AlongCrv (Sort Along Curve)' using a circle based on the respective aligned normal plane.

Attachments:

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