Grasshopper

generative modeling for Rhino

# vertices from surfaces

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

Tags: Brep, surfaces, vertices

Views: 64

### 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

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

thanks so much, david

by 雷锋

by 雷锋

by 雷锋

• View All