Skip to content

Instantly share code, notes, and snippets.

View Sarah-C's full-sized avatar

Sarah Cartwright Sarah-C

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 5, 2024 14:09
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@mobizt
mobizt / TTGO_T8_V1.8_MicroSD_Test.ino
Created April 14, 2019 08:18
TTGO T8 V1.8 micro SD Card Test
//T8 V1.8 ESP32-WROVER 4MB PSRAM micro SD Test
#include <SD.h>
File dir;
void setup()
{
@thehans
thehans / alternative_spheres.scad
Last active March 6, 2022 04:02
Alternative sphere implementations in OpenSCAD userspace
translate([-30,0,0]) poly3d(sphere(r=9,$fn=80));
translate([-10,0,0]) poly3d(normalized_cube(r=9,div_count=20));
translate([10,0,0]) poly3d(spherified_cube(9,div_count=20));
translate([30,0,0]) poly3d(icosahedron(9,n=4));
module poly3d(p) {
polyhedron(points=p[0],faces=p[1]);
}
function normalize(v) = v / norm(v); // convert vector to unit vector