I've been making a parametric design using NURBS implementation geomdl in python. the problem is that it is hollow and cannot be processed with cgal
or 3dprinted. I am looking for a way to make it watertight by closing the top and the bottom. I already tried to use trimesh.covex.convex_hull
function from the trimesh
library but it messed up the design.
Example code:
import os
from geomdl import NURBS
from geomdl import construct
from geomdl import exchange
from geomdl.visualization import VisMPL as vis
from geomdl import knotvector
os.chdir(os.path.dirname(os.path.realpath(__file__)))
# Create a NURBS surface instance
surf = NURBS.Surface()
# Set degrees
surf.degree_u = 2
surf.degree_v = 2
# Set control points from a template file
surf.set_ctrlpts(*exchange.import_txt("ctrlpts.cptw", two_dimensional=True, jinja2=True))
# Set knot vectors
surf.knotvector_u = knotvector.generate(surf.degree_u, surf.ctrlpts_size_u)
surf.knotvector_v = knotvector.generate(surf.degree_v, surf.ctrlpts_size_v)#[0, 0, 0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1, 1, 1]
# Set evaluation delta
surf.delta = 0.05
exchange.export_stl(surf, "test2.stl")
os.system('fstl ./test2.stl')
and the control points:
4.00,0.00,0.00,1.00;2.83,2.83,0.00,1.00;0.00,4.00,0.00,1.00;-2.83,2.83,0.00,1.00;-4.00,0.00,0.00,1.00;-2.83,-2.83,0.00,1.00;0.00,-4.00,0.00,1.00;2.83,-2.83,0.00,1.00;4.00,0.00,0.00,1.00
4.00,0.00,10.00,1.00;2.83,2.83,10.00,1.00;0.00,4.00,10.00,1.00;-2.83,2.83,10.00,1.00;-4.00,0.00,10.00,1.00;-2.83,-2.83,10.00,1.00;0.00,-4.00,10.00,1.00;2.83,-2.83,10.00,1.00;4.00,0.00,10.00,1.00
4.00,0.00,20.00,1.00;2.83,2.83,20.00,1.00;0.00,4.00,20.00,1.00;-2.83,2.83,20.00,1.00;-4.00,0.00,20.00,1.00;-2.83,-2.83,20.00,1.00;0.00,-4.00,20.00,1.00;2.83,-2.83,20.00,1.00;4.00,0.00,20.00,1.00
4.00,0.00,30.00,1.00;2.83,2.83,30.00,1.00;0.00,4.00,30.00,1.00;-2.83,2.83,30.00,1.00;-4.00,0.00,30.00,1.00;-2.83,-2.83,30.00,1.00;0.00,-4.00,30.00,1.00;2.83,-2.83,30.00,1.00;4.00,0.00,30.00,1.00
4.00,0.00,40.00,1.00;2.83,2.83,40.00,1.00;0.00,4.00,40.00,1.00;-2.83,2.83,40.00,1.00;-4.00,0.00,40.00,1.00;-2.83,-2.83,40.00,1.00;0.00,-4.00,40.00,1.00;2.83,-2.83,40.00,1.00;4.00,0.00,40.00,1.00
4.30,0.00,50.00,1.00;3.04,3.04,50.00,1.00;0.00,4.30,50.00,1.00;-3.04,3.04,50.00,1.00;-4.30,0.00,50.00,1.00;-3.04,-3.04,50.00,1.00;0.00,-4.30,50.00,1.00;3.04,-3.04,50.00,1.00;4.30,0.00,50.00,1.00
4.60,0.00,60.00,1.00;3.25,3.25,60.00,1.00;0.00,4.60,60.00,1.00;-3.25,3.25,60.00,1.00;-4.60,0.00,60.00,1.00;-3.25,-3.25,60.00,1.00;0.00,-4.60,60.00,1.00;3.25,-3.25,60.00,1.00;4.60,0.00,60.00,1.00
0.30,0.00,70.00,1.00;-0.96,3.04,70.00,1.00;-4.00,4.30,70.00,1.00;-7.04,3.04,70.00,1.00;-8.30,0.00,70.00,1.00;-7.04,-3.04,70.00,1.00;-4.00,-4.30,70.00,1.00;-0.96,-3.04,70.00,1.00;0.30,0.00,70.00,1.00
-3.70,0.00,80.00,1.00;-4.96,3.04,80.00,1.00;-8.00,4.30,80.00,1.00;-11.04,3.04,80.00,1.00;-12.30,0.00,80.00,1.00;-11.04,-3.04,80.00,1.00;-8.00,-4.30,80.00,1.00;-4.96,-3.04,80.00,1.00;-3.70,0.00,80.00,1.00
-7.70,0.00,90.00,1.00;-8.96,3.04,90.00,1.00;-12.00,4.30,90.00,1.00;-15.04,3.04,90.00,1.00;-16.30,0.00,90.00,1.00;-15.04,-3.04,90.00,1.00;-12.00,-4.30,90.00,1.00;-8.96,-3.04,90.00,1.00;-7.70,0.00,90.00,1.00
-11.70,0.00,100.00,1.00;-12.96,3.04,100.00,1.00;-16.00,4.30,100.00,1.00;-19.04,3.04,100.00,1.00;-20.30,0.00,100.00,1.00;-19.04,-3.04,100.00,1.00;-16.00,-4.30,100.00,1.00;-12.96,-3.04,100.00,1.00;-11.70,0.00,100.00,1.00
-15.70,0.00,110.00,1.00;-16.96,3.04,110.00,1.00;-20.00,4.30,110.00,1.00;-23.04,3.04,110.00,1.00;-24.30,0.00,110.00,1.00;-23.04,-3.04,110.00,1.00;-20.00,-4.30,110.00,1.00;-16.96,-3.04,110.00,1.00;-15.70,0.00,110.00,1.00