Create a surface to Mesh in Python

Hello all,
I have an assembly of solid bodies, flush with each other. I am interested in turning the whole assembly into some kind of mesh. I am also interested in writing Most if not all of this in Python (using as few rs/rg scripts as possible. Anywhere one can point me to begin? I have used alot of the mesh plugins, but I want, for the sake of a learning experience, to create my own.

Hi Alex,

Did you even try to do it yourself?

@blazetron420, so we are talking about a surface, right (not breps)?
Simply think about what the difference between a mesh and a surface is.
A mesh is defined by vertices, points in 3d space, that are grouped to form faces. NURBS surfaces, much like NURBS curves, are defined by weighted control points and a knot vectors, much more complex data.

So to convert a given surface to mesh the control points are useless. What you want to do, is probably divide the surface, where the divisions will form mesh faces and thus define its resolution.

You should also note that all vertices of a mesh are organised in a flat list, whereas each face is represented by a list of three or four vertex indices from the vertex list. The number of indices per face defines whether the face is a triangle, a quad, or an n-gon (only supported in Rhino 6).

1 Like