Zoom in until the node headers are visible, then export the image. Right now the graph is largely unreadable.
If I had to guess, your function node isn’t outputting an actual list, so what appears to be the first yellowed node (GetItemAtIndex?) isn’t working as intended.
Well, you have a List.Combine with no function attached to it, so, it’s outputting a null list.
It looks like you tried to make a list where index 0 was U values, and index 1 was V values? But you’re immediately splitting the list back apart in the next step, and you don’t use the combined list anywhere else in the script.
Can’t you just do this?
It still doen’t work.
Hi,
an example with numpy and NurbsSurface.ByPoints()
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import numpy as np
res = 50 # grid resolution
u_vals = np.linspace(0, 2 * np.pi, res)
v_vals = np.linspace(0, 2 * np.pi, res)
U, V = np.meshgrid(u_vals, v_vals)
# equation for Z values
Z = (1 - 0.5 * np.sin(U) * np.sin(V) - np.power(np.sin(V/2), 45) + np.power(np.cos(V), 2)) * \
(1 - np.power(np.cos(U/2), 90)) * (1 - np.power(np.cos(V/2), 90))
DS_pts = []
for i in range(res):
row = []
for j in range(res):
# convert numpy.float64 to float and create point
p = Point.ByCoordinates(float(U[i, j]), float(V[i, j]), float(Z[i, j]))
row.append(p)
DS_pts.append(row)
OUT = NurbsSurface.ByPoints(DS_pts), DS_pts
What is the error message?
Case-sensitivity, you didn’t copy+paste the code exactly. You’re using both uppercase and lowercase U/V.







