compmec / pynurbs Goto Github PK
View Code? Open in Web Editor NEWNURBS python object-oriented library
License: GNU General Public License v3.0
NURBS python object-oriented library
License: GNU General Public License v3.0
At the version v1.0.8
, calling degree_increase
or degree_decrease
raises a ValueError
when the parameter times = 0
is given.
It should do nothing in that case.
from compmec.nurbs import Curve
knotvector = (0, 0, 0, 1, 1, 1) # degree 2, npts 3
curve = Curve(knotvector)
curve.degree_increase(0) # Raises ValueError
curve.degree_decrease(0) # Raises ValueError
curve.degree = 2 # Does nothing since degree is already 2
Currently, the code accepts only ControlPoints as a vector, but for a single value it should return a value
import numpy as np
U = KnotVector([0, 0, 0, 0.5, 1, 1, 1]) # p = 2, n = 4
N = SplineBaseFunction(U)
P = np.random.rand(4)
C = SplineCurve(N, P)
t = np.linspace(0, 1, 11)
print("C(t),shape =", C(t).shape) # Should be (11,), not (11, 1)
Take the knotvector
from compmec.nurbs import KnotVector
knotvector = (0.0, 0.0, 1.8678173101311735, 1.8678173101311735)
knotvector = KnotVector(knotvector)
knotvector.normalize()
print(knotvector) # (0.0, 0.0, 0.9999999999999999, 0.9999999999999999)
It's expected to get the knotvector (0.0, 0.0, 1.0, 1.0)
The current functions to knot insertion and knot removal works only for a single point and only once per time.
To implement the sum of two different curves:
The current code for knot removal of splines works only for degree = 2, 3 and 4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.