| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- include <../config/material_holder.scad>
- module material_holder_object() {
- diameter = material_holder_diameter;
- screw_diameter = material_holder_screw_diameter;
- screw_cutoff_diameter = material_holder_screw_cutoff_diameter;
- thickness = material_holder_thickness;
- top_thickness = thickness / 2;
- cog_thickness = thickness - top_thickness;
- cog_diameter = material_holder_cog_diameter;
- cog_count = material_holder_cog_count;
- module top_object() {
- difference() {
- cylinder(
- d = diameter,
- h = top_thickness,
- center = true
- );
- cylinder(
- d1 = screw_diameter,
- d2 = screw_cutoff_diameter,
- h = top_thickness,
- center = true
- );
- }
- }
- module cogs_object() {
- module cog() {
- move_y
- = diameter / 3
- + screw_diameter / 4;
- translate([0, move_y]) {
- cylinder(
- d2 = cog_diameter,
- d1 = 0,
- h = cog_thickness,
- center = true
- );
- }
- }
- for (count = [0 : (360 / cog_count) : 360]) {
- rotate(count) {
- cog();
- }
- }
- }
- module final_object() {
- translate([0, 0, top_thickness / 2]) {
- top_object();
- }
- translate([0, 0, -cog_thickness / 2]) {
- cogs_object();
- }
- }
- color("#607080") {
- render() {
- final_object();
- }
- }
- }
|