Don’t you just love scouring the web for a piece of simple code, come up short and then just write it yourself? Well that was the case with NURBS for me. These simple curvy lines, why doesn’t anyone just dish out a straightforward implementation of them? Well, now you have it. I wrote a simple renderer that reads a DXF file with NURBS (from Rhino3D) using DXFLIB, although the DXF file format is super easy to parse, and renders them to an image with OpenCV.
Other libraries that handle NURBS that could potentially work out: libnurbs, Nurbana (although it’s mostly a modeler/viewer), nmNURBS.
Here’s the gist of it:
Categories
Simple NURBS renderer [w/ code]
Simple NURBS renderer, reading from a DXF