summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-01-31 15:44:57 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-01-31 15:44:57 +0100
commit392ab1017c0491412d452013f2af02b7bf06cd1a (patch)
tree2f56078030f031f13faa59186a9a67e719963075
parent1c6a2cbe7b799e6ccb387b45546c779dcf9d3a9b (diff)
prepared body with all holes except mounting holes
-rw-r--r--body/body.scad116
-rw-r--r--body/holes.scad27
-rw-r--r--body/laser.scad6
-rw-r--r--body/laser_holder.scad10
-rw-r--r--body/m12_connectors.scad4
-rw-r--r--body/noctua_nf_a4x20.scad1
-rw-r--r--body/radxa_zero_3e.scad188
7 files changed, 292 insertions, 60 deletions
diff --git a/body/body.scad b/body/body.scad
index 127d005..1db4742 100644
--- a/body/body.scad
+++ b/body/body.scad
@@ -1,3 +1,4 @@
+include <body_config.scad>
include <design.scad>
include <helpers.scad>
include <holes.scad>
@@ -8,24 +9,6 @@ include <noctua_nf_a4x20.scad>
include <radxa_zero_3e.scad>
include <veye_imx287.scad>
-// main frame size
-// in scanner coords
-// inner height is a bit random
-// TODO: choose constant size to use one frame for
-// many similar ranges
-main_frame_height_y = 150;
-main_frame_width_x = 34;
-main_frame_depth_z = 56;
-
-// wall and wall thickness
-$sbfwo = $scannerBodyFrontWallOffsetMm;
-$wawt = -$scannerBodyFrontWallOffsetMm + $scannerBodyWallThicknessMm;
-wt = $scannerBodyWallThicknessMm;
-wzo = $scannerBodyFrontWallOffsetMm;
-
-// scanner coords
-fan_y_offset = 80;
-
module cam_and_lense_new()
{
lhs = laser_holder_size();
@@ -559,35 +542,72 @@ module scanner_main_frame()
}
}
+ // back wall, bottom
+ translate([0, bwo, 10])
+ hole_holder_hot_inserts(hs = hole_side_back);
+
+ // back wall, top
+ translate([0, bwo, 120])
+ hole_holder_hot_inserts(hs = hole_side_back);
+
+ // top wall
+ translate([0, 0, two])
+ hole_holder_hot_inserts(hs = hole_side_top);
+
+ // front wall, bottom
+ translate([0, fwo, 12])
+ hole_holder_hot_inserts(hs = hole_side_front);
+
+ // front wall, top
+ translate([0, fwo, 83])
+ hole_holder_hot_inserts(hs = hole_side_front);
+
// TODO: and now add some stands for screwing left/right covers
// TODO: simplify inner cut cube after implementing this:
// rounded corners won't be needed anymore
// chinese fan
//translate([0, -$scannerBodyFrontWallOffsetMm, 40])
- translate([0, -wzo - id, fan_y_offset])
+ *translate([0, bwo, fan_y_offset])
ld3007ms();
}
-module m12_connectors()
+// s - scale
+module m12_connectors(s = [1, 1, 1])
{
- // inner height, width, depth and radius
+ // inner height, width, depth and radius (scanner coords)
ih = main_frame_height_y;
iw = main_frame_width_x;
id = main_frame_depth_z;
ir = wt;
+ // scanner coords
+ bottom_connector_y = 28;
+ bcy = bottom_connector_y;
+
+ m12tpd = m12_male_conn_body_thick_part_d;
+
{
// add outer m12 connectors
//scale([1.05, 1, 1.05])
- translate([0, -wzo - id + $tiny_padding, 20 + m12_male_conn_body_thick_part_d + 5])
+ // scale([1.1, 1, 1.1])
+ translate([0, bwo + $tiny_padding, bcy + m12tpd + 5])
+ scale(s)
m12_female_connector();
- translate([0, -wzo - id + $tiny_padding, 20])
+ translate([0, bwo + $tiny_padding, bcy])
+ scale(s)
m12_male_connector();
}
}
+module m12_connectors_to_cut()
+{
+ //translate([0, $tiny_padding * 50, 0])
+
+ m12_connectors([1.05, 1, 1.05]);
+}
+
module laser_with_holder()
{
translate([0, -$laserZOffsetMm, 0])
@@ -600,20 +620,33 @@ module laser_with_holder()
module body_fan_holes()
{
id = main_frame_depth_z;
- translate([0, -wzo - id, fan_y_offset])
+ translate([0, fwo, fan_y_offset])
ld3007ms_holes();
}
module radxa()
{
translate([0, 0, 20])
- translate([
- 0,
- -$scannerBodyFrontWallOffsetMm - 5,
- radxa_zero_3e_pcb_h - 10])
+ translate([0, fwo - 13, radxa_zero_3e_pcb_h - 5])
rotate([90, 0, 0])
//radxa_zero_3e_with_protoboard();
- radxa_zero_3e_with_protoboard_and_connectors();
+ {
+ radxa_zero_3e_with_protoboard_and_connectors();
+ %radxa_zero_3e_mount_plate_with_holes();
+ }
+}
+
+module radxa_body_cutter()
+{
+ translate([0, 0, 20])
+ translate([0, fwo - 13, radxa_zero_3e_pcb_h - 5])
+ rotate([90, 0, 0])
+ *radxa_zero_3e_mount_plate_holes();
+
+ translate([0, 0, 20])
+ translate([0, fwo, radxa_zero_3e_pcb_h - 5])
+ rotate([90, 0, 0])
+ radxa_zero_3e_mount_plate_outer_holes();
}
module other()
@@ -638,7 +671,7 @@ module other()
// visual block
// visualize camera
-union()
+*union()
{
translate([0, 0, $lenseYPosMm])
%rotate([-$opticalAxisAngleDegrees, 0, 0])
@@ -658,7 +691,7 @@ union()
}
}
-union()
+*union()
{
other();
@@ -671,10 +704,14 @@ union()
camera_hole();
laser_glass_hole();
laser_holder_screw_holes();
- m12_connectors();
+ m12_connectors_to_cut();
+ //m12_connectors_to_cut();
cam_lense_holder_screw_holes();
- body_fan_holes();
+ //body_fan_holes();
+ radxa_body_cutter();
}
+ %m12_connectors();
+ //m12_connectors_to_cut();
}
// printing cam/lense holder
@@ -690,17 +727,24 @@ union()
}
// printing body
-*difference()
+difference()
{
scanner_main_frame();
camera_hole();
laser_glass_hole();
laser_holder_screw_holes();
- m12_connectors();
+ //m12_connectors();
+ m12_connectors_to_cut();
+ //body_fan_holes();
+ radxa_body_cutter();
}
*translate([0, -$laserZOffsetMm, 0])
{
%laser_body();
laser_holder();
-} \ No newline at end of file
+}
+
+//m12_connectors();
+//m12_connectors_to_cut();
+//radxa_body_cutter(); \ No newline at end of file
diff --git a/body/holes.scad b/body/holes.scad
index a764dc7..5074ddc 100644
--- a/body/holes.scad
+++ b/body/holes.scad
@@ -1,5 +1,6 @@
include <design.scad>
include <helpers.scad>
+include <body_config.scad>
// `Heat` in module name means heat brass threaded insert
@@ -14,11 +15,15 @@ hole_side_bottom = [0, 0, 0];
hole_side_left = [0, 90, 0];
hole_side_right = [0, -90, 0];
-hole_insert_height = 4;
m2_head_diameter = 3.75;
m2_head_height = 1.9;
m2 = 2;
+// some default values
+// TODO: propagate everywhere
+hole_insert_height = 4;
+hole_insert_diameter = 4;
+
padding_around_insert = 2;
// gw - glass width
@@ -138,21 +143,19 @@ module screw_hole(m, id, il, hd, hh, hs, wt = $scannerBodyWallThicknessMm)
// full head diameter
fhd = hd + hdd;
fhh = hh + hhd;
- echo("hh:", hh);
- echo("fhh:", fhh);
translate([0, 0, wt - fhh - $tiny_padding])
cylinder($fn = dToFn(fhd), d = fhd, h = fhh + $tiny_padding * 2);
}
}
}
-function padded_hole_d(hd = 4) =
+function padded_hole_d(hd = hole_insert_diameter) =
hd + padding_around_insert * 2;
// h - height
// hd - hole diameter
// TODO: support usual holes, not only hot inserts
-module hole_holder(h, hd = 4)
+module hole_holder(h, hd = hole_insert_diameter)
{
d = padded_hole_d(hd);
cube_size = [d * 2, d / 2, h];
@@ -182,14 +185,17 @@ module hole_holder(h, hd = 4)
// h - height
// hd - hole (insert) diameter
// hs - hole side, see values above for details
-module hole_holder_hot_inserts(h, hd = 4, hs)
+module hole_holder_hot_inserts(
+ h = main_frame_width_x,
+ hd = hole_insert_diameter,
+ hs)
{
d = hd + padding_around_insert * 2;
rotate(hs)
difference()
{
- hole_holder(h = 40, hd = 4);
+ hole_holder(h = h, hd = hd);
// holes for hot inserts
union()
@@ -215,11 +221,14 @@ module hole_holder_hot_inserts(h, hd = 4, hs)
}
}
-hole_holder_hot_inserts(h = 40, hd = 4, hs = hole_side_top);
+*hole_holder_hot_inserts(
+ h = main_frame_width_x,
+ hd = hole_insert_diameter,
+ hs = hole_side_top);
*screw_hole(
m = m2,
- id = 4,
+ id = hole_insert_diameter,
il = hole_insert_height * 2,
hd = m2_head_diameter,
hh = m2_head_height,
diff --git a/body/laser.scad b/body/laser.scad
index b4dc8aa..32658e9 100644
--- a/body/laser.scad
+++ b/body/laser.scad
@@ -1,8 +1,10 @@
include <design.scad>
include <helpers.scad>
+include <body_config.scad>
-default_laser_d = 14;
-default_laser_l = 45;
+// up to 0.7 inside measurement range, but can be bigger outside.
+// non-ideal printing/manufacturing is also possible
+laser_ray_thickness = 1;
// create a body of laser with diameter `d` and
// length `l`.
diff --git a/body/laser_holder.scad b/body/laser_holder.scad
index f5c4562..8416db9 100644
--- a/body/laser_holder.scad
+++ b/body/laser_holder.scad
@@ -1,16 +1,6 @@
include <helpers.scad>
include <laser.scad>
-default_laser_holder_padding = [4, 1.5, 1.5];
-
-// d - laser body diameter
-// l - laser body length
-// padding - see `laser_holder_wo_holes` for details
-function laser_holder_size(
- d = default_laser_d,
- l = 45,
- padding = default_laser_holder_padding) = ([d, l / 2, d] + padding * 2);
-
// create a holder for laser with diameter `d` and
// length `l`. no holes
// with one-side `padding` for each axis
diff --git a/body/m12_connectors.scad b/body/m12_connectors.scad
index 3916b96..ec3a816 100644
--- a/body/m12_connectors.scad
+++ b/body/m12_connectors.scad
@@ -12,7 +12,7 @@ m12_female_conn_body_outer_part_length = 16;
m12_female_conn_body_outer_part_d = 15.1;
m12_female_conn_body_outer_part_flat_w = 13.4;
-m12_female_conn_body_wires_length = 20;
+m12_female_conn_body_wires_length = 12;
m12_female_conn_body_wires_d = 8;
// male
@@ -23,7 +23,7 @@ m12_male_conn_body_outer_part_length = 16;
m12_male_conn_body_outer_part_d = 12;
m12_male_conn_body_outer_part_flat_w = 10.6;
-m12_male_conn_body_wires_length = 20;
+m12_male_conn_body_wires_length = 12;
m12_male_conn_body_wires_d = 8;
// wl - wires length
diff --git a/body/noctua_nf_a4x20.scad b/body/noctua_nf_a4x20.scad
index f6a1945..5d3a2a0 100644
--- a/body/noctua_nf_a4x20.scad
+++ b/body/noctua_nf_a4x20.scad
@@ -1,4 +1,5 @@
include <holes.scad>
+include <body_config.scad>
noctua_nf_a4x20_h = 40;
noctua_nf_a4x20_w = 40;
diff --git a/body/radxa_zero_3e.scad b/body/radxa_zero_3e.scad
index 731f883..b5eca5f 100644
--- a/body/radxa_zero_3e.scad
+++ b/body/radxa_zero_3e.scad
@@ -1,12 +1,21 @@
include <helpers.scad>
+include <noctua_nf_a4x20.scad>
radxa_zero_3e_pcb_w = 30;
radxa_zero_3e_pcb_h = 65;
radxa_zero_3e_pcb_thickness = 1.6;
+radxa_zero_3e_pcb_screw_offset = 3.5;
+radxa_zero_3e_pcb_distance_between_holes_w = 23;
+radxa_zero_3e_pcb_distance_between_holes_h = radxa_zero_3e_pcb_h - radxa_zero_3e_pcb_screw_offset * 2;
+
rpi_protoboard_connectors_h = 12;
rpi_protoboard_z_offset = 15;
+radxa_zero_3e_fan_hole_offset = 28;
+radxa_zero_3e_mount_plate_screw_holder_height = 4;
+radxa_zero_3e_mount_plate_h = 2;
+
function radxa_zero_3e_pcb_size() = [
radxa_zero_3e_pcb_w,
radxa_zero_3e_pcb_h,
@@ -80,9 +89,186 @@ module radxa_zero_3e_with_protoboard_and_connectors()
radxa_zero_3e_rj45_male();
}
+module radxa_zero_3e_mount_plate()
+{
+ // outer screw holder diameter. there is no more space there,
+ // so only round 6 mm screw holders will fit under radxa
+ oshd = 6;
+ // screw holder height
+ shh = radxa_zero_3e_mount_plate_screw_holder_height;
+
+ dbhw = radxa_zero_3e_pcb_distance_between_holes_w;
+ dbhh = radxa_zero_3e_pcb_distance_between_holes_h;
+ so = radxa_zero_3e_pcb_screw_offset;
+
+ outer_cyl_delta = so - oshd / 2;
+ ocd = outer_cyl_delta;
+ bph = radxa_zero_3e_mount_plate_h;
+ hih = hole_insert_height;
+ hid = hole_insert_diameter;
+
+ echo("radxa_zero_3e_pcb_distance_between_holes_h: ", radxa_zero_3e_pcb_distance_between_holes_h);
+ echo("dbhh: ", dbhh);
+
+ difference()
+ {
+ union()
+ {
+ // hole holders
+ translate([0, 0, -shh / 2])
+ for (xo = [-dbhw / 2, dbhw / 2], yo = [-so, -so - dbhh])
+ {
+ //translate([-dbhw / 2, -so, 0])
+ translate([xo, yo, 0])
+ cylinder($fn = dToFn(oshd), d = oshd, h = shh, center = true);
+ }
+
+ // outer hole holders
+ *translate([0, 0, -shh / 2])
+ for (xo = [-dbhw / 2 - ocd, dbhw / 2 + ocd], yo = [-so + ocd, -so - dbhh - ocd])
+ {
+ translate([xo, yo, 0])
+ cylinder($fn = dToFn(oshd), d = oshd, h = shh, center = true);
+ }
+
+ // bottom plate
+ hull()
+ translate([0, 0, -shh - bph / 2])
+ for (xo = [-dbhw / 2, dbhw / 2], yo = [-so, -so - dbhh])
+ {
+ //translate([-dbhw / 2, -so, 0])
+ translate([xo, yo, 0])
+ cylinder($fn = dToFn(oshd), d = oshd + 1, h = bph, center = true);
+ }
+
+ // fan: distance between holes
+ fdbh = ld3007ms_distance_between_holes;
+
+ // fan/plate hole holders
+ fan_plate_hole_holder_h = hih - bph;
+ fphhh = fan_plate_hole_holder_h;
+ translate([0, 0, -shh / 2])
+ translate([0, -radxa_zero_3e_fan_hole_offset / 2 - (oshd - hid), -fphhh / 2])
+ for (xo = [-fdbh / 2, fdbh / 2], yo = [0, 0 - fdbh])
+ {
+ //translate([-dbhw / 2, -so, 0])
+ translate([xo, yo, 0])
+ cylinder($fn = dToFn(oshd), d = oshd, h = fphhh, center = true);
+ }
+ }
+ }
+}
+
+// with screw holes and fan holes
+// TODO: production: create a new one with normal holes and w/o fan holes
+module radxa_zero_3e_mount_plate_holes()
+{
+ // fan hole diameter, put under CPU
+ fan_hole_d = ld3007ms_w - 2;
+ fhd = fan_hole_d;
+ fan_hole_h = 10;
+ fhh = fan_hole_h;
+
+ // screw holder height
+ shh = radxa_zero_3e_mount_plate_screw_holder_height;
+
+ // TODO: deduplicate, move to a global var
+ bottom_plate_h = 2;
+ bph = bottom_plate_h;
+
+ dbhw = radxa_zero_3e_pcb_distance_between_holes_w;
+ dbhh = radxa_zero_3e_pcb_distance_between_holes_h;
+ so = radxa_zero_3e_pcb_screw_offset;
+ hid = hole_insert_diameter;
+
+ // fan holes
+ translate([0, -radxa_zero_3e_fan_hole_offset, 0])
+ hull()
+ {
+ // top
+ translate([0, 0, -shh + $tiny_padding])
+ cylinder($fn = dToFn(fhd), d = fhd - 2, h = 0.001, center = true);
+
+ // bottom
+ translate([0, 0, -shh - bph + $tiny_padding])
+ //cylinder($fn = dToFn(fhd), d = fhd, h = fhh, center = true);
+ cylinder($fn = dToFn(fhd), d = fhd, h = 0.001, center = true);
+
+ // prolongate to cut scanner main frame
+ translate([0, 0, -20])
+ //cylinder($fn = dToFn(fhd), d = fhd, h = fhh, center = true);
+ cylinder($fn = dToFn(fhd), d = fhd, h = 0.001, center = true);
+ }
+
+ // fan screw holders holes
+ translate([0, 0, -bph - shh - $tiny_padding])
+ radxa_zero_3e_mount_plate_outer_holes();
+
+ // radxa hot inserts holes
+ translate([0, 0, -shh / 2])
+ for (xo = [-dbhw / 2, dbhw / 2], yo = [-so, -so - dbhh])
+ {
+ //translate([-dbhw / 2, -so, 0])
+ translate([xo, yo, $tiny_padding])
+ cylinder($fn = dToFn(hid), d = hid, h = shh, center = true);
+ }
+}
+
+module radxa_zero_3e_mount_plate_with_holes()
+{
+ shh = radxa_zero_3e_mount_plate_screw_holder_height;
+ bph = radxa_zero_3e_mount_plate_h;
+
+ //color("green", 0.1)
+ difference()
+ {
+ radxa_zero_3e_mount_plate();
+ radxa_zero_3e_mount_plate_holes();
+ }
+
+ translate([0, -radxa_zero_3e_fan_hole_offset, -shh - bph])
+ rotate([-90, 0, 0])
+ *%ld3007ms();
+}
+
+// these holes should be positioned by a module which knows
+// radxa position in body, so putting them at z==0 for now
+module radxa_zero_3e_mount_plate_outer_holes()
+{
+ shh = radxa_zero_3e_mount_plate_screw_holder_height;
+ bph = radxa_zero_3e_mount_plate_h;
+
+ translate([0, -radxa_zero_3e_fan_hole_offset, 0])
+ rotate([90, 0, 0])
+ ld3007ms_holes();
+}
+
//radxa_zero_3e();
//rpi_zero_protoboard();
//radxa_zero_3e_with_protoboard();
//%radxa_zero_3e_rj45_male();
-//radxa_zero_3e_with_protoboard_and_connectors(); \ No newline at end of file
+*%radxa_zero_3e_with_protoboard_and_connectors();
+
+*translate([0, 0, -6 - $tiny_padding])
+*radxa_zero_3e_mount_plate_outer_holes();
+
+*radxa_zero_3e_mount_plate();
+*radxa_zero_3e_mount_plate_with_holes();
+*radxa_zero_3e_mount_plate_outer_holes();
+//translate([0, fwo, 0])
+//translate([0, 0, 20])
+translate([0, 0, -10])
+//translate([0, 0, radxa_zero_3e_pcb_h - 5])
+//rotate([90, 0, 0])
+*%radxa_zero_3e_mount_plate_outer_holes();
+
+// debug, visualize 1 mm
+*union()
+{
+ translate([15 - 0.5, -28, -6])
+ cube([1, 1, 1], center = true);
+
+ translate([15 - 0.5, -28, -3])
+ cube([1, 1, 1], center = true);
+} \ No newline at end of file