add holes for phone and ioio

add holes for phone and ioio

// rustler-plate.scad: an electronics tray for Traxxas Rustler
// Daniel Epperson, 2015

// main surface
linear_extrude(height = 3, center = true)
difference() {

    // plate
    polygon(points=[[0,5],      [5,0],
                    [70,0],     [130,15],
                    [135,35],   [150,20],
                    [210,35],   [210,105],
                    [70,140],
                    [5,140],    [0,135],
                    [0,105],    [40,105],
                    [40,35],    [0,35]
    ]);

    // ESC hole
    translate([40, 70])
    circle(12, $fn=50);

    // right bolt hole
    translate([15, 15])
    circle(3, $fn=50);

    // left bolt hole
    translate([15, 125])
    circle(3, $fn=50);

    // front bolt hole
    translate([177, 100])
    circle(3, $fn=50);

    // ioio holes
    translate([140, 105]) circle(2, $fn=50);
    translate([133, 82])  circle(2, $fn=50);
    translate([75,  120]) circle(2, $fn=50);
    translate([68,  97])  circle(2, $fn=50);

    // phone mounts
    translate([205, 80]) circle(2, $fn=50);
    translate([205, 60]) circle(2, $fn=50);
    translate([75,  30]) circle(2, $fn=50);

}

// rear supports
difference()
{
    translate([0,0,-25])
    linear_extrude(height = 50, center = true)
    {

        // right
        translate([15, 15])
        circle(6, $fn=50);

        // left
        translate([15, 125])
        circle(6, $fn=50);
    }
    translate([0,0,-22])
    linear_extrude(height = 50, center = true)
    {

        // right tunnel
        translate([15, 15])
        circle(3, $fn=50);

        // left tunnel
        translate([15, 125])
        circle(3, $fn=50);
    }
}

// front support
difference()
{
    // front
    translate([0,0,-10])
    linear_extrude(height = 20, center = true)
    translate([177, 100])
    circle(6, $fn=50);

    // front tunnel
    translate([0,0,-7])
    linear_extrude(height = 20, center = true)
    translate([177, 100])
    circle(3, $fn=50);
}

// rustler-plate.scad: an electronics tray for Traxxas Rustler
// Daniel Epperson, 2015

// main surface
linear_extrude(height = 3, center = true)
difference() {

    // plate
    polygon(points=[[0,5],      [5,0],
                    [70,0],     [130,15],
                    [135,35],   [150,20],
                    [210,35],   [210,105],
                    [70,140],
                    [5,140],    [0,135],
                    [0,105],    [40,105],
                    [40,35],    [0,35]
    ]);

    // ESC hole
    translate([40, 70])
    circle(12, $fn=50);

    // right bolt hole
    translate([15, 15])
    circle(3, $fn=50);

    // left bolt hole
    translate([15, 125])
    circle(3, $fn=50);

    // front bolt hole
    translate([177, 100])
    circle(3, $fn=50);
}

// rear supports
difference()
{
    translate([0,0,-25])
    linear_extrude(height = 50, center = true)
    {

        // right
        translate([15, 15])
        circle(6, $fn=50);

        // left
        translate([15, 125])
        circle(6, $fn=50);
    }
    translate([0,0,-22])
    linear_extrude(height = 50, center = true)
    {

        // right tunnel
        translate([15, 15])
        circle(3, $fn=50);

        // left tunnel
        translate([15, 125])
        circle(3, $fn=50);
    }
}

// front support
difference()
{
    // front
    translate([0,0,-10])
    linear_extrude(height = 20, center = true)
    translate([177, 100])
    circle(6, $fn=50);

    // front tunnel
    translate([0,0,-7])
    linear_extrude(height = 20, center = true)
    translate([177, 100])
    circle(3, $fn=50);
}


Симпатичный код, глубина магнита, буква красивая


The z location was corrected.

The z location was corrected.


Fix some issues.

Fix some issues.

// Raspicam

// Copyright (c) 2014, Jérémie Decock (jd.jdhp@gmail.com)

// BODY /////////////////////////////////////

module body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {
    difference() {
        union() {
            difference() {
                body_main_board(board_width, board_height, board_depth, board_corner_radius);

                #union() {
                    translate([-board_width/2 + 10, 0, 0]){
                        body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);
                    }

                    translate([board_width/2 - camera_screw_holes_spacing_x/2 - 10, 0, 0]){
                        body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);
                        translate([-camera_screw_holes_spacing_x/2, 0, 0]){
                            body_camera_holes(camera_holes_width, screw_hole_depth);
                        }
                    }
                }
            }
            translate([-board_width/2, 0, hinge_radius_out - board_depth/2]) {
                rotate(a=[90,0,0]) {
                    body_hinge(hinge_radius_in, hinge_radius_out, board_height);
                }
            }
        }
        #translate([-board_width/2, 0, hinge_radius_out - board_depth/2]) {
            cube([hinge_radius_out * 2 + 2, hinge_slot_length, hinge_radius_out * 2 + 2], center=true);
        }
    }
}

module body_main_board(width, height, depth, radius) {
	$fn=50;
	//minkowski()
	//{
		cube([width, height, depth], center=true);
    //	cylinder(r=radius, h=depth, center=true);
    //}
}

module body_screw_holes(radius, spacing, depth, num) {
	$fn=50;

	for (i = [1:num]) {
		translate([i*spacing, 0, 0]) {
			cylinder(r=radius, h=depth, center=true);
		}
	}
}

module body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {
	$fn=50;

	for (i = [-1, 1]) {
        for (j = [-1, 1]) {
            translate([i*spacing_x/2, j*spacing_y/2, 0]) {
                cylinder(r=radius, h=depth, center=true);
            }
        }
	}
}

module body_camera_holes(width, depth) {
    cube([width, width, depth], center=true);
}

module body_hinge(radius_in, radius_out, length) {
    difference() {
        cylinder(r=radius_out, h=length, center=true, $fn=50);
        #cylinder(r=radius_in, h=length+10, center=true, $fn=50);
    }
}

// HINGE SCREW //////////////////////////////

module hinge_screw(radius, head_radius, length, head_length) {
    cylinder(r=head_radius, h=head_length, $fn=8);
    translate([0, 0, head_length/2]) cylinder(r=radius, h=length, $fn=50);

    translate([15, 0, 0]) {
        difference() {
            cylinder(r=head_radius, h=head_length, $fn=8);
            #translate([0, 0, head_length/2]) cylinder(r=radius, h=length, $fn=50);
        }
    }
}

// FEET /////////////////////////////////////

module feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {
    difference() {
        feet_main_board(board_width, board_height, board_depth, board_corner_radius);
        #feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);
        #feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);
    }

    translate([board_width/2 + hinge_shelf_width/2, 0, 0]) {
        cube([hinge_shelf_width, hinge_length, board_depth], center=true);
    }

    translate([board_width/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth/2]) {
        rotate(a=[90,0,0]) {
            feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);
        }
    }
}

module feet_screw_holes(radius, spacing_x, spacing_y, depth) {
	$fn=50;

	for (i = [-1, 1]) {
        for (j = [-1, 1]) {
            translate([i*spacing_x/2, j*spacing_y/2, 0]) {
                cylinder(r=radius, h=depth, center=true);
            }
        }
	}
}

module feet_ventilation_holes(radius, depth) {
	$fn=50;

    translate([0, 0, 0]) {
        cylinder(r=radius, h=depth, center=true);
    }
}

module feet_main_board(width, height, depth, radius) {
	$fn=50;
	//minkowski()
	//{
		cube([width, height, depth], center=true);
	//	cylinder(r=radius, h=depth, center=true);
	//}
}

module feet_hinge(radius_in, radius_out, length) {
    difference() {
        cylinder(r=radius_out, h=length, center=true, $fn=50);
        #cylinder(r=radius_in, h=length+10, center=true, $fn=50);
    }
}

/////////////////////////////////////////////

assign(feet_board_width=98,
       feet_board_height=65,
       feet_board_depth=3,
       feet_board_corner_radius=3,
       feet_screw_holes_radius=1.5,
       feet_screw_holes_spacing_x=70,
       feet_screw_holes_spacing_y=30,
       feet_screw_hole_depth=10,
       feet_hinge_shelf_width=20,
       feet_ventilation_holes_radius=3,
       body_board_width=100,
       body_board_height=40,
       body_board_depth=3,
       body_board_corner_radius=3,
       body_screw_hole_radius=1.5,
       body_screw_hole_spacing=5,
       body_screw_hole_depth=10,
       body_num_screw_holes=9,
       body_camera_screw_holes_radius=1,
       body_camera_screw_holes_spacing_x=12,
       body_camera_screw_holes_spacing_y=20,
       body_camera_holes_width=8,
       hinge_radius=1.5,
       hinge_head_radius=4.6,
       hinge_head_length=5) {

    color([0,0,1]) {
        translate([0, 50, body_board_depth/2]) {
            body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_slot_length=body_board_height / 3 + 1);
        }
    }

    color([1,0,0]) {
        translate([0, -50, feet_board_depth/2]) {
            feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);
        }
    }

    color([0,1,0]) {
        translate([-50, 0, 0]) {
            hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);
        }
    }
}

// Raspicam

// Copyright (c) 2014, Jérémie Decock (jd.jdhp@gmail.com)

// BODY /////////////////////////////////////

module body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {
    difference() {
        union() {
            difference() {
                translate([0, board_width/2, 0]){  // TODO: REMOVE THIS LINE!
                    rotate(a=[0,0,90]){            // TODO: REMOVE THIS LINE!
                        body_main_board(board_width, board_height, board_depth, board_corner_radius);
                    }
                }

                union() {
                    translate([0, board_width - num_screw_holes * screw_hole_spacing - 12.5, 0]){
                        body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);
                    }

                    translate([0, camera_screw_holes_spacing_y/2 + 10, 0]){
                        body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);
                        translate([0, camera_screw_holes_spacing_y/2, 0]){
                            body_camera_holes(camera_holes_width, screw_hole_depth);
                        }
                    }
                }
            }
            translate([0, board_width, hinge_radius_out - board_depth/2]) {
                rotate(a=[0,90,0]) {
                    body_hinge(hinge_radius_in, hinge_radius_out, board_height);
                }
            }
        }
        translate([0, board_width, hinge_radius_out - board_depth/2]) {
            cube([hinge_slot_length, hinge_radius_out * 2 + 2, hinge_radius_out * 2 + 2], center=true);
        }
    }
}

module body_main_board(width, height, depth, radius) {
	$fn=50;
	//minkowski()
	//{
		cube([width, height, depth], center=true);
    //	cylinder(r=radius, h=depth, center=true);
    //}
}

module body_screw_holes(radius, spacing, depth, num) {
	$fn=50;

	for (i = [1:num]) {
		translate([0, i*spacing, 0]) {
			cylinder(r=radius, h=depth, center=true);
		}
	}
}

module body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {
	$fn=50;

	for (i = [-1, 1]) {
        for (j = [-1, 1]) {
            translate([i*spacing_x/2, j*spacing_y/2, 0]) {
                cylinder(r=radius, h=depth, center=true);
            }
        }
	}
}

module body_camera_holes(width, depth) {
    cube([width, width, depth], center=true);
}

module body_hinge(radius_in, radius_out, length) {
    difference() {
        cylinder(r=radius_out, h=length, center=true, $fn=50);
        translate([0, 0, 0]) {
            cylinder(r=radius_in, h=length+10, center=true, $fn=50);
        }
    }
}

// HINGE SCREW //////////////////////////////

module hinge_screw(radius, head_radius, length, head_length) {
    cylinder(r=head_radius, h=head_length, $fn=8);
    translate([0, 0, head_length/2]) cylinder(r=radius, h=length, $fn=50);

    translate([15, 0, 0]) {
        difference() {
            cylinder(r=head_radius, h=head_length, $fn=8);
            translate([0, 0, head_length/2]) cylinder(r=radius, h=length, $fn=50);
        }
    }
}

// FEET /////////////////////////////////////

module feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {
    difference() {
        feet_main_board(board_width, board_height, board_depth, board_corner_radius);
        feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);
        feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);
    }

    translate([board_width/2 + hinge_shelf_width/2, 0, 0]) {
        cube([hinge_shelf_width, hinge_length, board_depth], center=true);
    }

    translate([board_width/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth/2]) {
        rotate(a=[90,0,0]) {
            feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);
        }
    }
}

module feet_screw_holes(radius, spacing_x, spacing_y, depth) {
	$fn=50;

	for (i = [-1, 1]) {
        for (j = [-1, 1]) {
            translate([i*spacing_x/2, j*spacing_y/2, 0]) {
                cylinder(r=radius, h=depth, center=true);
            }
        }
	}
}

module feet_ventilation_holes(radius, depth) {
	$fn=50;

    translate([0, 0, 0]) {
        cylinder(r=radius, h=depth, center=true);
    }
}

module feet_main_board(width, height, depth, radius) {
	$fn=50;
	//minkowski()
	//{
		cube([width, height, depth], center=true);
	//	cylinder(r=radius, h=depth, center=true);
	//}
}

module feet_hinge(radius_in, radius_out, length) {
    difference() {
        cylinder(r=radius_out, h=length, center=true, $fn=50);
        translate([0, 0, 0]) {
            cylinder(r=radius_in, h=length+10, center=true, $fn=50);
        }
    }
}

/////////////////////////////////////////////

assign(feet_board_width=98,
       feet_board_height=65,
       feet_board_depth=3,
       feet_board_corner_radius=3,
       feet_screw_holes_radius=1.5,
       feet_screw_holes_spacing_x=70,
       feet_screw_holes_spacing_y=30,
       feet_screw_hole_depth=10,
       feet_hinge_shelf_width=20,
       feet_ventilation_holes_radius=3,
       body_board_width=100,
       body_board_height=40,
       body_board_depth=3,
       body_board_corner_radius=3,
       body_screw_hole_radius=1.5,
       body_screw_hole_spacing=5,
       body_screw_hole_depth=10,
       body_num_screw_holes=9,
       body_camera_screw_holes_radius=1,
       body_camera_screw_holes_spacing_x=20,
       body_camera_screw_holes_spacing_y=12,
       body_camera_holes_width=8,
       body_hinge_radius_out=4.6,
       hinge_radius=1.5,
       hinge_head_radius=4.6,
       hinge_head_length=5) {

    color([1,0,0]) {
        translate([0, -50, feet_board_depth/2]) {
            feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=body_hinge_radius_out, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);
        }
    }

    color([0,0,1]) {
        translate([0, 0, body_board_depth/2]) {
            body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=body_hinge_radius_out, hinge_slot_length=body_board_height / 3 + 1);
        }
    }

    color([0,1,0]) {
        translate([-50, 0, 0]) {
            hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);
        }
    }
}


xaxis/carriage: misc debug stuff (remove colors etc)


fixed screws mounting location

fixed screws mounting location