I’m working thru the mesh problem, more to come on that I’m sure!
But I wanted to ask about using imports in the script node.
I’m trying to import “math”, error is flagged as undefined. Works fine in vscode, I’m thinking I’m importing in the wrong place or do I need to add the math module somewhere else in OV?
Thanks again,
Code below
import math
pi = math.pi
def PointsInCircum(r,n=100):
return [(math.cos(2pi/nx)r,math.sin(2pi/n*x)*r) for x in range(0,n+1)]
Hi @Sirens_uk. This has been completely overhauled and works in Create-2022.3 and Code-2022.3. I highly recommend moving to Create right now. As a work around on older versions, you can just stuff your imports in the function(s) that need them.
With the new script node, you really want to define a function called compute. That sort of serves as a “main” function for the node. When you create a new script node, you should see some boiler plate that explains it: