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

Users who have contributed to this file

42 lines (31 sloc) 906 Bytes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Examples for the NURBS-Python Package
Released under MIT License
Developed by Onur Rauf Bingol (c) 2016-2018
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 the curve = 4
curve.ctrlpts = exchange.import_txt("ex_curve01.cpt")
# Auto-generate knot vector
curve.knotvector = utilities.generate_knot_vector(, len(curve.ctrlpts))
# Set evaluation delta = 0.01
# Evaluate curve
# Plot the control point polygon and the evaluated curve
vis_comp = VisMPL.VisCurve2D()
curve.vis = vis_comp
# Good to have something here to put a breakpoint
You can’t perform that action at this time.