surf.degree_u = 3 surf.degree_v = 3 # Get the control points from the generated grid surf.ctrlpts2d = surfgrid.grid() # Set knot vectors surf.knotvector_u = utilities.generate_knot_vector(surf.degree_u, surf.ctrlpts_size_u) surf.knotvector_v = utilities.generate_knot_vector(surf.degree_v, surf.ctrlpts_size_v) # Split the surface at v = 0.35 split_surf = surf.split_v(0.35) # Set sample size of the split surface split_surf.sample_size = 25 # Generate the visualization component and its configuration vis_config = VisPlotly.VisConfig(ctrlpts=False, legend=False) vis_comp = VisPlotly.VisSurface(vis_config) # Set visualization component of the split surface split_surf.vis = vis_comp # Plot the split surface split_surf.render() # Good to have something here to put a breakpoint pass
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Examples for the NURBS-Python Package Released under MIT License Developed by Onur Rauf Bingol (c) 2018 """ import os from geomdl import exchange from geomdl.visualization import VisPlotly as vis # Fix file path os.chdir(os.path.dirname(os.path.realpath(__file__))) # Read a directory containing smesh files multi_smesh = exchange.import_smesh('data') multi_smesh.sample_size = 5 # Draw the control point grid and the evaluated surface vis_config = vis.VisConfig(ctrlpts=False, legend=False) vis_comp = vis.VisSurface(vis_config) multi_smesh.vis = vis_comp multi_smesh.render() # Save MultiSurface as a .obj file exchange.export_obj(multi_smesh, "multisurface01.obj") # Good to have something here to put a breakpoint pass