I need a script that will take an STL file provided by the user and give the LENGTH of filament used. The standard infill is 20% and the user will select the type of filament used so you can take the density of that selected filament into account. The printers use 0.4mm nozzles and 1.75mm filament. I use ASA, PLA, PET-G, TPU, and Nylon filament, so take the densities of those into account in your calculations. Please be aware that you cannot simply take the volume of the object and calculate the filament length from that. This will give inaccurate results for hollow objects. It MUST calculate the length of filament actually used from an STL file. It must also show a small rendering of the file to give the user something pretty to look at.
I'm well aware that an STL file will only give the bounding volume of an object so you're very likely going to have to integrate CuraEngine or parse the STL to a third party site to slice the file. If I have to set up CuraEngine on another domain then so be it. You'll need to explain how to do that.
This is a challenge so delivery time is open-ended. It must be fairly accurate but I'm not going to be disappointed if it's out by 15-20% - so long as it's 15-20% higher. Good luck!