From c83b8ae89cfe153f3e379ab32e8eccb73681936e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Thu, 29 Feb 2024 15:56:03 +0100 Subject: [PATCH] feat: design improvements --- .gitignore | 1 + README.md | 131 +++------------- assets/generated/AntiStudInsert.png | Bin 588 -> 0 bytes assets/generated/C15.png | Bin 731 -> 0 bytes assets/generated/C7.png | Bin 849 -> 0 bytes assets/generated/Classic Full Curve.png | Bin 472 -> 0 bytes assets/generated/Classic Full Straight.png | Bin 384 -> 0 bytes assets/generated/Classic Half Curve.png | Bin 658 -> 0 bytes assets/generated/Classic Half Straight.png | Bin 493 -> 0 bytes assets/generated/Classic Quarter Straight.png | Bin 644 -> 0 bytes assets/generated/S10.png | Bin 569 -> 0 bytes assets/generated/S25.png | Bin 399 -> 0 bytes assets/generated/S4.png | Bin 700 -> 0 bytes assets/generated/S5.png | Bin 712 -> 0 bytes assets/generated/StudInsert.png | Bin 627 -> 0 bytes assets/generated/Switch R25.png | 0 flake.lock | 61 ++++++++ flake.nix | 23 +++ track.json | 145 +++++++++--------- track.scad | 24 +-- 20 files changed, 197 insertions(+), 188 deletions(-) create mode 100644 assets/generated/Switch R25.png create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 68a6176..a308f1f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.stl /build/ +/.direnv/ diff --git a/README.md b/README.md index 80c0bf3..5ce6766 100644 --- a/README.md +++ b/README.md @@ -1,121 +1,38 @@ -# Brick Monorail +# create-svelte -Parametric Lego-compatible monorail tracks, designed specifically for 3d printing. -Two orders of magnitude cheaper than buying used. +Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte). -Since the parts are made parametric, you can have any length or curve radius you want, -but these are the original tracks you can replicate +## Creating a project -As an overview, or why it's worth a try: They print rapidly on modern printers, and cost barely anything. +If you're seeing this, you've probably already done this step. Congrats! -| Preset | Cost | Time | Image | -| ----------------------------- | ----- | ---- | -------------------------------------------------------------------------------- | -| C15 | ~10ct | 45m | ![C15](./assets/generated/C15.png) | -| C7 | ~5ct | 15m | ![C7](./assets/generated/C7.png) | -| S25 | ~12ct | 1h | ![S25](./assets/generated/S25.png) | -| S10 | ~5ct | 15m | ![S10](./assets/generated/S10.png) | -| S5 | ~5ct | 15m | ![S5](./assets/generated/S5.png) | -| S4 | ~5ct | 15m | ![S4](./assets/generated/S4.png) | -| Classic Full Curve (R28 90°) | ~25ct | 2h | ![Classic Full Curve](./assets/generated/Classic%20Full%20Curve.png) | -| Classic Half Curve (R28 45°) | ~12ct | 1h | ![Classic Half Curve](./assets/generated/Classic%20Half%20Curve.png) | -| Classic Full Straight (L32) | ~20ct | 1.5h | ![Classic Full Straight](./assets/generated/Classic%20Full%20Straight.png) | -| Classic Half Straight (L16) | ~10ct | 45m | ![Classic Half Straight](./assets/generated/Classic%20Half%20Straight.png) | -| Classic Quarter Straight (L8) | ~5ct | 15m | ![Classic Quarter Straight](./assets/generated/Classic%20Quarter%20Straight.png) | +```bash +# create a new project in the current directory +npm create svelte@latest -You can also generate your own custom rails with any length, radius or angle. +# create a new project in my-app +npm create svelte@latest my-app +``` -Todo: ramps, switches, train assembly +## Developing -## Design differences +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: -Injection molding has vastly different requirements to 3d printing. -Due to this the original rails print absolutely horribly due to the copious amounts of supports needed. -Surfaces printed on supports just never look good. +```bash +npm run dev -Because of that, I decided to instead of having a support part on the bottom, I'd carve out space for -a 1x2 plate, which you can fit there for the same effect. +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` -The monorail tracks are also solid now, which is not something you can do in injection molding but leaves -a really nice surface finish at the bottom of the rail for us. +## Building -For now, I also use non-baseplate aligned joints for curves. While this means you can't just snap the rails -on a baseplate, it enables you to use straight rails at non-90 degree angles which I think is an absolute -win over the original design since the 45 degree curves are useless outside of joining them with switches. +To create a production version of your app: -_These are 3d printing optimized, compatible rails, not replicas. Replicas print horribly due to support._ +```bash +npm run build +``` -### Optional Differences +You can preview the production build with `npm run preview`. -#### Operating on r25 instead of r28 - -What difference do these three studs make? -With this radius we can take advantage of the pythagorean triples `3/4/5` and `7/24/25` to stay on the stud -grid with turntables. - -- Curve C15 -- Curve C7 -- Straight S21 -- Straight S7 -- Straight S6 -- Incline I4 - -How it fits - -- Two C15 and one C7 make exactly a 90 degree turn, where every part stays on the stud grid. -- An s-curve with C15 moves over 20 studs, diagonals can be done with any length divisible by 5 -- An s-curve with C7 moves two studs, but diagonals require a full S25 to land cleanly again. - -![](./assets/r25.svg) - -## Printing - -To be compatible with standard bricks, the following print settings are strongly advised - -- Nozzle: **0.4**, this is equivalent to 1 LDU. -- Layer height: **0.2**, less than that is barely better and just causes more problems than it solves. - If you want to go lower, it's advisable to use heights that satisfy `0.4 % h == 0` such as 0.1. - - **Make sure your initial layer height is either 0.2 or 0.4!** -- Supports: **yes**, normal, don't use tree supports. -- Set your "Initial Layer Horizontal Expansion" to a value that works for you, for example -0.2mm to compensate for elephant's foot. - Alternatively, you can trim the extra plastic off by hand. - -My prints were done on a modified SecKit SK-Go2 running Klipper, with 10k acceleration and 150mm/s print speed for a good -balance of speed and quality. A short rail will take about an hour to print. - -### Inserts - -_This is optional and increases difficulty and print time, but I highly recommened it._ - -Studs and anti-studs print rather inconsistently at the orientation of the rail. -To combat that, I added the option to pre-print stud and anti-stud inserts at perfect orientation and insert them mid-print. -Because the layer is immediately covered up, the plastic will adhere like it would if it was printed in one go. - -This also allows you to pre-select the best inserts without having to print a full rail only to have one bad stud. - -- In Cura, insert a "Pause at layer" at the last layer where the insert spots are not covered yet. -- If you use Klipper, use "Search and replace" with `; Layer 32` to `; Layer 32\nPAUSE`. - -### Filament - -| Color | RAL | PLA Supplier | ABS Supplier | -| ----------------- | ---------- | ------------ | ------------ | -| Light Bluish Gray | `RAL 7040` | dasfilament | | -| Light Gray | `RAL 7005` | | | - -- None of these colors will be an exact match, just the texture of 3d printing it can make a huge difference, but usually fall close enough in the range. -- The original rails will be in _Light Gray_, not _Light Bluish Gray_, but since I barely own any pre- 2004 color change bricks I chose to match my other bricks instead. - -_Notes for newcomers:_ - -- Most bricks are injection molded from ABS, however I find PLA to be much more easy and safe to handle. -- PLA starts to deform at 60°C, so don't leave it in the sun or in your car. -- PLA is brittle. While ABS deforms with force applied to it, PLA will just snap. -- ABS is harder to print, an enclosure is a must, and warping can be difficult to handle. - -#### Printing Safety - -In case you are new to 3D printing: - -- Most filaments (including PLA) can release toxic gases when _burned_ -- FDM printing can cause fine particle emission -- ABS when heated to normal printing temperatures can release styrene fumes +> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. diff --git a/assets/generated/AntiStudInsert.png b/assets/generated/AntiStudInsert.png index 929334f3272c278a52012f92003a5cf1758feb53..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)L!B2d);;Xt1cYw%YZ zP|Bynh%&u=Qw@-hnB3v4K$K?Zw05@pT@IWXh|=s|&A#Z{ z_``8SvNzHYrrwyL`#rU#!X>u5KVE-#=y3-+=Rjol%=rEo!b6b*?j9WA{!~Ns+L=3t zaEXzIWp!f_{@-3avi;?`VGTB$cY)$jlfZX}L_G#rq@ z&?(i^swj;N;L5@|nx|<}fNa_r4J$Hs4(C9LQE)UGo|mFyuWRHP);4_iz#IS&5X-_* zbF9l0C<%gaXd7Q+^kmWEZ}Xbk7L^1X&o5tchOz_si~=;TJ4ji$FrVZPWE%yoN{!zd zR1a)0nnHj)M}Y+kq~zCLg||C2XoVWmG-gAc!~1f`j4>FJ$(M{7qI#5Phst#3WyqM! zaMX~#)i6WG6r?S?AsHVsIaawDlA-=HYs=G+F^o)(6-$9{YD{R=3O5v*TGap%C;~;G avhxFE`9|$Bzd29<0000cY~`||0$-xXgv?;{2TJfE2tp8vMU#4n)@-rigIUW_TcDXsO;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qZx(tE-5#7DbL1D1!+v25RHaIK@u zw6e19n|ngJzi~88J(A?nET3sqdKoZXx7i^m%h?Fyx-~(v%TC)vEWwVQ`}j49=88n< z>SyDQoO_3K2?r$5fUE@$ArQzwPrin>18}00000NkvXXu0mjf^BRl< diff --git a/assets/generated/Classic Full Curve.png b/assets/generated/Classic Full Curve.png index dd06f843f7aa50ae04ec89a997018e29a90d094c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 472 zcmV;}0Vn>6P)Nklwi;!|ESu_Aa2tp8o zL<10nAOs;uG$6fb>5ouvJBwSWG#+LSCB`BpB96~KWtp@!|IdH9W9gYvGB;L}i7Nn< ziU^*3bhTHc{h_rttWe3MNDBOTL%(}PGC@NLpHnJ1Cu>s|_WR@=Pp|-xMj5e3R-Fyn zyl3=YRasnRYJ#1H?($E_KHkJ-^_G?+e^}G}0m`~Lz!Z-s1^&Pd(V=K=%Gz#h*kb1W zlp&Hs%zK~Uy)62!bfsiTNDF3R{bhQnnm4dZTq~CbP|_3P z8VJK-O@0E)+fks{+!uyXekH^;GoDActqz)vy_nS*GMMs{5ZCwv?|t2sa3pk?ql2^O zLNtWmWq^Q#GWwR7IQR!gfyD5P}edAkl>&1R)4PqU#HYaiH(6_;MTo O0000z9*I63N z?{~>aa}`xWQX@aN#ldu8AVf~2QO9RObxnV`(qE1Ysx&`;vr6;%JMjZjHQoOQ3k@a+ zMS})XdsAwxhw8Priw6hfUSv!VR&}azIvDF3FgXK}6Dl?GwgRQdMrR;qLiOX=eY5Nn zQZ*<=Mk_T|k)1$ii;Os-y9O~HFe)`&k!=!cMxzT-HSQ-3W`|^TKHl!>;sKowHMUvh zL^^+x_d}M(>Xs2{E`z>X@5yF)@*|xFj9&X*`?+{|`g-ipX~3w|^TnQ81J<`a-GsgY e3}O(2nw}#g0KFU}&!PkX0000v(?2=1^Z^#C}e{D+@II{`;LrGc6a_|C!TA za2RtK+Px2lbDY_6LJTF`u7%I6W5xuVQ;-Mzb@je;`lt>-CS_poTg8qQ(CFyNoIbY7 z9MIUR84HohF7h$yd7-sN|sX;CIGoLXc48&M`9l?Bsa{uEM6E*V3SW9d-cTDm9NJq0Iku^+MUM$)Nf%Mco?X?Ve#Ldx!>ZVT-yIlTMi&RAh6r0h1elF*kw<+y(> s%kkHqcS&9Y1W14cNPxTs2$0kI1#e~tFEW#QfB*mh07*qoM6N<$g2J>e{r~^~ diff --git a/assets/generated/Classic Half Straight.png b/assets/generated/Classic Half Straight.png index 2886ea8d732faa84c226c64abb05802040303a8c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmVa&hzyo<859EQe2Jk?+0Q&5# zu|K@Xg+qX{clcn$MEu$(cb{LqZ>~(@e>I{~yBQ7DA?yT4!_iajTJH&YdG+ZHr^l9vY zq_a*MmJtnQ+dGzy6Oeu(o7!Uo#1%3uI2w=z4O8e?$WX;3VHrC#=+UMM%M3`rtz2ky zfuuC-Zo<+r02-9k_Ig=5lpUo2IzFi4&!nxyiR>O0Nd1XECkrRO<^TgeV|&mvMqYP~NKTra%)|y!N2t^<5e?_CU0CgJm39 j+A3rX;DJ2QzX$pT!<*zkm7ms700000NkvXXu0mjfWck|2 diff --git a/assets/generated/Classic Quarter Straight.png b/assets/generated/Classic Quarter Straight.png index fddce6d0e09b12554efe81f0222b5dccf8dbfc2b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 644 zcmV-~0(v=qcauoS@|iy;0$ z6qgR2g@PSKqC@GRRv{|Jw+-I+$dC8lBo|uv<{8TMlFNPayw7{dIgZ7)N!q3XGN247 z1ImCl4X~SmeorsPSf%V+CT_o{^4#;6{+v`CG6!e)xOL}qq_z1ps&nQ10g;AZrC6n) zWMNrxY5I4MdFG!y``YY`)jNb|7HH1Z_FcVn&@(?=mUT8k7Ut9IAU{ppEPPwcE|-{M zASn&lb?7AU+ezZ`B(RkV_&>mOPM$^>NK#&m{ zFiE%d@CS&~@SP}qPN%^f!arDV#y_Mq zQHzB+gwx=GM<*sQ`oN{^NsNCJef_4fs8I zLie9cuJm`43k?H)o1F>#9d&E*9LhP4<(Y!L@4x(W>g-X#dNF$Izv>P|GKh{{U(MgB z_E<6n01+jULA_j);+091mT*1$-{(qb)Bw3sLZb`_>{0b%@qs$`b|6&Q!;*wLB`M2L e29yD9i~a%YZwrkE4=&*V0000Hk diff --git a/assets/generated/S10.png b/assets/generated/S10.png index a8531e52493f50276eb5eb1788f78d36b603c019..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=G`P)|Xj?De3X3}iX&^x~@^K7y3iJfg2v<9cLd$SB zKNq=&My6j1hHx50fV>+8AfX$$2I--Z)FTBXLxWEpc^Wa0jvLixNdZ-By`V?*eR!u- z^@xE=n`sO;m?lKCA~{@jnk5Fpj|kx&7(x#Qgwyyoi=S}eXdrPV8f000&+%GsVk{mG z1p|V*cZ2cS#50}L{7*+{^z{S+(HviY64Dbct9n1v>~@x?Ui4{5(BXQxlLJFA_@DlJ zw0+KQ62FZAfZ$rpR)~pUr~SrO;pCv zvi@+XuD_q>(Haa$$MbM|lKwP_U6#I&i$^4u8dYRWLck&eK$b=qIelVQrZwudvWlD- zPfS9V22$jtgtjdUq6tojt~xQG77Z#M;lDCdV+~N_n~+&#QjHhL%*K7KfRvb0yG6#v z69%FyvN?zCf9ri&pB##8yg)C1^7QQZvYKkme|2#r#uSuh0>0GW@7L;DJl?!s{m_8| tI#hmbf+5w2xYM3=WNrY17{s7`&l;>y*ESled2|2(002ovPDHLkV1lSZtgrw8 diff --git a/assets/generated/S4.png b/assets/generated/S4.png index 8b80ed43df79bc35cb0cbb4141bc6d48d30ecd01..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 700 zcmV;t0z>_YP)D? z&1CV?jW1R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Qkp zeKNp0d1vV2fo~*GTt~KECYs^^8Hi$))9c6T?^drGG`5FGFIQuk(R2~WSX}`!wx?S_ u#x#)u<#Bc!wu!PZ8^T7-aII-7u?2$q5<2sUDqPAr0zMG!%>5=Fe? z%KHNXSLAm>j!UxH8yFad+1c4QJF}Z`kpj zVT)(2j_!pwbM^09hgi56r5uT|PzE&cuuN+R$h31sZ3^`7@B|q7^~W?LhkpKka@+lJsIQk#pcn2VpKr$MUTwRa?vYY_M-Y6ZjTCx?|EU8lO2AT^KT{Sb3sT! zlf!Ny?+T9u0;vQVxIJ>9_b+eJ1#oaOEmuK!Q;WulO4)}`1G;$fxZ3H0Y-jU4akApO zjFR<-Yjw=q=T~oBzhIs$DmMsv;a!%su!v{Ej!?+D7mpyU`vS|R6wV}Bkq%LN$jA6^ zN9jrp+e#J{igiM2gCLeHLmD|y>(&1#GBuoGvZyp_NbrpPYb#k)@-B0fjmE?qX3|+8 zAT2Uh+F1ZW$S9CGjUJGKi~w1oaS~jN4%dc|Z0ahBL#YaF8(`;w&H$h7A(4W{z^4EJ N002ovPDHLkV1m?KA`bun diff --git a/assets/generated/Switch R25.png b/assets/generated/Switch R25.png new file mode 100644 index 0000000..e69de29 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7ca5124 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1709101946, + "narHash": "sha256-TsySgcWm/GlbYdL3AEva49ceeI2BdPQ7muwfYNr1fwo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d53c2037394da6fe98decca417fc8fda64bf2443", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..db43371 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + packages = + (with pkgs; [ + nodejs_18 + nodePackages.pnpm + ]); + in { + devShell = pkgs.mkShell { + buildInputs = packages; + }; + }); +} diff --git a/track.json b/track.json index 931758c..61048ca 100644 --- a/track.json +++ b/track.json @@ -1,74 +1,77 @@ { - "fileFormatVersion": "1", - "parameterSets": { - "C15": { - "Angle": "1", - "Length": "15", - "Radius": "25" - }, - "C7": { - "Angle": "1", - "Length": "7", - "Radius": "25" - }, - "S25": { - "Angle": "0", - "Length": "25", - "Radius": "25" - }, - "S10": { - "Angle": "0", - "Length": "10", - "Radius": "25" - }, - "S5": { - "Angle": "0", - "Length": "5", - "Radius": "25" - }, - "S4": { - "Angle": "0", - "Length": "4", - "Radius": "25" - }, - "Classic Full Straight": { - "Angle": "0", - "Length": "32", - "Radius": "28" - }, - "Classic Half Straight": { - "Angle": "0", - "Length": "16", - "Radius": "28" - }, - "Classic Quarter Straight": { - "Angle": "0", - "Length": "8", - "Radius": "28" - }, - "Classic Full Curve": { - "Angle": "90", - "Length": "8", - "Radius": "28" - }, - "Classic Half Curve": { - "Angle": "45", - "Length": "8", - "Radius": "28" - }, - "StudInsert": { - "Type": "studs" - }, - "AntiStudInsert": { - "Type": "antistuds" - }, - "New set 1": { - "Angle": "15", - "AntiStudInserts": "false", - "Length": "20", - "Radius": "25", - "StudInserts": "false", - "Type": "switch" - } + "fileFormatVersion": "1", + "parameterSets": { + "C15": { + "Angle": "15", + "Radius": "25", + "AngleIsLength": true + }, + "C7": { + "Angle": "7", + "Radius": "25", + "AngleIsLength": true + }, + "S25": { + "Angle": "0", + "Length": "25", + "Radius": "25" + }, + "S10": { + "Angle": "0", + "Length": "10", + "Radius": "25" + }, + "S5": { + "Angle": "0", + "Length": "5", + "Radius": "25" + }, + "S4": { + "Angle": "0", + "Length": "4", + "Radius": "25" + }, + "Classic Full Straight": { + "Angle": "0", + "Length": "32", + "Radius": "28" + }, + "Classic Half Straight": { + "Angle": "0", + "Length": "16", + "Radius": "28" + }, + "Classic Quarter Straight": { + "Angle": "0", + "Length": "8", + "Radius": "28" + }, + "Classic Full Curve": { + "Angle": "90", + "Length": "8", + "Radius": "28" + }, + "Classic Half Curve": { + "Angle": "45", + "Length": "8", + "Radius": "28" + }, + "StudInsert": { + "Type": "studs" + }, + "AntiStudInsert": { + "Type": "antistuds" + }, + "Switch R25": { + "Angle": "15", + "AngleIsLength": "true", + "AntiStudInserts": "false", + "Length": "20", + "Radius": "25", + "StudInserts": "false", + "SwitchFrontLength": "4", + "SwitchSupportCount": "3", + "Type": "switch" } + } } diff --git a/track.scad b/track.scad index 1c46f93..9263295 100644 --- a/track.scad +++ b/track.scad @@ -1,19 +1,19 @@ include ; -include ; /* [Print Settings] */ +Tolerance = 0.2; // Mid-print stud inserts allowing the studs to be printed facing up seperately StudInserts = true; // Mid-print slot inserts eliminating the need for supports AntiStudInserts = true; // Part to generate -Type = "switch"; // [rail,switch,studs,antistuds] +Type = "rail"; // [rail,switch,studs,antistuds] /* [Model Settings] */ -Length = 8; // [4:1:56] +Length = 20; // [4:1:56] Radius = 25; // [4:1:36] // The angle the track takes -Angle = 0.0; +Angle = 15; // Useful when working with Pythagorean Triples AngleIsLength = true; SwitchSupportCount = 3; @@ -45,6 +45,7 @@ $teethRailWidth = 10 * $LDU; $teethWidth = $tile / $teeth; $teethDepth = 3 * $LDU; + module tooth() { $height = $teethWidth - $teethTolerance; $rail = $teethRailWidth / 2; @@ -284,7 +285,7 @@ module monorailSwitch() { translate([0, $tile * SwitchFrontLength, $tile / 2]) cube([$tile * 20, $teethTolerance, $plate], anchor=BOTTOM); translate([0, $tile * (SwitchFrontLength + midLength), $tile / 2]) cube([$tile * 20, $teethTolerance, $plate], anchor=BOTTOM); difference() { - translate([0, $tile * SwitchFrontLength, $tile / 2]) cube([$tile * 20, midLength * $tile, $LDU], anchor=BOTTOM+FRONT); + translate([0, $tile * SwitchFrontLength, $tile / 2]) cube([$tile * 20, midLength * $tile, Tolerance], anchor=BOTTOM+FRONT); for (i = [0:SwitchSupportCount - 1]) { y = SwitchFrontLength + 1 + ((midLength - 2) / (SwitchSupportCount - 1) * i); @@ -307,13 +308,13 @@ module monorailSwitch() { wl = 2 * $tile + travelDistance + $teethRailWidth; wr = (1 - cos(asin((y - SwitchFrontLength) / Radius))) * Radius * $tile + travelDistance + 2 * $tile + $teethRailWidth; translate([-wl, $tile * y, 0]) group() { - cube([wl + wr, strength + $LDU * 2, $tile], anchor=LEFT); - rotate([45, 0, 0]) cube([wl + wr, strength * 2 + $LDU * 2, strength * 2 + $LDU * 2], anchor=LEFT); + cube([wl + wr, strength + Tolerance * 2, $tile], anchor=LEFT); + rotate([45, 0, 0]) cube([wl + wr, strength * 2 + Tolerance * 2, strength * 2 + Tolerance * 2], anchor=LEFT); }; } - translate([0, $tile * (SwitchFrontLength + midLength / 2), -$tile / 2]) - cyl(d=$tile * (4 + travelDistance / 2) + $LDU * 2, h=$tile / 2, chamfer=$LDU * 4, $fn=64, anchor=BOTTOM); + //translate([0, $tile * (SwitchFrontLength + midLength / 2), -$tile / 2]) + // cyl(d=$tile * (4 + travelDistance / 2) + $LDU * 2, h=$tile / 2, chamfer=$LDU * 4, $fn=64, anchor=BOTTOM); } if (SwitchFrontLength > 2) { @@ -351,7 +352,10 @@ if (Type == "rail") { rotate([180, 0, 180]) antiStudInsert(); } else if (Type == "switch") { //guiderailChainLink(); - monorailSwitch(); + intersection() { + monorailSwitch(); + translate([0, 55, 0]) cube([100, 60, 100], FRONT); + } }