Search the Community
Showing results for tags 'scipy'.
-
What is the recommended procedure to install Scipy together with Houdini? I was following this Link but unfortunately it does not seem to work! http://wordpress.discretization.de/houdini/home/advanced-2/installing-and-using-scipy-in-houdini/ Cheers, P.
-
This is an example for building landscapes from irregular points using SciPy. import numpy as np from scipy.interpolate import griddata # FIRST INPUT: REGULAR GRID node = hou.pwd() geo1 = node.geometry() grid_x = np.array(geo1.pointFloatAttribValues("px")) grid_y = np.array(geo1.pointFloatAttribValues("py")) grid_z = np.array(geo1.pointFloatAttribValues("pz")) # SECOND INPUT: RANDOM POINTS inputs = node.inputs() geo2 = inputs[1].geometry() val_x = np.array(geo2.pointFloatAttribValues("px")) val_y = np.array(geo2.pointFloatAttribValues("py")) val_z = np.array(geo2.pointFloatAttribValues("pz")) # MULTIVARIATE INTERPOLATION grid_y = griddata( (val_x, val_z), val_y, (grid_x, grid_z), fill_value=0.0, method='cubic' ) # methods: nearest, cubic, linear # NEW HEIGHT POSITIONS ON GRID geo1.setPointFloatAttribValuesFromString("py",grid_y.astype(np.float32)) scipy_grid_to_points.hiplc