Thingiverse
Fast voronoi method for OpenSCAD
by Amatulic
12
Downloads
17
Likes
0
Makes
Inspired by [OpenSCAD Voronoi Generator](https://www.thingiverse.com/thing:47649) by Felipe Sanches.
Two .scad files are provided:
* `fastvoronoi.scad` can be included on its own with no other libraries.
* `fastvoronoi_func_bosl2.scad` is for use with [BOSL2](https://github.com/BelfrySCAD/BOSL2). It provides a functional version of fastvoronoi that returns arrays of vertices, for use with BOSL2 operations such as `offset_sweep()` for rounding edges. Handling everything in vertex arrays rather than OpenSCAD's native internal objects is significantly slower but useful for fancier effects.
### Benchmark results
Testing 400 nuclei. Times are approximate averages from several runs. Fastvoronoi is about 12 times faster.
Voronoi times include 0.27 sec of array initializing:
* `fastvoronoi()` = **1.3 sec**
* original voronoi using `offset()` instead of `minkowski()` = **~16 sec**
* original voronoi by Felipe Sanches (using minkowski) = **~16 sec**
### Usage of `fastvoronoi.
Two .scad files are provided:
* `fastvoronoi.scad` can be included on its own with no other libraries.
* `fastvoronoi_func_bosl2.scad` is for use with [BOSL2](https://github.com/BelfrySCAD/BOSL2). It provides a functional version of fastvoronoi that returns arrays of vertices, for use with BOSL2 operations such as `offset_sweep()` for rounding edges. Handling everything in vertex arrays rather than OpenSCAD's native internal objects is significantly slower but useful for fancier effects.
### Benchmark results
Testing 400 nuclei. Times are approximate averages from several runs. Fastvoronoi is about 12 times faster.
Voronoi times include 0.27 sec of array initializing:
* `fastvoronoi()` = **1.3 sec**
* original voronoi using `offset()` instead of `minkowski()` = **~16 sec**
* original voronoi by Felipe Sanches (using minkowski) = **~16 sec**
### Usage of `fastvoronoi.
Did you print this model? Sign in and share your make!
Sign in to leave a comment
Sign inNo comments yet – be the first!