This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* L-system OpenSCAD library by Hans Loeblich | |
Version 2.0 | |
- Now supports "M" move without draw | |
- Also support position save "[" and restore "]" | |
- Core functions have been completely rewritten and are about twice as fast using half the memory from before. | |
- Rules now take the form of a single string per rule: "X=ABC" | |
- Added new examples to demonstrate added features | |
This library is for creating L-systems, aka Lindenmayer System, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fs=0.2; | |
$fa=0.2; | |
headNum = 2; | |
phillipsDrive(headNum); | |
//phillipsDemo(headNum); | |
module phillipsDemo(num) { | |
difference() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shear such that point will translate by [p.x,p.y] as z-axis is traversed by p.z units | |
module shearAlongZ(p) { | |
multmatrix([ | |
[1,0,p.x/p.z,0], | |
[0,1,p.y/p.z,0], | |
[0,0,1,0] | |
]) children(); | |
} | |
rotate([0,0,0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division # allows floating point division from integers | |
from FreeCAD import Base | |
import Part | |
import math | |
# Run this macro to create a generic project enclosure box | |
# You can change all the parameters by selecting the object in the tree view and tweaking values in the "Data" tab | |
# Possible additions/improvements | |
# counterbore bridging .4mm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module rotate_about(a, v, p=[0,0,0]) { | |
translate(p) rotate(a,v) translate(-p) children(); | |
} | |
// example usage | |
rotate_about([0,45,0],p=[5,0,10]) | |
cylinder(r=5,h=10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fs = 2; | |
$fa = 2; | |
r_cyl = 10; | |
h_cyl = 100; | |
// Take a 2d shape and extrude outward (or inward with r_delta < 0) | |
// from a theoretical cylinder of given radius and height (centered). | |
// Input geometry should fit within the bounds of [-PI*r_cyl, -h/2] and [PI*r_cyl, h/2] | |
module cylinder_extrude(r_cyl, r_delta, h, eps=0.01) { | |
frags = fragments(r_cyl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is meant to help with updating old PRs. | |
# Mainly any OpenSCAD branch which has not been updated since 2022-02-06 | |
# It is intended to be run on a git repo in which a merge has already been started (merging master into the current, old branch), | |
# and has conflicts which show as "deleted by them:", or "(modified/deleted)". | |
# | |
# Due to how git DOES NOT track file moves/renames, in addition to how it determines file "similarity" (by # of exactly matched lines in a file), | |
# it makes it very difficult to merge master into branches created before 2 significant events in the OpenSCAD repo: | |
# 1) A large code style reformatting (PR #4095 on 2022-02-06), and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fs=0.5; | |
$fa=1; | |
// example usage | |
fillet_extrude(height=10,r1=3,r2=-3) { | |
hull() { | |
translate([-10,0]) circle(5); | |
translate([10,0]) circle(5); | |
} | |
rotate(90) hull() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fs=0.5; | |
$fa=1; | |
// General offset_extrude and fillet_extrude. | |
// These use minkowski which can be incredibly slow and resource intensive, but should theoretically work on any 2d geometry. | |
// fillet_extrude is also much slower than offset_extrude, due to significantly more facets needed for rounded edges. | |
// There are some alternative methods which are much faster, | |
// ***BUT*** they have the limitation of only working for CONVEX children. | |
// chamfer_extrude (basically like offset_extrude): https://gist.github.com/thehans/072005c68e5fcef3394b8c08e37d1c35 |
NewerOlder