热门

最新

红包

立Flag

投票

同城

我的

发布
ilypl
软硬兼吃曹达华
3 年前
trueilypl

NURBS-Python (geomdl) Examples

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
from geomdl import BSpline from geomdl.visualization import VisMPL # Create a BSpline surface instance (Bezier surface) surf = BSpline.Surface() # Set degrees surf.degree_u = 4 surf.degree_v = 3 # Set control points control_points = [[0, 0, 0], [0, 4, 0], [0, 8, -3],[1, 12, 5], [2, 0, 6], [2, 4, 0], [2, 8, 0], [2, 13, 7], [4, 0, 0], [4, 4, 0], [20, 28, 33], [4, 15,10], [6, 0, 0], [6, 4, -3], [6, 8, 0],[6, 11, 8], [8, 0, 0], [8, 5, -3], [8, 8, 0],[8, 12, 9]] surf.set_ctrlpts(control_points, 5, 4) # Set knot vectors surf.knotvector_u = [0, 0, 0, 0, 0.4, 0.6, 1, 1, 1, 1] surf.knotvector_v = [0, 0, 0, 0, 1, 1, 1, 1] # Set evaluation delta (control the number of surface points) surf.delta = 0.01 # Evaluate surface points surf.evaluate()
立即登录