CAD Curve Basics

A boundary representation (BREP) is a data structure used to represent all things topological: 3D meshes, 2d vector curves, volumes, etc. This post is about what makes a good boundary representation for CAD, tailored to support complex curves in a mathematically intutive (and correct) way.

What Is A Curve

What is a curve? A curve is a multidimensional function that is parameterized with one variable.

fx(t),fy(t)fx(t), fy(t)
Continue reading CAD Curve Basics

Simple GPU Vector Graphics With Spatial Trees

Rendering 2D vector graphics on the GPU is a notoriously vexing problem. The most popular publicly available methods are either slow (stencil and cover) or highly memory intensive (cached prerendered buffers, e.g. most SVG renderers). In truth none of this is necessary; rendering vector graphics on the GPU is not hard if you use, as the saying goes, this one neat trick.

Continue reading Simple GPU Vector Graphics With Spatial Trees

Clothoid Splines

A century ago engineers had very good and robust means of drafting 2D curves using specialized spline sets and curve templates (e.g. French curves).  But these proved difficult to replicate in early computers; the need for fast, simple algorithms drove first Bezier, and then de Boor to embrace the idea of polynomial-based splines.

Creating a spline from independent polynomial functions along the x/y/z axes has a number of problems.  Such splines cannot be represented in arc length form and, more importantly, controlling their curvature functions is not easy.   Polynomial splines are computationally simple but mathematically complex.  

Continue reading Clothoid Splines