Skip to content
Permalink
Browse files

SerialNumer in the bottom of the power supply box. Automating generat…

…ion of a serial number panel.
  • Loading branch information
felipesanches committed Jun 14, 2013
1 parent c955037 commit e0e85d1a34c97ca0c6108621a4d6d61a10500b05
Showing with 4,731 additions and 4 deletions.
  1. +2 −0 Metamaquina2.h
  2. +5 −4 lasercutter_panel.scad
  3. +52 −0 serial_number_panel.scad
  4. +4,608 −0 serial_number_template.dxf
  5. +64 −0 svg/serial_number_template.svg
@@ -62,3 +62,5 @@ extruder_mount_holes_distance = X_rods_distance + 14;

XPlatform_height = 45;

//[revision_id, batch_number, first_id, size_of_batch]
batch_run = false;
@@ -18,7 +18,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use <Metamaquina2.scad>;
include <Metamaquina2.h>;
use <endstop.scad>;
use <lasercut_extruder.scad>;
use <belt-clamp.scad>;
@@ -217,9 +217,10 @@ module lasercutter_panel(){
mirror([0,1]) //we want to keep the burnt side visible because it looks good!
PowerSupplyBox_back_face();

# translate([265,385])
PowerSupplyBox_bottom_face();

if (batch_run==false){
#translate([265,385])
PowerSupplyBox_bottom_face();
}
}


@@ -0,0 +1,52 @@
//A lasercutter plate for a batch_run with serial number strings

include <Metamaquina2.h>;
include <PowerSupply.h>;

module serial_number_plate(){
assign(revision_id = batch_run[0],
batch_number = batch_run[1],
first_id = batch_run[2],
size_of_batch = batch_run[3]){
for (i=[0:size_of_batch-1]){
translate([7*(i%2), i*52])
face_with_serial_number(revision_id, batch_number, first_id+i);
}
}
}

module glyph(char, fontsize){
scale(fontsize/12){
import("font.dxf", layer=char);
}
}

module draw_number(value, digits, spacing=0.7, fontsize=7){
string = str(value + pow(10,digits));
text_length = (len(string)+1) * spacing*fontsize;
translate([- text_length/2, fontsize/3]){
for (i=[0:digits-1]){
translate([spacing*fontsize*i,0])
if (i+1<len(string))
glyph(string[i+1], fontsize);
else
glyph("0", fontsize);
}
}
}

module face_with_serial_number(revision_id, batch_number, id){
difference(){
PowerSupplyBox_bottom_face();
translate([30,15])
import("serial_number_template.dxf");

translate([45,13])
draw_number(batch_number, 2);

translate([64,13])
draw_number(id, 4);
}
}

serial_number_plate();

0 comments on commit e0e85d1

Please sign in to comment.
You can’t perform that action at this time.