Skip to content

Category Archives: CNC

Poisson Voronoi diagram statistics

On g+, John Baez linked to work by Henk Hilhorst on the probability of finding voronoi cells with n sides in a poisson voronoi diagram. A poisson voronoi diagram has point sites randomly and uniformly distributed, like this: Here's the distribution I came up with, after counting the edges for each voronoi cell from 200 [...]

Random polygons with CGAL

At some point I'm going to need random simple polygons for testing my voronoi diagram code. CGAL includes a function random_polygon_2 which uses the "2-opt" heuristic (see Auer&Held-1996). I wrote a minimal boost::python wrapper around this function in order to test it and draw the polygons using vtk. Here are some examples of random polygons [...]

Random line-segment voronoi diagram

Update3: version 11.10-148 now goes to 16k line-sites without errors or warnings: Update2: This diagram with 8k vertices clearly has errors: Update: Version 11.10-141 now copes with 4k random segments. But I don't know of any smart way to check the diagram for correctness.. Constructing the vd for random (non-crossing) line-segments is a reasonable stress-test [...]

A/B Quadrature from EMC2

By popular demand a simple example of how to modify the stepper_mm sample configuration to output phase-A/phase-B quadrature signals (stepgen type=2). In core_stepper.hal we specify step type 2, and re-name/wire the stepgen output: loadrt stepgen step_type=2,2,2 net XA parport.0.pin-06-out Since I have neither a parport nor an oscilloscope at hand right now I'm using some [...]

EMC2 simulator build on Ubuntu 11.10

I thought I would build EMC2-simulator on 64-bit Ubuntu 11.10 following the instructions from the wiki. To get the source and dependencies: $ git clone git://git.linuxcnc.org/git/emc2.git emc2-dev $ cd emc2-dev $ cd debian $ ./configure sim $ cd .. $ dpkg-checkbuilddeps Then install all the required packages with "sudo apt-get install". dpkg-checkbuilddeps suggests installing tk8.4 [...]

Voronoi diagram algorithm animations

I've made some more progress with my voronoi diagram code. I described the topology-oriented incremental algorithm earlier here (point sites) and here (line segments). When we want to add a new site (a point or a line-segment) to the diagram we should find a tree of to-be-deleted vertices/edges (red), create new (green) vertices on all [...]

Line-segment vd animation

This shows the voronoi-diagram of a single line-segment together with an increasing number of point-sites. (watch it in 1080p on youtube!)

Line-segment voronoi diagram progress.

I've made some progress with my voronoi diagram code: Sites/generators in yellow. Line-edges in cyan, parabolic edges in red. Note that the parabolic edges are split at their apex, i.e. the closest point to the adjacent site. Some problems with hooking up the half-edges of the two new faces that are associated with a new [...]

Opencamlib with FreeCAD

Seen on IRC yesterday. The python-scripting capability of FreeCAD(a Qt + OpenCascade based free CAD-program) allows calling opencamlib for toolpath-calculations much like is done from HeeksCAD/CNC(a Wx + OpenCascade based free CAD-program). Cool. Another screenshot with waterline:

Threading and OpenGL, test 2

Here's a simple test program using LibQGLViewer (screen capture with xvidcap). The vertex array and the index array that OpenGL draws (using glDrawElements) are held in a GLData class which holds a mutex. The Viewer class locks the mutex while drawing, and the worker-thread locks the mutex while updating the data. Here the worker task [...]