Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First commit. A number of useful fillet primitives and a basid README.

  • Loading branch information...
commit ceae243fc30225cb52ae0b1cb6effa709a5ec20f 0 parents
@jfhbrook authored
Showing with 72 additions and 0 deletions.
  1. +11 −0 README.md
  2. +61 −0 fillets.scad
11 README.md
@@ -0,0 +1,11 @@
+# openscad-fillets
+
+A collection of fillet primitives for openscad.
+
+## docs
+
+The module's very small and has comments. Will do real docs when this has had more use.
+
+## bugs
+
+A number of these fillets should be translated slightly for easier positioning.
61 fillets.scad
@@ -0,0 +1,61 @@
+// 2d primitive for outside fillets.
+module fil_2d_o(r, angle=90) {
+ intersection() {
+ circle(r=r);
+ polygon([
+ [0, 0],
+ [0, r],
+ [r * tan(angle/2), r],
+ [r * sin(angle), r * cos(angle)]
+ ]);
+ }
+}
+
+// 2d primitive for inside fillets.
+module fil_2d_i(r, angle=90) {
+ difference() {
+ polygon([
+ [0, 0],
+ [0, -r],
+ [-r * tan(angle/2), -r],
+ [-r * sin(angle), -r * cos(angle)]
+ ]);
+ circle(r=r);
+ }
+}
+
+// 3d polar outside fillet.
+module fil_polar_o(R, r, angle=90) {
+ rotate_extrude(convexity=10) {
+ translate([R, 0, 0]) {
+ fil_2d_o(r, angle);
+ }
+ }
+}
+
+// 3d polar inside fillet.
+module fil_polar_i(R, r, angle=90) {
+ rotate_extrude(convexity=10) {
+ translate([R, 0, 0]) {
+ fil_2d_i(r, angle);
+ }
+ }
+}
+
+// 3d linear outside fillet.
+module fil_linear_o(l, r, angle=90) {
+ rotate([0, -90, 180]) {
+ linear_extrude(height=l, center=false) {
+ fil_2d_o(r, angle);
+ }
+ }
+}
+
+// 3d linear inside fillet.
+module fil_linear_o(l, r, angle=90) {
+ rotate([0, -90, 180]) {
+ linear_extrude(height=l, center=false) {
+ fil_2d_i(r, angle);
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.