Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5873

Nurbs to mesh in python

$
0
0

Hi,

I have a few Nurbs generated with rs.AddSphere in my python script and I wanted to convert them into meshes within the script. However, it does appear there is a rhinoscriptsyntax MeshToNurbs command but not the opposite NurbsToMesh.

The only work around I thought was to use the grasshopper component MeshSphere, see code below, however the spheres do not seem to appear after generated, and for example I can’t change their colour. Should I do some baking somehow?

Any alternative way to convert a nurbs to a mesh (without sampling it and running a tesselation) you can think of?

import ghpythonlib.components as comps

sp1 = rs.AddSphere(pt, 2) #not needed if I use the component below
sp = comps.MeshSphere(pt,2,3,3)
rs.ObjectColor(sp, color)

Error message: Message: iteration over non-sequence of type Mesh

4 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5873

Trending Articles