formatting, renamed bezierExtrusion to bezier_extrusion
This commit is contained in:
parent
2d143d6a56
commit
7ab5da4b45
6 changed files with 86 additions and 101 deletions
103
hinge.scad
103
hinge.scad
|
|
@ -1,66 +1,53 @@
|
|||
module hinge(deg, lb, la){
|
||||
CutPoints = [
|
||||
[6,0,5.5],
|
||||
[6,7,5.5],
|
||||
[4.5,0,7],
|
||||
[4.5,7,7],
|
||||
[6,0,7],
|
||||
[6,7,7]];
|
||||
|
||||
cut_points = [[6,0,5.5],
|
||||
[6,7,5.5],
|
||||
[4.5,0,7],
|
||||
[4.5,7,7],
|
||||
[6,0,7],
|
||||
[6,7,7]];
|
||||
|
||||
CutFaces = [
|
||||
[0,2,4],
|
||||
[1,5,3],
|
||||
[0,1,3,2],
|
||||
[0,4,5,1],
|
||||
[2,3,5,4]];
|
||||
cut_faces = [[0,2,4],
|
||||
[1,5,3],
|
||||
[0,1,3,2],
|
||||
[0,4,5,1],
|
||||
[2,3,5,4]];
|
||||
|
||||
union(){
|
||||
difference(){
|
||||
cube([6,7,6], center = false);
|
||||
polyhedron(points = CutPoints, faces = CutFaces, convexity = 10);
|
||||
translate([3,3.5,3.5]){
|
||||
rotate(90, [1,0,0]){
|
||||
cylinder(h = 6, r = 2, center = true, $fn = 16);
|
||||
}
|
||||
union(){
|
||||
difference(){
|
||||
cube([6,7,6], center = false);
|
||||
polyhedron(points = cut_points, faces = cut_faces, convexity = 10);
|
||||
translate([3,3.5,3.5]){
|
||||
rotate(90, [1,0,0]) cylinder(h = 6, r = 2, center = true, $fn = 16);
|
||||
}
|
||||
if(deg <= 45){
|
||||
translate([3,2,4.75]){
|
||||
rotate(-deg,[0,1,0]){
|
||||
translate([0,0,-4]){
|
||||
cube([4,3,4], center = false);
|
||||
}
|
||||
if(deg <= 45){
|
||||
translate([3,2,4.75]){
|
||||
rotate(-deg,[0,1,0]){
|
||||
translate([0,0,-4]){
|
||||
cube([4,3,4], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
translate([1.75,2,3.5]){
|
||||
rotate(-deg,[0,1,0]){
|
||||
translate([0,0,-6]){
|
||||
cube([6,3,6], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
translate([1.75,2,3.5]){
|
||||
rotate(-deg,[0,1,0]){
|
||||
translate([0,0,-6]){
|
||||
cube([6,3,6], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
translate([4,2,1.5]){
|
||||
cube([4,3,4], center = false);
|
||||
}
|
||||
}
|
||||
cube([6.5,7,1.5], center = false);
|
||||
|
||||
translate([3,3.5,3.5]){
|
||||
rotate(90, [1,0,0]){
|
||||
cylinder(h = 4.5, r = 1.25, center = true, $fn = 16);
|
||||
}
|
||||
}
|
||||
translate([3,2.5,2.25]){
|
||||
cube([4,2,2.5], center = false);
|
||||
}
|
||||
translate([-lb,0,0]){
|
||||
cube([lb,7,6], center = false);
|
||||
}
|
||||
translate([7,0,0]){
|
||||
cube([la,7,6], center = false);
|
||||
}
|
||||
translate([4,2,1.5]) cube([4,3,4], center = false);
|
||||
}
|
||||
cube([6.5,7,1.5], center = false);
|
||||
|
||||
translate([3,3.5,3.5]){
|
||||
rotate(90, [1,0,0]) cylinder(h = 4.5, r = 1.25, center = true, $fn = 16);
|
||||
}
|
||||
translate([3,2.5,2.25]) cube([4,2,2.5], center = false);
|
||||
translate([-lb,0,0]) cube([lb,7,6], center = false);
|
||||
translate([7,0,0]) cube([la,7,6], center = false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue