Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the corners of a BRep Body

Message 1 of 3
772 Views, 2 Replies

How to get the corners of a BRep Body

Is there a way to get the coordinates of all the corners of a BRep body?
For example, if I have a 3D hexagon, can I get the coordinates of all 12 corners?

Message 2 of 3
in reply to: jmperez6

"Corners" on a solid model are represented by BRepVertex objects.  For a 3D hexagon there would be 12 vertices.  The BRepVertex object supports a geometry property which returns a Point3D object that will give you the position of the vertex.  You can read more about solids and vertices here:

Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 3

Hey @jmperez6


you will start with a BRepBody firstBRepBody, a BRepBody has BRepFaces. A BRepFace has vertices. A Vertex is a Point3D object. On a Point3D object you can use .geometry.x or .geometry.asArray() to get the coordinates of the point you are looking for.


firstFaces = [] #Array of Array of Vertices [[Point3D_1,Point3D_2,Point3D_3,Point3D_4],[Point3D_1,Point3D_2,Point3D_3,Point3D_4],...]

#iterate all faces of a BRepBody calles firstBRepBody
for i in range(0,firstBRepBody.faces.count):
    firstVertices = []
    #iterate all Vertices (Points3D) of a face 
    for j in range(0, firstBRepBody.faces.item(i).vertices.count):
        #add vertices of a face to an array
        #firstBRepBody.faces.item(i).vertices.item(j).geometry.x would be the x-coordinate of a vertex
        #firstBRepBody.faces.item(i).vertices.item(j).geometry.asArray() returns xyz-coordinates as array
    #add array of vertices of a face to the face array

# ...
#now you could iterate through the array and get each vertex and then you can get the vertex geometry
x = firstVertex.geometry.x
y = firstVertex.geometry.y
z = firstVertex.geometry.z

 I hope that helps, cheers Fabi





Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report