3d-stuff/openscad/own/parametric wargaming base/wargaming_base.scad

36 lines
1.0 KiB
OpenSCAD
Raw Normal View History

2021-11-16 20:18:36 +01:00
// Inverted Wargaming base
// by zeus - 2021-11-11 - CC-BY-NC-SA-4.0
// ###
// Variables
base_lower_dia=32; //diameter in mm
base_upper_dia=30; //upper diameter
cutout_dia=base_upper_dia-1.6; //adjusted for 2 walls on 0.4 nozzle (0.4*2*2)
base_h=4; //overall height
mt=1.5; //bottom thickness, suitable for 0.3 and 0.5 layers
2021-11-27 22:01:53 +01:00
scale_factor=1.1; // scaling in y-dimension
magnet_dia=5.5;
magnet_h=1.1;
magnet_count=2;
2021-11-16 20:18:36 +01:00
$fn=150;
//
// ###
// Model
2021-11-27 22:01:53 +01:00
difference(){
scale([1,scale_factor,1]){
difference(){
cylinder(r1=base_lower_dia/2, r2=base_upper_dia/2, h=base_h);
translate([0,0,mt])cylinder(r=cutout_dia/2, h=base_h-mt+0.1);
2021-11-16 20:18:36 +01:00
}
2021-11-27 22:01:53 +01:00
}
if (magnet_count==1){
translate([0,0,-0.01])#cylinder(r=magnet_dia/2,h=magnet_h);
}
else{
for (x =[-(base_lower_dia*scale_factor/2-(magnet_dia)):(base_lower_dia*scale_factor-(2*magnet_dia))/(magnet_count-1):(base_lower_dia*scale_factor/2-(magnet_dia))]){
translate([0,x,-0.01])#cylinder(r=magnet_dia/2,h=magnet_h);
}
}
2021-11-16 20:18:36 +01:00
}