Skip to content

Instantly share code, notes, and snippets.

@sofian
sofian / main.cpp
Last active January 1, 2026 23:18
Benchmark Plaquette parameters
/*
Plaquette-style parameter endpoint benchmark for ESP32.
Implements these access patterns in AbstractOscillator for:
period, frequency, bpm, skew
Benchmarks (cycles/op):
A) Direct setter: osc.period(x)
B) ParameterSlot accessor: x >> osc.paramPeriod()
C) Enum index: x >> osc[PERIOD]
@sofian
sofian / roundedCylinder.scad
Created October 21, 2022 04:27
Adds rounded edges to the cylinder() function.
// roundedCylinder.scad
// Author: Sofian Audry (github.com/sofian)
// Adds rounded edges to the cylinder() function.
// b : radius of bevels
// b1 : radius of bottom bevel
// b2 : radius of top bevel
module roundedCylinder($fn = $fn, $fa = 12, $fs = 2, h = 1, r = 1, center = false, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, b=0, b1=undef, b2=undef) {
_r = d==undef ? r : d/2;
_r1 = r1==undef ? (d1==undef ? _r : d1/2) : r1;
@sofian
sofian / tray.scad
Last active January 18, 2022 05:03
Allows you to create simple trays in OpenScad.
/* Tray
Allows you to create simple trays
Author: Sofian Audry
*/
/*
* tray.scad
* Allows you to create simple trays in OpenScad.
*
== GeneratorModel.h ==
class GeneratorModel : public QAbstractItemModel
{
Q_OBJECT
public :
GeneratorModel(QObject * parent = 0);
void rowCount(const QModelIndex& parent = QModelIndex()) const;
void columnCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
== GeneratorModel.h ==
class GeneratorModel : public QAbstractItemModel
{
Q_OBJECT
public :
GeneratorModel(QObject * parent = 0);
void rowCount(const QModelIndex& parent = QModelIndex()) const;
void columnCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;