Skip to content
Permalink
Browse files

material() markup and better rendering controls

  • Loading branch information
felipesanches committed May 23, 2013
1 parent 080b0b3 commit a928086825820341fcbf7a4d5f024e5558bb7f44
Showing with 358 additions and 440 deletions.
  1. +3 −2 608zz_bearing.scad
  2. +0 −1 Metamaquina2.h
  3. +0 −2 Metamaquina2.scad
  4. +27 −30 NEMA.scad
  5. +61 −83 PowerSupply.scad
  6. +13 −18 RAMBo.scad
  7. +33 −34 ZLink.scad
  8. +18 −21 bar-clamp.scad
  9. +14 −23 belt-clamp.scad
  10. +4 −6 bolts.scad
  11. +3 −3 cable_clips.scad
  12. +0 −35 colors.h
  13. +2 −2 coupling.scad
  14. +5 −4 detailed_608zz_bearing.scad
  15. +16 −17 endstop.scad
  16. +13 −14 heated_bed.scad
  17. +7 −8 jhead.scad
  18. +2 −0 large_extruder_gear.scad
  19. +28 −39 lasercut_extruder.scad
  20. +7 −11 lm8uu_bearing.scad
  21. +2 −1 nozzle.scad
  22. +2 −2 nuts.scad
  23. +79 −59 render.h
  24. +2 −0 small_extruder_gear.scad
  25. +12 −17 spacer.scad
  26. +5 −8 washers.scad
@@ -19,6 +19,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

include <BillOfMaterials.h>;
include <render.h>;

module 608zz_bearing(details=false){
BillOfMaterials("608zz bearing");
@@ -31,7 +32,7 @@ module 608zz_bearing(details=false){
}

module 608zz_bearing_simple(){
color("silver"){
material("metal"){
linear_extrude(height=7)
difference(){
circle(r=22/2, $fn=40);
@@ -41,7 +42,7 @@ module 608zz_bearing_simple(){
}

module 608zz_bearing_detailed(){
color("silver"){
material("metal"){
//inner disc
linear_extrude(height=7)
difference(){
@@ -18,7 +18,6 @@

use <Metamaquina2.scad>;
include <render.h>;
include <colors.h>;

/*Thickness of acrylic or plywood sheets to use.*/
thickness = 6; //millimiters
@@ -22,7 +22,6 @@ include <BillOfMaterials.h>;
extruder_wiring_radius = 6;

//utils
include <colors.h>;
use <utils.scad>;
use <mm2logo.scad>;
use <rounded_square.scad>;
@@ -2114,7 +2113,6 @@ module XEndIdler(){
}

module BuildPlatform_pcb(){
material("pcb")
translate([0,0,pcb_height])
heated_bed();
}
@@ -22,47 +22,44 @@ include <NEMA.h>;
include <bolts.h>;
include <washers.h>;
use <rounded_square.scad>;
include <render.h>;

module NEMA17(){
BillOfMaterials("NEMA17 stepper motor");

if (render_rubber){
color(rubber_color){
translate([-NEMA17_width/2, -NEMA17_height/2, -0.1])
intersection(){
cube([NEMA17_width, NEMA17_height, NEMA17_length]);
translate ([NEMA17_width/2, NEMA17_height/2]) cylinder(r=0.87*NEMA17_width*sqrt(2)/2, h=100);
}
material("rubber"){
translate([-NEMA17_width/2, -NEMA17_height/2, -0.1])
intersection(){
cube([NEMA17_width, NEMA17_height, NEMA17_length]);
translate ([NEMA17_width/2, NEMA17_height/2]) cylinder(r=0.87*NEMA17_width*sqrt(2)/2, h=100);
}
}

if (render_metal){
color(metal_color){
translate([0, 0, -motor_shaft_length])
cylinder(r=motor_shaft_diameter/2, h=motor_shaft_length);

translate([0,0,-3])
cylinder(r1=6, r2=8, h=2);
material("metal"){
translate([0, 0, -motor_shaft_length])
cylinder(r=motor_shaft_diameter/2, h=motor_shaft_length);

translate([0,0,-0.2]){
difference(){
linear_extrude(height=NEMA17_length/5)
rounded_square([NEMA17_width+2, NEMA17_height+2], center=true, corners= [5,5,5,5]);
translate([0,0,-3])
cylinder(r1=6, r2=8, h=2);

translate([0,0,-0.2])
linear_extrude(height=1)
NEMA17_holes(central_hole=false);
}
translate([0,0,-0.2]){
difference(){
linear_extrude(height=NEMA17_length/5)
rounded_square([NEMA17_width+2, NEMA17_height+2], center=true, corners= [5,5,5,5]);

//connector detail
translate([-15.6/2,NEMA17_width/2 + 1, NEMA17_length - 4])
cube([15.6, 4.6, 4]);
translate([0,0,-0.2])
linear_extrude(height=1)
NEMA17_holes(central_hole=false);
}

translate([0,0,NEMA17_length - NEMA17_length/5])
linear_extrude(height=NEMA17_length/5)
rounded_square([NEMA17_width+2, NEMA17_height+2], center=true, corners=[5,5,5,5]);
//connector detail
translate([-15.6/2,NEMA17_width/2 + 1, NEMA17_length - 4])
cube([15.6, 4.6, 4]);
}

translate([0,0,NEMA17_length - NEMA17_length/5])
linear_extrude(height=NEMA17_length/5)
rounded_square([NEMA17_width+2, NEMA17_height+2], center=true, corners=[5,5,5,5]);
}

translate([0,0, NEMA17_length - 12.5])
@@ -73,14 +70,14 @@ module connector(){
//This is very hacky and someone should clean it up

translate([-15/2,NEMA17_width/2 + 1, 4]){
color("white")
material("nylon")
difference(){
cube([15, 6, 4]);
translate([1,1,0.5]) cube([13, 6, 3]);
translate([3.5,4,-1]) cube([8, 10, 3]);
}

color("grey")
material("metal")
for (i=[0:3]){
translate([4+i*2.3,6, 2])
rotate([90,0])
@@ -22,7 +22,6 @@ include <PowerSupply.h>;
include <bolts.h>;
include <washers.h>;
include <render.h>;
include <colors.h>;
include <rounded_square.scad>;
include <tslot.scad>;

@@ -68,11 +67,8 @@ module oldHiquaPowerSupply(){
BillOfMaterials("Power Supply cable");
}

if (render_metal){
color(metal_color){
cube([PowerSupply_thickness, PowerSupply_width, PowerSupply_height]);
}
}
material("metal")
cube([PowerSupply_thickness, PowerSupply_width, PowerSupply_height]);
}

metal_sheet_thickness = 1;
@@ -99,35 +95,31 @@ module HiquaPowerSupply(){
BillOfMaterials("Power Supply cable");
}

if (render_metal){
color(metal_color){
cube([PowerSupply_width, PowerSupply_height, metal_sheet_thickness]);
material("metal"){
cube([PowerSupply_width, PowerSupply_height, metal_sheet_thickness]);

translate([PowerSupply_width - metal_sheet_thickness, 0])
cube([metal_sheet_thickness, PowerSupply_height, PowerSupply_thickness]);
translate([PowerSupply_width - metal_sheet_thickness, 0])
cube([metal_sheet_thickness, PowerSupply_height, PowerSupply_thickness]);

translate([0,bottom_offset])
difference(){
cube([PowerSupply_width, PowerSupply_height - bottom_offset - top_offset, PowerSupply_thickness]);
translate([0,bottom_offset])
difference(){
cube([PowerSupply_width, PowerSupply_height - bottom_offset - top_offset, PowerSupply_thickness]);

translate([metal_sheet_thickness, metal_sheet_thickness])
cube([PowerSupply_width - 2*metal_sheet_thickness, PowerSupply_height - bottom_offset - top_offset - 2*metal_sheet_thickness, PowerSupply_thickness - metal_sheet_thickness]);
translate([metal_sheet_thickness, metal_sheet_thickness])
cube([PowerSupply_width - 2*metal_sheet_thickness, PowerSupply_height - bottom_offset - top_offset - 2*metal_sheet_thickness, PowerSupply_thickness - metal_sheet_thickness]);

if (detail){
translate([-23.5, 7, PowerSupply_thickness - 1.5*metal_sheet_thickness]){
linear_extrude(height=2*metal_sheet_thickness)
circle_pattern(r=4.6/2, spacing_x=6, spacing_y = 5, x=21,y=34);
}
if (detail){
translate([-23.5, 7, PowerSupply_thickness - 1.5*metal_sheet_thickness]){
linear_extrude(height=2*metal_sheet_thickness)
circle_pattern(r=4.6/2, spacing_x=6, spacing_y = 5, x=21,y=34);
}
}
}
}

if (render_pcb){
color(pcb_color){
translate([metal_sheet_thickness, -pcb_bottom_advance, pcb_height])
cube([PowerSupply_width - 2*metal_sheet_thickness, PowerSupply_height - top_offset, pcb_thickness]);
}
material("pcb"){
translate([metal_sheet_thickness, -pcb_bottom_advance, pcb_height])
cube([PowerSupply_width - 2*metal_sheet_thickness, PowerSupply_height - top_offset, pcb_thickness]);
}
}

@@ -257,47 +249,35 @@ module PowerSupplyBox_back_face(){
module PowerSupplyBox_side_sheet(){
BillOfMaterials(category="Lasercut wood", partname="Power Supply Box side sheet");

if (render_lasercut){
color(sheet_color){
linear_extrude(height=thickness)
PowerSupplyBox_side_face();
}
}
material("lasercut")
linear_extrude(height=thickness)
PowerSupplyBox_side_face();
}

module PowerSupplyBox_bottom_sheet(){
BillOfMaterials(category="Lasercut wood", partname="Power Supply Box bottom sheet");

if (render_lasercut){
color(sheet_color){
linear_extrude(height=thickness)
PowerSupplyBox_bottom_face();
}
}
material("lasercut")
linear_extrude(height=thickness)
PowerSupplyBox_bottom_face();
}

module PowerSupplyBox_front_sheet(){
BillOfMaterials(category="Lasercut wood", partname="Power Supply Box front sheet");

if (render_lasercut){
color(sheet_color){
linear_extrude(height=thickness)
PowerSupplyBox_front_face();
}
}
material("lasercut")
linear_extrude(height=thickness)
PowerSupplyBox_front_face();

ONOFF_Switch();
}

module PowerSupplyBox_back_sheet(){
BillOfMaterials(category="Lasercut wood", partname="Power Supply Box back sheet");

if (render_lasercut){
color(sheet_color){
linear_extrude(height=thickness)
PowerSupplyBox_back_face();
}
}
material("lasercut")
linear_extrude(height=thickness)
PowerSupplyBox_back_face();

translate([PowerSupply_thickness-thickness-PSU_Female_border_height/2, (box_height - bottom_offset)/2])
rotate(90)
@@ -346,45 +326,43 @@ module PowerSupply_FemaleConnector(){
border_thickness = 6.1;
depth = 13.1;

if (render_ABS){
color(ABS_color){
difference(){
union(){
translate([0,0,-depth])
linear_extrude(height=depth)
PowerSupply_FemaleConnector_large_hole();
material("ABS"){
difference(){
union(){
translate([0,0,-depth])
linear_extrude(height=depth)
PowerSupply_FemaleConnector_large_hole();

linear_extrude(height=border_thickness)
translate([-border_width/2,-border_height/2])
rounded_square([border_width, border_height], corners=[2,2,2,2]);

linear_extrude(height=border_thickness)
linear_extrude(height=3.9)
hull(){
translate([-border_width/2,-border_height/2])
rounded_square([border_width, border_height], corners=[2,2,2,2]);

linear_extrude(height=3.9)
hull(){
translate([-border_width/2,-border_height/2])
rounded_square([border_width, border_height], corners=[2,2,2,2]);

for (i=[-1,1])
translate([i*power_supply_bolts_distance/2, 0])
circle(r=6);
}
for (i=[-1,1])
translate([i*power_supply_bolts_distance/2, 0])
circle(r=6);
}
}

translate([0,0,border_thickness+0.1-depth])
linear_extrude(height=depth)
power_supply_generic_connector_shape(
width=24.6,
height=16.4,
bevel=4.2,
r1=1,
r2=2);

for (i=[-1,1]){
translate([i*power_supply_bolts_distance/2,0,-0.1])
cylinder(r=m3_diameter/2, h=10);

translate([i*power_supply_bolts_distance/2,0,2])
cylinder(r1=m3_diameter/2, r2=m3_diameter, h=3.9 - 2 + 0.1);
}
translate([0,0,border_thickness+0.1-depth])
linear_extrude(height=depth)
power_supply_generic_connector_shape(
width=24.6,
height=16.4,
bevel=4.2,
r1=1,
r2=2);

for (i=[-1,1]){
translate([i*power_supply_bolts_distance/2,0,-0.1])
cylinder(r=m3_diameter/2, h=10);

translate([i*power_supply_bolts_distance/2,0,2])
cylinder(r1=m3_diameter/2, r2=m3_diameter, h=3.9 - 2 + 0.1);
}
}
}

0 comments on commit a928086

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