Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CyanLight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fxk8y
CyanLight
Commits
4c2d7bc7
Commit
4c2d7bc7
authored
3 years ago
by
fxk8y
Browse files
Options
Downloads
Patches
Plain Diff
Integrating the ingenious concept of design parameterization from openscad-meistern.de
parent
662562bb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cad/CyanStripe/Case.scad
+9
-9
9 additions, 9 deletions
cad/CyanStripe/Case.scad
cad/CyanStripe/PCB.scad
+45
-31
45 additions, 31 deletions
cad/CyanStripe/PCB.scad
with
54 additions
and
40 deletions
cad/CyanStripe/Case.scad
+
9
−
9
View file @
4c2d7bc7
...
...
@@ -13,8 +13,8 @@ $E = 0.001; // ε
plexi = 3;
// c = case
c_sx = pcb_
w(
) + 0;
c_sy = pcb_
h(
) + 0;
c_sx =
PCB("
pcb_
sx"
) + 0;
c_sy =
PCB("
pcb_
sy"
) + 0;
c_sz = 20;
c_fs = 15; // frontSpace = pcb to upper plexi
...
...
@@ -22,15 +22,15 @@ c_fs = 15; // frontSpace = pcb to upper plexi
module frontPlexiOutline() {
/* pcbScrewHoles()
circle(d=M3
(
)*2); */
circle(d=
PCB("
M3
"
)*2); */
txy = sc_left_off
(
)+M3
(
);
txy =
PCB("
sc_left_off
"
)+
PCB("
M3
"
);
translate([-pcb_
w(
)/2, -pcb_
h(
)/2])
mixedRoundRect(txy, txy, [0, pcb_edge_r
(
), 0, M3
(
)]);
translate([-
PCB("
pcb_
sx"
)/2, -
PCB("
pcb_
sy"
)/2])
mixedRoundRect(txy, txy, [0,
PCB("
pcb_edge_r
"
), 0,
PCB("
M3
"
)]);
translate([-pcb_
w(
)/2, pcb_
h(
)/2 - txy])
mixedRoundRect(txy, txy, [pcb_edge_r
(
), 0, M3
(
), 0]);
translate([-
PCB("
pcb_
sx"
)/2,
PCB("
pcb_
sy"
)/2 - txy])
mixedRoundRect(txy, txy, [
PCB("
pcb_edge_r
"
), 0,
PCB("
M3
"
), 0]);
}
...
...
@@ -54,7 +54,7 @@ if ($preview) {
pcb3D();
translate([0, 0,
pcb_t()*3
])
translate([0, 0,
PCB("pcb_t")+aj_h()
])
frontPlexi();
} else if ($part == "CoverGlass") {
...
...
This diff is collapsed.
Click to expand it.
cad/CyanStripe/PCB.scad
+
45
−
31
View file @
4c2d7bc7
...
...
@@ -10,14 +10,40 @@ $E = 0.01; // ε
// note: using constant functions here because they get imported via `use`
function pcb_t() = 1.6;
// exporting *everything* as a constant function is bad.
// taking the ingenious concept from `Project 4` of the book from openscad-meistern.de
pcb_data = [
["pcb_t", 1.6],
["pcb_sx", 75.5],
["pcb_sy", 65.0],
["pcb_edge_r", 3.0],
["M3", 3.2],
// LED terminal data
["tled_x", 5.75 + 23],
["tled_y", [-18.5, 0, 18.5]],
// co = cut-out
["co_w", 6.1],
["co_h", 18.0],
["co_x", -34.7],
["co_y", -8.6],
["sc_left_off", 5.0], // left side screw holes offset from edge
];
function PCB(key) = [ for (d=pcb_data) if (d[0] == key) d[1] ][0];
function pcb_w() = 75.5;
function pcb_h() = 65.0;
function pcb_edge_r() = 3;
function M3() = 3.2;
// x is all the same and y is +- 18.5 and 0 as there are three of them
function terminals_x() = 28.75;
...
...
@@ -30,18 +56,6 @@ function tpow_y() = 14.50;
// function tpow_sy() = 11.50;
// function tpow_sz() = 3.00; // TODO: measure!!
tled_y = [18.5, 0, -18.5];
function tled_x() = 5.75 + 23;
function tled_y(i) = tled_y(i);
function sc_left_off() = 5.0; // left side screw holes offset from edge
// co = cut-out
co_w = 6.1;
co_h = 18.0;
co_x = -34.7;
co_y = -8.6;
module pcbScrewHoles(tz=0) {
...
...
@@ -53,17 +67,17 @@ module pcbScrewHoles(tz=0) {
module pcbOutline() {
difference() {
roundRect(
pcb_w(), pcb_h(),
pcb_edge_r
(
), center=true);
roundRect(
PCB("pcb_sx"), PCB("pcb_sy"), PCB("
pcb_edge_r
"
), center=true);
pcbScrewHoles() circle(d=M3
(
));
pcbScrewHoles() circle(d=
PCB("
M3
"
));
translate([
co_x,
co_y, 0]) square([co_w + $E, co_h], center=true);
translate([
PCB("co_x"), PCB("
co_y
")
, 0]) square([
PCB("
co_w
")
+ $E,
PCB("
co_h
")
], center=true);
}
}
module pcb3D(pcb_t=pcb_t
(
)) {
module pcb3D(pcb_t=
PCB("
pcb_t
"
)) {
FR4()
linear_extrude(pcb_t
(
))
linear_extrude(
PCB("
pcb_t
"
))
pcbOutline();
if ($preview) {
...
...
@@ -71,27 +85,27 @@ module pcb3D(pcb_t=pcb_t()) {
pcbScrewHoles()
Solder()
difference() {
translate([0, 0, -$E]) cylinder(d=M3
(
)*2, h=pcb_t
(
)+2*$E);
translate([0, 0, -$E*2]) cylinder(d=M3
(
)-$E, h=pcb_t
(
)+4*$E);
translate([0, 0, -$E]) cylinder(d=
PCB("
M3
"
)*2, h=
PCB("
pcb_t
"
)+2*$E);
translate([0, 0, -$E*2]) cylinder(d=
PCB("
M3
"
)-$E, h=
PCB("
pcb_t
"
)+4*$E);
}
// Solder()
// translate([tpow_x(), tpow_y(), pcb_t
(
) - $E])
// translate([tpow_x(), tpow_y(),
PCB("
pcb_t
"
) - $E])
// cube([tpow_sx(), tpow_sy(), tpow_sz()], center=true);
// translate([tpow_x(), tpow_y(), pcb_t
(
) - $E])
// translate([tpow_x(), tpow_y(),
PCB("
pcb_t
"
) - $E])
// terminal2();
translate([tpow_x(), tpow_y(), pcb_t
(
)])
translate([tpow_x(), tpow_y(),
PCB("
pcb_t
"
)])
terminal2();
for (ty=tled_y)
translate([tled_x
(
), ty, pcb_t
(
)])
for (ty=
PCB("
tled_y
")
)
translate([
PCB("
tled_x
"
), ty,
PCB("
pcb_t
"
)])
rotate([0, 0, 180])
terminal3();
for (ty=[-aj_y(), aj_y()-aj_sy()])
translate([aj_x(), ty, pcb_t
(
)])
translate([aj_x(), ty,
PCB("
pcb_t
"
)])
audioJack();
}
...
...
@@ -154,7 +168,7 @@ module terminal3() {
// aj = audio jack
function aj_x() = -12.25;
function aj_y() = pcb_
h(
)/2;
function aj_y() =
PCB("
pcb_
sy"
)/2;
function aj_h() = 5.0;
function aj_sx() = 12.4;
function aj_sy() = 11.7;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment