VoronDesign / VoronUsers

Voron Community mods
https://mods.vorondesign.com
GNU General Public License v3.0
3k stars 1.86k forks source link

Consider linking with CadHub #340

Closed Irev-Dev closed 3 years ago

Irev-Dev commented 3 years ago

Just a quick suggestion since you've got both openscad files and STL files in this repo and I'm sure it's a pain updating the STLs each time there's a change to the SCAD code.

CadHub has a feature that allows you to link to an external url to fetch code.

To take @evandepol 's the DIN-Rail-Cable-Mount as an example, the following url: https://github.com/VoronDesign/VoronUsers/blob/master/printer_mods/evandepol/Voron2.4-Cable-clamps/CAD/DIN-Rail-Cable-Mount-350mm.scad

Is encoded into this CadHub url: https://cadhub.xyz/dev-ide/openScad#fetch_text_v1=https%3A%2F%2Fgithub.com%2FVoronDesign%2FVoronUsers%2Fblob%2Fmaster%2Fprinter_mods%2Fevandepol%2FVoron2.4-Cable-clamps%2FCAD%2FDIN-Rail-Cable-Mount-350mm.scad

image

So that it can be fetched on the fly, meaning that the link will automatically stay up-to-date with the repo, so the link could be added to a readme or even just in a comment at the top of the code.

I'm the main dev behind CadHub, so I'm trying to improve it as I go, but one big limitation to this approach atm is that it's single file only, i.e. the Combination Clamp won't work because it uses use <> statements. Multi-file projects is on the TODO list though.

Also unfortunately I haven't added proper UI for making these urls but the structure is just https://cadhub.xyz/dev-ide/openScad#fetch_text_v1=<you-url>, the included url doesn't have to be encoded but it makes it safer, an easy way to get the url is to go to the file you're interested in on github, open the dev tools and paste the following into the console: 'https://cadhub.xyz/dev-ide/openScad#fetch_text_v1=' + encodeURIComponent(location.href) And that should give you the url.

Anyway ignore me if this isn't useful. Feel free to let me know if you have any feedback about Cadhub too.

raymondh2 commented 3 years ago

The files included are not managed by the Voron Design team. We also require STLs be included in the repo itself not hosted externally.