예제 #1
0
 def insert_knot(self, direction, parameter, count=1):
     if direction == SvNurbsSurface.U:
         uv = [parameter, None]
         counts = [count, 0]
     elif direction == SvNurbsSurface.V:
         uv = [None, parameter]
         counts = [0, count]
     surface = operations.insert_knot(self.surface, uv, counts)
     return SvGeomdlSurface(surface)
예제 #2
0
파일: nurbs.py 프로젝트: Moult/sverchok
 def insert_knot(self, u, count=1):
     curve = operations.insert_knot(self.curve, [u], [count])
     return SvGeomdlCurve(curve)
예제 #3
0
# Set degrees
surf03.degree_u = 1
surf03.degree_v = 1

# Get the control points from the generated grid
surf03.ctrlpts2d = sg03.grid

# Set knot vectors
surf03.knotvector_u = utilities.generate_knot_vector(surf03.degree_u,
                                                     surf03.ctrlpts_size_u)
surf03.knotvector_v = utilities.generate_knot_vector(surf03.degree_v,
                                                     surf03.ctrlpts_size_v)

# Construct the parametric volume with a uniform knot vector
pvolume = construct.construct_volume('w', surf01, surf02, surf03, degree=1)

# Visualize volume
pvolume.vis = vis.VisVolume(vis.VisConfig(ctrlpts=True, evalpts=False))
pvolume.render()

# Insert knots
operations.insert_knot(pvolume, [None, None, 0.25], [0, 0, 1])
operations.insert_knot(pvolume, [None, None, 0.75], [0, 0, 1])

# Visualize volume after knot insertions
pvolume.render()

# Good to have something here to put a breakpoint
pass
예제 #4
0
파일: nurbs.py 프로젝트: Durman/sverchok
 def insert_knot(self, u, count=1, if_possible=False):
     curve = self.copy()
     curve = operations.insert_knot(curve.curve, [u], [count])
     r = SvGeomdlCurve(curve)
     r.u_bounds = self.u_bounds
     return r
예제 #5
0
surf03 = BSpline.Surface()

# Set degrees
surf03.degree_u = 2
surf03.degree_v = 1

# Get the control points from the generated grid
surf03.ctrlpts2d = sg03.grid

# Set knot vectors
surf03.knotvector_u = utilities.generate_knot_vector(surf03.degree_u,
                                                     surf03.ctrlpts_size_u)
surf03.knotvector_v = utilities.generate_knot_vector(surf03.degree_v,
                                                     surf03.ctrlpts_size_v)

# Construct the parametric volume with a uniform knot vector
pvolume = construct.construct_volume('w', surf01, surf02, surf03, degree=1)

# Visualize volume
pvolume.vis = vis.VisVolume(vis.VisConfig(ctrlpts=True, evalpts=False))
pvolume.render()

# Insert knots
operations.insert_knot(pvolume, [0.9, 0.1, None], [2, 1, 0])

# Visualize volume after knot insertions
pvolume.render()

# Good to have something here to put a breakpoint
pass