Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thehans
thehans / gist:e45693b0bdf6077e92a225c2af67397a
Last active July 28, 2017 18:28
Roughly simulating gravitational effects in openscad, by request
use <functional.scad>; // from https://github.com/thehans/FunctionalOpenSCAD
black_hole_center = [5,5,5];
black_hole_mass = 45*$t;
wallsize = [10,10];
stepsize = [0.5,0.5];
grid = gridPoints([wallsize.x,0.1], stepsize);
wall = linear_extrude(height=10, poly=grid, slices=wallsize.y/stepsize.y);
warpedWall = warpPoints(wall, black_hole_center, black_hole_mass);
@thehans
thehans / rounded_cube.scad
Last active November 3, 2019 20:50
Rounded cube implementation
use <functional.scad>
$fa = 0.1;
$fs = 0.1;
module rounded_cube(size, r=0, center=false) {
s = is_array(size) ? size : [size,size,size];
c = is_array(center) ?
[center.x ? 0 : s.x, center.y ? 0: s.y, center.z ? 0 : s.z]/2 :
(center ? 0 : s/2);
This file has been truncated, but you can view the full file.
group() {
group() {
group();
}
group() {
group() {
group();
group() {
group() {
group();
module recur(i) {
if (i % 100 == 0) echo(i);
if (i > 0) {
recur(i-1);
}
}
recur(1000);
group() {
group();
group();
group();
group();
group();
group();
group();
group();
group();
/*
Thrust bearing by Hans Loeblich
License CC BY-SA
*/
/* [Hidden] */
// constants
in = 25.4;
$fa = 0.1;
//use <polyround.scad> // https://github.com/Irev-Dev/Round-Anything/blob/master/polyround.scad
$fs = 0.2;
$fa = 0.2;
total_h = 90;
fingers = 4;
d2 = 3;
d1 = (total_h - (fingers+1)*d2) / fingers;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Created in 2018 by Ryan A. Colyer.
// This work is released with CC0 into the public domain.
// https://creativecommons.org/publicdomain/zero/1.0/
include <plot_function.scad> // https://www.thingiverse.com/thing:2391851
finger_spacing = 21;
oblong_factor = 1.8;
ripple_sharpness = 0.6; // range [0:1]
grip_width = 20;