nurbs | Non-Uniform Rational B-Splines of any dimensionality | 3D Animation library
kandi X-RAY | nurbs Summary
kandi X-RAY | nurbs Summary
Non-Uniform Rational B-Splines (NURBS) of any dimensionality
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parses NURLSBString .
- Returns the domain component of the polygon .
- Create an accessor function .
- Returns the size of the shape .
- Infer type of data
- Wrap the aggregation function to reduce the aggregation function
- Create a n - angular function .
- push changes to the argument
- Returns true if x is empty
- debug line debug
nurbs Key Features
nurbs Examples and Code Snippets
Community Discussions
Trending Discussions on nurbs
QUESTION
A chart needs to be plotted with smooth shape, so XYSplineRenderer is used. Also, the NumberAxis needs to be autoranged to the segment of data.
But in some cases when the spline is calculated, some spline values are out of the autorange segment and the curve is not plotted entirely.
Seems that the autorange is evaluated before the spline is calculated.
To mitigate it, I have adjusted the range of the vertical axis by increasing this range by a percentage of the range limits. But this leads to inaccurate curve fitting to charts, since depending of the data input the percentage could be up to 25%.
...ANSWER
Answered 2021-Nov-21 at 23:11As noted in JFreeChart adding trend-line outside of actual values, such anomalies are inevitable for functions that are not strictly monotonic. Absent more detailed spline control, you may get a better result by enabling auto-range on the problematic axis (the default) and adjusting the axis margin empirically.
QUESTION
I'm trying to calculate the centroid of a 3D mesh of triangles.
EDIT : it turns out I was not, I was trying to calculate the center of gravity, which is not the same
My code is made of bits and pieces, mainly :
- This nice paper by Cha Zhang and Tsuhan Chen
- SO : How to calculate the volume of a 3D mesh object the surface of which is made up triangles
- SO : How to compute the centroid of a mesh with triangular faces?
I compared my results to those provided by Rhino. I calculate the centroid and volume :
- of the reference NURBS volume with Rhino 7
- of a 27k triangle mesh with Rhino 7
- of a simplified 1k triangle mesh with Rhino 7
- of the same 1k triangle mesh with my code.
As you can see, it works great to calculate the volume, but not for the centroid, and i can't seem to know why. I need the error to be less than 0.01. I checked everything several times, but there must be something obvious.
I'm not great with numerical instability :
- should I work in milimeters instead of meters ?
- should I calculate the tetrahedrons signed volume with another point than the origin, as suggested by galinette in the second reference ? I tried and it didn't improve much.
MY CODE
Before calculationg anything, I check that my mesh is correct (code not provided) :
- closed mesh, no naked edges or any holes ;
- the vertices of all triangles are ordered consistently, i.e. triangles are correctly oriented towards the outside of the mesh.
ANSWER
Answered 2021-Apr-08 at 19:23I think you're making it a bit more complicated than it needs to be. All you need to do is work out the average x,y,z of all the points and that is your center. You can do each individually, so the pseudocode would be:
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
I am trying to parse autocad nurbs surface and draw with triangulation using webGL in javascript. I already looked for dxf parser by bjnortier. It supports majority entities like line,arc,3Dface, polyline, lwpolyline, etc., but doesn't support surfaces. Is there any library? Help, please!
...ANSWER
Answered 2021-Feb-19 at 09:28Unfortunately these entities like BODY, 3DSOLID, SURFACE, REGION and so on, are stored as ACIS data embedded in DXF files.
The ACIS data is embedded in different ways for different DXF version. For older DXF versions the ACIS data is embedded as poorly encrypted text file (SAT) in the entity body and starting with DXF R2013, binary files (SAB) stored in the ACDSDATA section.
But even if you can extract this data, it is pretty much useless, because the ACIS format is not an open data format and you need a license by Spatial Inc., which gives you access to their SDK, to process the ACIS data.
So it is very unlikely you will find a free library which supports ACIS entities.
QUESTION
I am trying to make Verb's Nurbs Surface to work with vanilla webGL (cheating a bit with webgl-utils though). PIXI.js also yields the same results, corners work, but not the control points.
I could do it using corners verb.geom.NurbsSurface.byCorners
however when I try to use the controlPoints using verb.geom.NurbsSurface.byKnotsControlPointsWeights
the surface gets messed up, most probably the indices are wrong!
There is an example of using verb with THREE.js but even when I try the same functions used in the example, the results are the same.
I have commented out the function based on the corners, you can see that it works. I console logged srf
and from the _data
object I could see Verb is generating those control points under the hood, but the same points would not work if I try them with byKnotsControlPointsWeights
Apart from a working solution, I also would like to understand why the code does not work, and which part in the THREE.js is different from my vanilla code that makes it work with THREE but not here.
...ANSWER
Answered 2020-Dec-19 at 06:58I don't know what it's supposed to look like but the code was passing 2 for the size of the positions when calling gl.vertexAttribPointer
but the data has 3 (x, y, z). Setting that to 3 certainly gets a different image. Still need to make sure UVs are set to a size of 2
QUESTION
To enforce my (weak) functional programming skills, I am studying The NURBS book by Piegl and Tiller converting all the algorithms to Haskell. It is a very nice and instructive process but I got stuck on algorithm 2.2, here is (a C-like reworked-by-me version of) the pseudo-code:
...ANSWER
Answered 2020-Sep-27 at 12:55I'm not sure that it will work, but...:
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:
QUESTION
Here is the spline without constraints:
...ANSWER
Answered 2020-May-09 at 09:09Well, tough topic, but I got it, inspired by this for 2D border (derivative) constrained splines. The proposed solution makes use also of scipy.optimize.minimize
.
Here is the full code, and after some explanations:
QUESTION
I want to create a NURBS surface that is animated in oscillation with Three.js.
This is my initialization of the NURBS:
...ANSWER
Answered 2020-Feb-05 at 14:33The following live snippet shows you can transform the vertices of a NURBS surface represented by an instance of ParametricBufferGeometry
. Notice how BufferAttribute.setUsage()
is used in order to tell WebGL that you are going to change the position attribute dynamically per frame.
The animation is very basic but the code should illustrate the intended approach.
QUESTION
I'm looking to convert a series of ordered (pretty dense) 2D points describing arbitrary curves into a NURBS representation, which can be written into an IGES file.
I'm using scipy.interpolate's splprep to get a B-spline representation of the given series of points, and then I had presumed the NURBS definition would essentially be this plus saying all weights are equal to 1. However I think I am fundamentally misinterpreting the output of splprep, specifically the relation between 'B-spline coefficients' and the control points needed to manually recreate the spline in some CAD package (I am using Siemens NX11).
I've tried a simple example of approximating the function y = x^3 from a sparse set of points:
...ANSWER
Answered 2020-Jan-24 at 09:21On the off chance this niche query helps anyone else- it turns out the problem was incorrect formatting of the parameter data section in the IGES. The data describing the spline can't take up > 64 characters per line. The interpretation of splprep output was correct, the (c_x, c_y) arrays describe the (x,y) coordinates of successive poles. The equivalent NURBS definition just requires specification of all weights = 1.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nurbs
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