Categories
code graphics opencv programming

Simple NURBS renderer [w/ code]

Simple NURBS renderer, reading from a DXF

Screen Shot 2013-12-18 at 11.01.23 AMDon’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:

Leave a Reply

Your email address will not be published. Required fields are marked *