Put all if blocks in curly braces and use spacing

Following style guide at https://www.thingiverse.com/thing:12768
This commit is contained in:
Joel Ebel 2018-05-03 22:01:52 -04:00
parent 07d3dfa9bb
commit 3767d5bd27

View File

@ -301,34 +301,37 @@ module Panel(Length,Width,Thick,Filet) {
// <- Circle hole -> // <- Circle hole ->
// Cx=Cylinder X position | Cy=Cylinder Y position | Cdia= Cylinder dia | Cheight=Cyl height // Cx=Cylinder X position | Cy=Cylinder Y position | Cdia= Cylinder dia | Cheight=Cyl height
module CylinderHole(OnOff,Cx,Cy,Cdia) { module CylinderHole(OnOff,Cx,Cy,Cdia) {
if(OnOff==1) if(OnOff == 1) {
translate([Cx,Cy,-1]) translate([Cx,Cy,-1])
cylinder(d=Cdia,10, $fn=50); cylinder(d=Cdia,10, $fn=50);
}
} }
// <- Square hole -> // <- Square hole ->
// Sx=Square X position | Sy=Square Y position | Sl= Square Length | Sw=Square Width | Filet = Round corner // Sx=Square X position | Sy=Square Y position | Sl= Square Length | Sw=Square Width | Filet = Round corner
module SquareHole(OnOff,Sx,Sy,Sl,Sw,Filet) { module SquareHole(OnOff,Sx,Sy,Sl,Sw,Filet) {
if(OnOff==1) if(OnOff == 1) {
minkowski() { minkowski() {
translate([Sx+Filet/2,Sy+Filet/2,-1]) translate([Sx+Filet/2,Sy+Filet/2,-1])
cube([Sl-Filet,Sw-Filet,10]); cube([Sl-Filet,Sw-Filet,10]);
cylinder(d=Filet,h=10, $fn=100); cylinder(d=Filet,h=10, $fn=100);
} }
}
} }
// <- Linear text panel -> // <- Linear text panel ->
module LText(OnOff,Tx,Ty,Font,Size,Content) { module LText(OnOff,Tx,Ty,Font,Size,Content) {
if(OnOff==1) if(OnOff == 1) {
translate([Tx,Ty,Thick+.5]) translate([Tx,Ty,Thick+.5])
linear_extrude(height = 0.5) { linear_extrude(height = 0.5) {
text(Content, size=Size, font=Font); text(Content, size=Size, font=Font);
} }
}
} }
// <- Circular text panel-> // <- Circular text panel->
module CText(OnOff,Tx,Ty,Font,Size,TxtRadius,Angl,Turn,Content) { module CText(OnOff,Tx,Ty,Font,Size,TxtRadius,Angl,Turn,Content) {
if(OnOff==1) { if(OnOff == 1) {
Angle = -Angl / len(Content); Angle = -Angl / len(Content);
translate([Tx,Ty,Thick+.5]) translate([Tx,Ty,Thick+.5])
for (i= [0:len(Content)-1] ) { for (i= [0:len(Content)-1] ) {
@ -380,37 +383,42 @@ module FPanL() {
/////////////////////////// <- Main part -> ///////////////////////// /////////////////////////// <- Main part -> /////////////////////////
if(TShell==1) if(TShell == 1) {
// Coque haut - Top Shell // Coque haut - Top Shell
color( Couleur1,1) { color( Couleur1,1) {
translate([0,Width,Height+0.2]) { translate([0,Width,Height+0.2]) {
rotate([0,180,180]) { rotate([0,180,180]) {
Coque(); Coque();
} }
} }
}
} }
if(BShell==1) if(BShell == 1) {
// Coque bas - Bottom shell // Coque bas - Bottom shell
color(Couleur1) { color(Couleur1) {
Coque(); Coque();
}
} }
// Pied support PCB - PCB feet // Pied support PCB - PCB feet
if (PCBFeet==1) if(PCBFeet == 1) {
// Feet // Feet
translate([PCBPosX,PCBPosY,0]) { translate([PCBPosX,PCBPosY,0]) {
Feet(); Feet();
}
} }
// Panneau avant - Front panel <<<<<< Text and holes only on this one. // Panneau avant - Front panel <<<<<< Text and holes only on this one.
//rotate([0,-90,-90]) //rotate([0,-90,-90])
if(FPanL==1) if(FPanL == 1) {
translate([Length-(Thick*2+m/2),Thick+m/2,Thick+m/2]) translate([Length-(Thick*2+m/2),Thick+m/2,Thick+m/2])
FPanL(); FPanL();
}
//Panneau arrière - Back panel //Panneau arrière - Back panel
if(BPanL==1) if(BPanL == 1) {
color(Couleur2) color(Couleur2)
translate([Thick+m/2,Thick+m/2,Thick+m/2]) translate([Thick+m/2,Thick+m/2,Thick+m/2])
Panel(Length,Width,Thick,Filet); Panel(Length,Width,Thick,Filet);
}