nurbs | Non-Uniform Rational B-Splines of any dimensionality | 3D Animation library

 by   StandardCyborg JavaScript Version: v1.1.1 License: MIT

kandi X-RAY | nurbs Summary

kandi X-RAY | nurbs Summary

nurbs is a JavaScript library typically used in User Interface, 3D Animation applications. nurbs has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Non-Uniform Rational B-Splines (NURBS) of any dimensionality
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              nurbs has a low active ecosystem.
              It has 122 star(s) with 16 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 7 open issues and 7 have been closed. On average issues are closed in 2 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of nurbs is v1.1.1

            kandi-Quality Quality

              nurbs has 0 bugs and 0 code smells.

            kandi-Security Security

              nurbs has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              nurbs code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              nurbs is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              nurbs releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              nurbs saves you 9 person hours of effort in developing the same functionality from scratch.
              It has 28 lines of code, 0 functions and 41 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed nurbs and discovered the below as its top functions. This is intended to give you an instant insight into nurbs implemented functionality, and help decide if they suit your requirements.
            • 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
            Get all kandi verified functions for this library.

            nurbs Key Features

            No Key Features are available at this moment for nurbs.

            nurbs Examples and Code Snippets

            No Code Snippets are available at this moment for nurbs.

            Community Discussions

            QUESTION

            JFreeChart setAutoRange when XYSplineRenderer is used as rendered
            Asked 2022-Mar-09 at 23:23

            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:11

            As 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.

            Source https://stackoverflow.com/questions/70021577

            QUESTION

            Calculate the centroid of a 3D mesh of triangles
            Asked 2021-Apr-14 at 15:47

            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 :

            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:23

            I 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:

            Source https://stackoverflow.com/questions/66891594

            QUESTION

            What is a generic data structure for bezier curves or b-splines?
            Asked 2021-Feb-27 at 19:43

            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:15

            The 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.

            Source https://stackoverflow.com/questions/66398441

            QUESTION

            How I can parse nurbs surface from dxf file? Or do you know library(for js, if exists or any other language) for parsing it?
            Asked 2021-Feb-19 at 09:28

            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:28

            Unfortunately 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.

            Source https://stackoverflow.com/questions/66272618

            QUESTION

            Using Nurbs Surface (Verb) in webGL, indices are always wrong unless I use corners instead of controlPoints
            Asked 2020-Dec-19 at 06:58

            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:58

            I 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

            Source https://stackoverflow.com/questions/65360634

            QUESTION

            Non-trivial algorithm conversion from imperative to functional
            Asked 2020-Sep-29 at 12:07

            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:55

            I'm not sure that it will work, but...:

            Source https://stackoverflow.com/questions/64087852

            QUESTION

            Python: Rotate plane (set of points) to match new normal vector using scipy.spatial.transform.Rotation
            Asked 2020-Sep-10 at 20:06

            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:06

            I think I ended up producing something that seems to work in the end:

            Source https://stackoverflow.com/questions/63287960

            QUESTION

            How to add boundary constraints to a spline with geomdl or other library?
            Asked 2020-May-09 at 09:09

            Here is the spline without constraints:

            ...

            ANSWER

            Answered 2020-May-09 at 09:09

            Well, 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:

            Source https://stackoverflow.com/questions/61674584

            QUESTION

            How to animate in oscillation a N surface in Three.js
            Asked 2020-Feb-05 at 14:33

            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:33

            The 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.

            Source https://stackoverflow.com/questions/60074696

            QUESTION

            Converting output of scipy.interpolate.splprep into NURBS format for IGES display
            Asked 2020-Jan-24 at 09:21

            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:21

            On 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.

            Source https://stackoverflow.com/questions/59733579

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install nurbs

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/StandardCyborg/nurbs.git

          • CLI

            gh repo clone StandardCyborg/nurbs

          • sshUrl

            git@github.com:StandardCyborg/nurbs.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular 3D Animation Libraries

            assimp

            by assimp

            angle

            by google

            s2geometry

            by google

            sverchok

            by nortikin

            rayshader

            by tylermorganwall

            Try Top Libraries by StandardCyborg

            StandardCyborgCocoa

            by StandardCyborgC++

            inertial-turntable-camera

            by StandardCyborgHTML

            StandardCyborgSDK

            by StandardCyborgC++

            protobag

            by StandardCyborgC++

            scsdk

            by StandardCyborgC++