This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Implements a b-spline surface as a 3-tuple of | |
scipy.interpolate.RectBivariateSpline instances, one | |
each for x, y and z. | |
""" | |
import math | |
import numpy as np | |
from scipy.interpolate import RectBivariateSpline | |
class BSplineSurf(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demonstration of how to 'zig-zag' an m x n x 3 | |
python array (m = passes, n = points per pass). | |
Includes some array creation/mod tricks | |
>>> import numpy as np | |
>>> a = np.random.randn(4,3,3) | |
>>> a | |
array([[[-0.74865489, 0.533361 , 0.51997179], | |
[-0.72109915, -0.74988902, -2.61720425], | |
[-0.72792437, 2.43027423, 0.84132144]], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.interpolate import RectBivariateSpline, bisplev | |
class ParaSurf(object): | |
def __init__(self, u, v, xyz, bbox=[-0.25, 1.25, -0.5, 1.5], ku=3, kv=3): | |
"""Parametric (u,v) surface approximation over a rectangular mesh. | |
Parameters | |
---------- |