Getting Brep Vertices as text or numbers

Hello everyone,

I want to get the vertices of a number of Breps as individual coordinate values that I can then compare.
I can get the Vertices for each Brep as a list, as per the below script, but these appear as VertexList object. I want to be able to access the actual vertex coordinates within the Python script- perhaps in a text format, that can then be compared. How do I do this?

I’m aware of Deconstruct Brep which splits out vertices, but I then need to feed these into a script which carries out other functions.

import Rhino

vert1=x.Vertices
vert2=y.Vertices

for n in range(vert1.Count):
    for m in range(vert2.Count):
        if vert1[n]==vert2[m]:
            print("match") # I don't get a match here because these aren't vertices coordinates, they are Rhino objects with different ids.

Thanks!

This may be one option:

vert1 = [i for i in x.DuplicateVertices()]
vert2 = [i for i in y.DuplicateVertices()]

print set(vert1) & set(vert2)
1 Like