NURBS-Python | Object-oriented pure Python B-Spline and NURBS library | Development Tools library
kandi X-RAY | NURBS-Python Summary
kandi X-RAY | NURBS-Python Summary
Object-oriented pure Python B-Spline and NURBS library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Insert knot
- Finds the span between the knot vector
- Find the multiplicity of a knot vector
- Flips a list of control points
- Removes knot from the object
- Calculates the coefficient of the knot removal
- Calculate the coefficient of knot removal
- R Remove knot removal
- R Fix surfaces for multiple surfaces
- Return the degree operations of a spline geometry
- Render the plot
- Decorator to cache lru_cache
- Render plot
- Imports a mesh object from a file
- Animate the surface
- Render the surface
- Rotate object
- Approximate the curve
- R Split the surface of the surface
- R Split the surface of a surface
- Imports a text file
- Return a list of Geometry objects corresponding to the input geometry
- Refine a knot vector
- Trim a surface trims
- Compute the surface of the surface
- Render the plot
NURBS-Python Key Features
NURBS-Python Examples and Code Snippets
Community Discussions
Trending Discussions on NURBS-Python
QUESTION
I am wondering how you would model arbitrarily complex Bézier curves. I am not quite understanding the underlying abstraction yet of what a bezier curve is fundamentally composed of, as there are too many equations. I would like to have a generic struct that defines a bezier curve. The SVG path gives many examples of the types of curves you can create. They include linear, cubic, and quadratic bezier curves.
If a B-spline is a better generic model, then that would be fine to use too. I am not familiar with those yet tho. Difference between bezier segment and b-spline. I guess "a B-spline curve is a curve that consists of Bezier curves as segments", so that is what I am looking for.
SVG docs say:
Cubic Béziers take in two control points for each point.
Several Bézier curves can be stringed together to create extended, smooth shapes. Often, the control point on one side of a point will be a reflection of the control point used on the other side to keep the slope constant. In this case, a shortcut version of the cubic Bézier can be used, designated by the command S (or s).
The other type of Bézier curve, the quadratic curve called with Q, is actually a simpler curve than the cubic one. It requires one control point which determines the slope of the curve at both the start point and the end point. It takes two parameters: the control point and the end point of the curve.
Arcs and NURBS (non-uniform rational B-splines) are more complex than just plain bezier curves, but it would be nice if the model could be generalized enough to include these as well. Basically I would like a generic model of bezier curves/b-splines/nurbs to use in a drawing/graphics framework, and not sure what that would be.
- Must each bezier class be implemented separately, or can they be combined into one generic class?
- If separate, are they each basically just an array of control points?
So basically I start to think:
...ANSWER
Answered 2021-Feb-27 at 18:15The most generic data structure for a Bezier curve is simply one that contains an array of control points. The degree of the Bezier curve is the number of control points - 1. So, linear, quadratic and cubic Bezier curves can all use the same data structure with difference in number of control points.
For B-spline curve, the generic data structure will contain
- Degree (D)
- Number of control points (N)
- Array of control points
- Knot sequence.
The knot sequence is simply a "double[ ]" of length = N+D+1. The knot values need to be in non-decreasing order.
QUESTION
So I'm currently trying to take slices on a plane orthogonal to a spline. Direction doesn't really matter too much since I'm using the points to interpolate 3D scans
I'm mainly unsure about the rotmat method (this is a stripped down version of my class, technically a NURBS-Python surface derived class), where I'm rotating the plane mesh from a flat x/y plane (all z=0) to match the new normal vector (tangent of the spline, stored in the der variable).
Anyone have an idea how to rotate a set of points to go from one normal vector to another? The angle around the axis of the new vector doesn't matter than much to me.
(sorry for vg, kind of an obscure library but somewhat convenient actually):
...ANSWER
Answered 2020-Sep-10 at 20:06I think I ended up producing something that seems to work in the end:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NURBS-Python
You can use NURBS-Python like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page