You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
679 B
20 lines
679 B
import utils.b_spline.parameter_selection as ps
|
|
import numpy as np
|
|
import utils.b_spline.bspline_curve as bc
|
|
import utils.b_spline.bspline_surface as bs
|
|
import matplotlib.pyplot as plt
|
|
from mpl_toolkits.mplot3d import Axes3D
|
|
import torch
|
|
|
|
def surface_inter(P_control):
|
|
k = q = 2
|
|
piece_uv = [6, 6]
|
|
knot_uv = [[0,0,0, 0.3,0.5,0.7, 1,1,1], [0,0,0, 0.3,0.5,0.7, 1,1,1]]
|
|
|
|
P_control = torch.cat((P_control.reshape(2,6,6), torch.zeros(1, 6, 6)), dim=0)
|
|
P_control = P_control.detach().numpy().tolist()
|
|
|
|
P_piece = bs.surface(P_control, k, q, piece_uv, knot_uv)
|
|
P_piece = torch.Tensor(P_piece)[:2,:,:].permute(1,2,0).reshape(72)
|
|
|
|
return P_piece
|
|
|