mounting holes, rather than pegs

This commit is contained in:
Trammell Hudson 2015-03-07 17:45:25 -05:00
parent 976248e5f6
commit 59fcdf949c

View File

@ -41,6 +41,7 @@ print_multmatrix(
);
}
static void
make_faces(
const stl_3d_t * const stl,
@ -123,8 +124,8 @@ make_faces(
vertex_list[(k+1) % vertex_count]->p,
vertex_list[(k+2) % vertex_count]->p
);
printf("translate([%f,%f,0]) cylinder(r=%f,h=%f, $fs=1);\n",
x, y,
printf("translate([%f,%f,%f]) cylinder(r=%f,h=%f, $fs=1);\n",
x, y, -hole_height/2,
hole_rad,
hole_height
);
@ -148,7 +149,7 @@ main(void)
const double thickness = 3;
const double inset_dist = 2;
const double hole_dist = 5;
const double hole_rad = 3.3/2;
const double hole_rad = 3/2;
// for each vertex, find the coplanar triangles
// \todo: do coplanar bits
@ -182,20 +183,20 @@ main(void)
printf("}\n");
// add the screw holes
make_faces(stl, v, 0, 0, 0, hole_dist, hole_rad, thickness*3);
printf("} // difference\n");
// add back in the mounting pegs
//make_faces(stl, v, 0, 0, 0, hole_dist, hole_rad, thickness);
printf("}\n");
refframe_t avg;
refframe_init(&avg, avg_x, avg_y, avg_z);
printf("translate([0,0,15]) render() intersection() {\n");
printf("translate([0,0,12]) render() intersection() {\n");
printf("rotate([0,-90,0])");
print_multmatrix(&avg, 1);
printf("vertex_%d();\n", i);
printf("cube([100,100,30], center=true);\n");
printf("cube([100,100,24], center=true);\n");
printf("}\n");