Calling all programmers! For the past month (or longer) I’ve been trying to get a STL Viewer Widget working for Chilipeppr. I haven’t gotten very far - as Edison would say, I’ve found 529 ways not to make it work. Parsing an STL isn’t actually that hard, there are multiple libraries out there and the logic is fairly straightforward. I can explain what needs to happen in an extreme level of detail, I’ve already done a lot of the research, and I just need someone else to put fingers to keyboard and make the code [that works] happen.
Why, may you ask? Because there’s no 3D Printing workspace that lets you set up all your objects in the browser yet [that I know of]. Octoprint, Astroprint, and 3DPrinterOS all let you upload a single STL file and shoot it off to their respective servers for slicing without letting you interact with it in any way. Now there’s no Javascript based slicer out there yet, so we still need to make an API call to generate the actual gCode, but it would be so much nicer to actually be able to render and interact with the object you want to print, lay out a build plate with multiple objects, resize, mirror, rotate, and drag them around as necessary, all in your browser client-side before making a single AJAX call to a server to do the slicing (gcode generation) in the cloud. We get the gCode back from the cloud and we can preview it and send it to a printer.
Ultimately this ties in to John, Frank, and my own grand vision of integrating electronics inside printed plastic objects, which would probably spark the 2nd IOT revolution. Wouldn’t it be awesome to be a part of that?
Contact me/ comment here for more details, with questions, or anything else!
I had considered extending Chilipeppr with a project of mine after putting it online, but I am sadly not happy with the STL handling yet. It is the bucket_mill project. The point being to take in an STL file and do however many passes for cutting the layers and split the thing up onto as many boards as necessary. Maybe one of these days, I will have it set up.
@NathanielStenzel Thanks. The ThreeJS STL loader was the first thing I tried - it works for the included models and some others but I’ve only had a 40% success rate with it - there are lot’s of STL’s that it won’t work on. I’ve tried to move over to the code that http://viewstl.com uses and also jsstl (https://github.com/tonylukasavage/jsstl) but have run into hiccups with both just due to basic things that I haven’t been able to overcome.
@raykholo Sorry to hear that threejs was no good for you. At least now the people that might be interested in helping will know what you already tried. I have to wonder if you are having trouble because of a bad STL file though. Many STL readers will expect the STL to have the dots in clockwise order for each triangle. I wonder if it could be just the output of some STL generating programs that is giving you an issue. Try loading in Cura and resaving and see if that makes a difference? If it does, it might help you find out what is going on.
@NathanielStenzel Repetier Host will render anything you throw at it, and http://viewstl.com was able to render all the STL models I was trying on their site. All the models I’m using are off thingiverse and have been printed successfully by many people.
Regardless, the Three loader was only shown as loading saved files on the server while the goal is to work with files dragged into the widget. Not sure if/ how to make that work, which is when I started moving over to those other libraries I mentioned.
I got as far as I could on the double sided eagle import.
This is the last stable: it renders everything but does not flip the board: http://raykholo.github.io/eagle-brd-import/
This requires a rework of how the widget generates all the board details and is outside the scope of what I am capable of. I spent a lot of time trying to make that work without much luck.