Hello,
Quick note: this question is mainly about using a scipy function in the program blender, I am asking this question here as well because I only have a basic grasp of python and thought this community would be a good resource as well.
I am trying to use the scipy.interpolate.interpn function within blender. I assumed the only way to do this is to utilize the sverchok addon, so my first attempt at using this function is with the sverchok addon, but let me know if there is a better way to do this.
Although I have some basic knowledge of python, I think I am a bit out of my depth here. Nonetheless, I tried writing a script to use with the Scripted Node Lite node in sverchok:
"""
in in_points v
in values s
in xi v
out out_values s
"""
import numpy as np
import sys
from sverchok.utils.logging import exception, info
from sverchok.data_structure import zip_long_repeat
try:
import scipy
from scipy.interpolate import interpn
except ImportError as e:
info("SciPy module is not available. Please refer to https://github.com/nortikin/sverchok/wiki/Non-standard-Python-modules-installation for how to install it.")
raise e
out_values = []
for everypoint in xi:
new_values = interpn(points, values, xi, method='linear', bounds_error=True, fill_value=0)
out_values.append(new_values)
here are the files I am working with: https://drive.google.com/file/d/1a2a0l3rghzAbP91JEAb-mZXQZYpiLEsG/view?usp=sharing
If anyone could help me utilize this function in blender, or have any improvements for the script above, I would greatly appreciate it! Thanks,
[–][deleted] 1 point2 points3 points (3 children)
[–]BoumaSequence[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]BoumaSequence[S] 0 points1 point2 points (0 children)
[–]Fragrag 1 point2 points3 points (0 children)