Grasshopper

algorithmic modeling for Rhino

hi all !

does anybody know how to obtain vertex from surfaces?

I read an old post from david using a Brep method : 

so, we need to convert the surfaces before to Brep

Brep anyBody = new Brep(anySurface.ToBrep());

this throws an error message

Error: 'Rhino.Geometry.Brep.Brep(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' is inaccessible due to its protection level (line 260)

( surfaces are trimmed surfaces)

just in case it coud be solved...

duplicateVerices() returns an array

so we need to declare an array knowing previously how many vertices has the surface , because an array needs a dimension


Point3d[] _vertices = new Point3d[4];
_vertices = anyBody.DuplicateVertices();

I wonder how explode has been made!

any helps?

cheers

Views: 2089

Replies to This Discussion

Brep anyBody = new Brep(anySurface.ToBrep());

Since you're already creating a new Brep using the ToBrep() method, you don't also have to create a new Brep using the Brep constructor. Thus:

Brep anybody = anySurface.ToBrep();

is enough.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

duplicateVerices() returns an array

so we need to declare an array knowing previously how many vertices has the surface , because an array needs a dimension


Point3d[] _vertices = new Point3d[4];
_vertices = anyBody.DuplicateVertices();

Not quite. An array does need a dimension but the dimensions of the Vertices array is always one. You do not need to specify the size of the array. Thus:

Point3d[] vertices = anyBody.DuplicateVertices();

will give you a one-dimensional array with all the vertices of the Brep.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

thanks so much, david

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