Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

52 lines (37 sloc) 1.05 KB
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Examples for the NURBS-Python Package
Released under MIT License
Developed by Onur Rauf Bingol (c) 2018
3-dimensional B-Spline curve
import os
from geomdl import BSpline
from geomdl import utilities
from geomdl import exchange
from geomdl.visualization import VisMPL
# Fix file path
# Create a B-Spline curve instance
curve = BSpline.Curve()
# Set up curve = 4
curve.ctrlpts = exchange.import_txt("ex_curve3d01.cpt")
# Auto-generate knot vector
curve.knotvector = utilities.generate_knot_vector(, len(curve.ctrlpts))
# Set evaluation delta = 0.001
# Evaluate curve
# Plot the control point polygon and the evaluated curve
vis_comp = VisMPL.VisCurve3D()
curve.vis = vis_comp
# Insert a knot
u = 0.2
# Draw the control point polygon and the evaluated curve after knot insertion
# Good to have something here to put a breakpoint
You can’t perform that action at this time.