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)
def insert_knot(self, u, count=1): curve = operations.insert_knot(self.curve, [u], [count]) return SvGeomdlCurve(curve)
# 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
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
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