MoI discussion forum
MoI discussion forum

Full Version: STL import script with some helpers

Show messages: All  1-6  7-12

From: Frenchy Pilou (PILOU)
12 Mar 2018   [#7]
<< a SECRET trick??
_import OBJ by Max Smirnov ?
But not sure that result will be different than your before some cleaning...
From: r2d3
12 Mar 2018   [#8] In reply to [#6]
Absolut no clarification necessary :)

>> Anyway as I've said, it's a really useful bunch of JS code, a kind of "proving ground" :)
Exactly, just playing around and learning whats possible to realise with MoI.
From: Hamish Mead (HAIRYKIWI)
12 Mar 2018   [#9]
Very nice work Ralf!

There can never be enough conversion tools - even if extra time is still needed to clean and tweak such imported files.

Many thanks :)

- Hamish
From: Chris (UGMENTALCASE)
18 Aug 2022   [#10]
Hi,

Is there a way to edit this script so it just imports the stl without trying to make it solid and so on? I have literally no idea when it comes to scripts so forgive me :-)
From: Michael Gibson
18 Aug 2022   [#11] In reply to [#10]
Hi Chris, you might want to try converting the STL file to .obj format and then use the OBJ to 3DM wireframe converter from here:
https://moi3d.com/wiki/Resources#Obj23dmWireframe_converter

That makes wireframe lines or closed polylines for each polygon instead of trying to construct a solid out of it which is much more heavyweight.

If you did want to edit this script to not try to join it into a solid, the joining part is done by a function named JoinTriangles(). The function is called on line number 17 in the file _STLimport.js . It's a long line of code, look for the piece of it that has this:

var solid=JoinTriangles(triangles);var sol=solid.numSolids;if(sol<1){var message="SORRY!\nI WAS NOT ABLE TO MAKE A SOLID!\nDont't try to \"Clean flat surfaces\"";}else{var message=sol+" SOLID CREATED!";};

Delete all of that or "comment it out" by putting /*    */ around it and then it shouldn't do the joining part.

- Michael
From: Chris (UGMENTALCASE)
19 Aug 2022   [#12] In reply to [#11]
Cheers I'll take a look. I have used the other script a little bit, but sometimes there is just too many lines!

Show messages: All  1-6  7-12