Remove all == 1 and just depend on implicit != 0

This commit is contained in:
Joel Ebel 2018-05-28 16:10:59 -04:00
parent 8b0e6c4d67
commit 7280687162

View File

@ -349,7 +349,7 @@ module Coque() { //Coque - Shell
color(Couleur1) { color(Couleur1) {
difference() { difference() {
MainBox(); MainBox();
if (Decorations == 1) { if (Decorations) {
Decorations(); Decorations();
} }
} }
@ -588,7 +588,7 @@ module BottomShell() {
union() { union() {
Coque(); Coque();
Tabs(); Tabs();
if (PCBFeet == 1) { if (PCBFeet) {
Feet(); Feet();
} }
} }
@ -624,7 +624,7 @@ module Panel() {
Cdia: diameter of hole Cdia: diameter of hole
*/ */
module CylinderHole(OnOff, Cx, Cy, Cdia) { module CylinderHole(OnOff, Cx, Cy, Cdia) {
if (OnOff == 1) { if (OnOff) {
echo("CylinderHole:", Cx=Cx, Cy=Cy, Cdia=Cdia + CutoutMargin*2); echo("CylinderHole:", Cx=Cx, Cy=Cy, Cdia=Cdia + CutoutMargin*2);
translate([Cx, Cy, 0]) { translate([Cx, Cy, 0]) {
circle(d=Cdia + CutoutMargin*2, $fn=100); circle(d=Cdia + CutoutMargin*2, $fn=100);
@ -646,7 +646,7 @@ module CylinderHole(OnOff, Cx, Cy, Cdia) {
Filet: radius of rounded corner Filet: radius of rounded corner
*/ */
module SquareHole(OnOff, Sx, Sy, Sl, Sw, Filet) { module SquareHole(OnOff, Sx, Sy, Sl, Sw, Filet) {
if (OnOff == 1) { if (OnOff) {
echo("SquareHole:", Sx=Sx - CutoutMargin, Sy=Sy - CutoutMargin, echo("SquareHole:", Sx=Sx - CutoutMargin, Sy=Sy - CutoutMargin,
Sl=Sl + CutoutMargin*2, Sw=Sw + CutoutMargin*2, Filet=Filet); Sl=Sl + CutoutMargin*2, Sw=Sw + CutoutMargin*2, Filet=Filet);
translate([Sx + Filet - CutoutMargin, Sy + Filet - CutoutMargin, 0]) { translate([Sx + Filet - CutoutMargin, Sy + Filet - CutoutMargin, 0]) {
@ -673,7 +673,7 @@ module SquareHole(OnOff, Sx, Sy, Sl, Sw, Filet) {
VAlign: Text vertical alignment. Defaults to "baseline". "top", "center", and "bottom" available. VAlign: Text vertical alignment. Defaults to "baseline". "top", "center", and "bottom" available.
*/ */
module LText(OnOff,Tx,Ty,Font,Size,Content, HAlign="center", VAlign="baseline") { module LText(OnOff,Tx,Ty,Font,Size,Content, HAlign="center", VAlign="baseline") {
if (OnOff == 1) { if (OnOff) {
echo("LText:", Tx=Tx, Ty=Ty, Font=Font, Size=Size, Content=Content, HAlign=HAlign, VAlign=VAlign); echo("LText:", Tx=Tx, Ty=Ty, Font=Font, Size=Size, Content=Content, HAlign=HAlign, VAlign=VAlign);
translate([Tx, Ty, PanelThick]) { translate([Tx, Ty, PanelThick]) {
linear_extrude(height=FontThick) { linear_extrude(height=FontThick) {
@ -699,7 +699,7 @@ module LText(OnOff,Tx,Ty,Font,Size,Content, HAlign="center", VAlign="baseline")
Content: The text Content: The text
*/ */
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) {
echo("CText:", Tx=Tx, Ty=Ty, Font=Font, Size=Size, echo("CText:", Tx=Tx, Ty=Ty, Font=Font, Size=Size,
TxtRadius=TxtRadius, Turn=Turn, Content=Content); TxtRadius=TxtRadius, Turn=Turn, Content=Content);
Angle = -Angl / (len(Content) - 1); Angle = -Angl / (len(Content) - 1);
@ -774,22 +774,22 @@ module BPanL() {
/////////////////////////// <- Main part -> ///////////////////////// /////////////////////////// <- Main part -> /////////////////////////
if (TShell == 1) { if (TShell) {
// Coque haut - Top Shell // Coque haut - Top Shell
TopShell(); TopShell();
} }
if (BShell == 1) { if (BShell) {
// Coque bas - Bottom shell // Coque bas - Bottom shell
BottomShell(); BottomShell();
} }
// Panneau avant - Front panel // Panneau avant - Front panel
if (FPanL == 1) { if (FPanL) {
FPanL(); FPanL();
} }
//Panneau arrière - Back panel //Panneau arrière - Back panel
if (BPanL == 1) { if (BPanL) {
BPanL(); BPanL();
} }