celownuik2 - przejścier na bibliotekę BOSL2, ulepszenia

This commit is contained in:
sasza 2025-08-23 22:37:02 +02:00
parent 502bc58ec4
commit 1515c884ce

View file

@ -1,5 +1,8 @@
use <picatinny-rail.scad> use <picatinny-rail.scad>
use <Chamfer.scad> use <Chamfer.scad>
include <BOSL2/std.scad>
include <BOSL2/screws.scad>
// To jest model celownika do karabinu CZ Varmint // To jest model celownika do karabinu CZ Varmint
// Koncepcyjnie składa się z 3 części - na górze jest szyna // Koncepcyjnie składa się z 3 części - na górze jest szyna
@ -7,29 +10,27 @@ use <Chamfer.scad>
// wystaje pałąk do przykręcenia (post) // wystaje pałąk do przykręcenia (post)
// parameters // parameters
length = 3; // ustaw poniżej 5 do testów wymiarów length = 26; // ustaw poniżej 5 do testów wymiarów
c_s = length>5 ? 1 : 0.4; // chamfer_size używane tylko do testów
rail_height = 15;
clamp_inner = 22; clamp_inner = 22.15;
clamp_inner_acurracy = 50; clamp_inner_acurracy = 50;
clamp_thickness = 4; clamp_thickness = 4;
c_s = length>5 ? 1 : 0.4; // chamfer_size używane tylko do testów
rail_height = -9.4 + clamp_inner/2 + 6.8; // -9.4 is to center the picatinny
post_thickness=15; post_thickness=15;
post_length=20; post_length=15;
post_slit=2; post_slit=2;
post_chamfer = 1.665;
m3 = [6,3,5.7]; // M3 nut_wall_t = 0.4;
m2 = [4.3,2,3.3]; // M2
m2_5 = [5.5, 2.5, 4.68]; // M2.5
screw = m2; screw = "M2";
info = screw_info(name=screw, head="socket");
hh = struct_val(info, "head_height");
screw_head_h = post_thickness - hh - nut_wall_t;
hex_size=screw[0]; // rozmiar nakrętki od rogu do rogu
screw_thread=screw[1]; // rozmiar gwintu
screw_head=screw[2]; // rozmiar główki śruby
sink_depth = 3; // jak głęboko w pałąk powinny się wtopić główka oraz nakrętka
difference() { difference() {
// celownik // celownik
@ -40,7 +41,7 @@ difference() {
// na górze picatinny // na górze picatinny
if (length > 5) { if (length > 5) {
rotate([90,0,-90]) translate([0,0,rail_height]) rotate([90,0,-90]) translate([0,0,rail_height])
picatinny_rail(l=length, d=rail_height, c=1.5, n=1, a=10); picatinny_rail(l=length, d=rail_height, c=1.5, n=1, a=length/2);
} }
// na dole wystający trzpień do przykręcenia // na dole wystający trzpień do przykręcenia
translate([clamp_inner/2, post_thickness*-0.5, 0]) translate([clamp_inner/2, post_thickness*-0.5, 0])
@ -62,19 +63,16 @@ difference() {
for (i = [length*1/4, length*3/4]) { for (i = [length*1/4, length*3/4]) {
translate([(clamp_inner + post_length)/2,0,i]) translate([(clamp_inner + post_length)/2,0,i])
rotate([90,90,0]) rotate([90,90,0])
union() { screw_hole(spec=screw, length=screw_head_h, head="socket", thread=0, $fn=100);
// Miejsce na nakrętkę translate([(clamp_inner + post_length)/2,post_thickness/2 - nut_wall_t,i])
translate([0,0,post_thickness/2-sink_depth]) rotate([90,90,0])
cylinder(r=hex_size, h=sink_depth+0.1, $fn=6); nut_trap_inline(spec=screw, h=hh);
// dziura na wylot na gwint
translate([0,0,(-post_thickness-0.5)/2])
cylinder(r=screw_thread, h=post_thickness+0.5, $fn=20);
// miejsce na główkę śruby
translate([0,0,(-post_thickness/2)-0.1])
chamferCylinder(r=screw_head, h=sink_depth+0.1, ch=-0.5, ch2=0);
}
} }
} }
// chamfer for slit
translate([clamp_inner/2 - post_slit/4,0,length/2-0.5]) rotate([0,0,45])
cube([post_slit*post_chamfer,post_slit*post_chamfer,length+2], center=true);
// debug - wyświetl rozmiar // debug - wyświetl rozmiar
if(length < 5) { if(length < 5) {