Import STL to MoI

 From:  Michael Gibson
7046.16 In reply to 7046.14 
Hi Chipp,

> Interesting. I thought the .js would be the business logic and the .html the GUI.

It is set up to be like that, but the .js code runs out of process so that it can be canceled at any time by tearing down the worker process, while any code in the .htm GUI side runs in-process. Any calls to MoI from the out of process code run through inter-process marshaling and so have a higher overheard per call into MoI code. This doesn't really come into any significance for regular MoI commands because their business logic just acts at a high level as glue logic, not doing heavier computation directly in the script itself.

So anyway, wedging the code into the in-process GUI side can have some performance improvements for more calculation heavy type code like in this case.

I'm going to attempt to change the threading model in the next version of MoI to make the .js code to run on its own dedicated in-process thread instead of out of process, which will have the downside of losing the automatic canceling (right now anything that runs in the .js can automatically be canceled without any cooperation of the script), but should make the call-into-MoI performance to be equivalent.


re: STL exported from MoI doesn't work - that's probably because your STL file was a binary STL file and this import script only supports ascii STL files currently. In MoI if you go to Options > Import/Export > STL options > File Type and set it to "File type = Ascii" that should then make a file that will work with this importer.

- Michael