MoI discussion forum
MoI discussion forum

Full Version: Automatical cylinder ?

From: Frenchy Pilou (PILOU)
28 Oct 2019   [#1]
Any idea for transform this in a true Nurbs cylinder ? Automatically of course!

This arrives from SKetchUp files for example...


From: Michael Gibson
28 Oct 2019   [#2] In reply to [#1]
Hi Pilou, I'd probably use Draw curve > Circle > 3pts to create a circle through 3 points snapped on to the 3 endpoints of those straight edges, then delete the inside "side walls", then untrim the holes, then do a boolean with the circle. Let me know if you need more info.

- Michael
From: Frenchy Pilou (PILOU)
28 Oct 2019   [#3] In reply to [#2]
Of course but this can't be made for thousand of them when you import any SketchUp file!
All rounded polygons forms cones etc..are faceted!

a compromise would be to replace "manually" one facetted by its nurbs twin brother...( completly drawn on side)
and then replicate this new nurbs model on each other... Selection / Replacement
From: Michael Gibson
28 Oct 2019   [#4] In reply to [#3]
Hi Pilou, it's really best to avoid creating such models in SketchUp in the first place if you need accurate cylinders.

- Michael
From: Frenchy Pilou (PILOU)
28 Oct 2019   [#5] In reply to [#4]
Sure ! :)

In theory inside Moi Replace an object(s) A by an Object B is possible or utopic ?

Say I have 3 cones selected I click a sphere each cone become a sphere...
From: Michael Gibson
28 Oct 2019   [#6] In reply to [#5]
Hi Pilou,

re:
> In theory inside Moi Replace an object(s) A by an Object B is possible or utopic ?
>
> Say I have 3 cones selected I click a sphere each cone become a sphere...

There isn't any already existing function that would do that but it seems like it could be done by scripting.

Or maybe something to try with the node editor?

- Michael
From: Mindset (IGNITER)
31 Oct 2019   [#7] In reply to [#6]
> In theory inside Moi Replace an object(s) A by an Object B is possible or utopic ?


Maybe something utopian could derive from this: https://moi3d.com/forum/index.php?webtag=MOI&msg=8080.3
From: Frenchy Pilou (PILOU)
31 Oct 2019   [#8] In reply to [#7]
I don't want code..so if you can adapt this with the ELEPHANT nodes that will be a task! :)
From: r2d3
1 Nov 2019   [#9] In reply to [#1]
Hi Pilou,

this is something what my STLimport script can do...
After importing a STL it has some functions to clean faces, polygone lines, curves and circles.

Select the object -> start the script and choose "Only clean"
It will ask you to "clean flat surfaces? click "no"
Then it asks: Redraw polylines? click "yes"
Select all polylines from the hole -> click "Done"
It shows you the first Polyline and ask you what it shoud be -> choose "Circle"
The same with the next one.

It delets all corespondending faces and lets you alone to rebuild it...

Have fun

Attachments:
_STLimport.htm
_STLimport.js


From: Frenchy Pilou (PILOU)
1 Nov 2019   [#10] In reply to [#9]
Seems cool but not yet test for STL object but seems not works for pure nurbs Moi object with polygonal holes ... :)
From: Frenchy Pilou (PILOU)
1 Nov 2019   [#11]
PS That works also for the Pure Nurbs object but top/bottom face are erased!



Tried with STL file
I must have missed something! :)
(not sure of what exactly must be selected...the vertical between polygons ? or only the polygons "curvated", both or something else... )
Circles are fine but the rest... are missing!
or it's to me to "and lets you alone to rebuild it". :)


From: Frenchy Pilou (PILOU)
1 Nov 2019   [#12]
OK that works but i must make some reconstructions: Loft between Circles, Planar Top Bottom faces, Union or Join all for remake the solid...
Is that normal ?

Ps I don't understand why you said : It will ask you to "clean flat surfaces? click "no"
"Yes" will be more easy for select something! Because there are a lot of parasitic lines!


From: r2d3
1 Nov 2019   [#13] In reply to [#12]
This script was actually intendet to make it easier for reconstrukting parts where you only have a stl file.

This is the normal workflow:

After importing a (simple) stl it looks like this:



If the conversion to a solid was successful you can "clean flat surfaces" and it looks like this:


Select all polylines which should be redraw as nurbs:


After clicking "done" it presents you every polyline and you choose "Circle or Curve" to redraw it.( "Line" would make a straight line with only 2 points if it had more points before):


Than it looks like this:


After some lofting and connecting you get a solid


Cut out the holes, and VOILA:


Bigger STLs can crash MOI or need a long time...

Attachments:
stltest.stl

Image Attachments:
2019.11.01-13.36.58-[3D].png  2019.11.01-13.37.10-[3D].png  2019.11.01-13.38.39-[3D].png  2019.11.01-13.39.55-[3D].png  2019.11.01-13.40.51-[3D].png  2019.11.01-13.52.35-[3D].png  2019.11.01-13.53.19-[3D].png 


From: Frenchy Pilou (PILOU)
1 Nov 2019   [#14] In reply to [#13]
Ok many thanks all is now clear...it's quasi that all i made! :)
And I was right for the "yes" ;)

And will be the same with pure nurbs moi polygonal objects!
From: Stargazer
1 Nov 2019   [#15] In reply to [#14]
Hi Ralf,

This is very useful, thanks for sharing your scripts!

Before this, I did it all manually with the help of Reconstruct Curve, 3point Circle and other MoI tools. Now it's a lot easier :)
From: Frenchy Pilou (PILOU)
1 Nov 2019   [#16]
Here the French Version! ;)

http://moiscript.weebly.com/r2d3.html
From: mk (MARKY)
22 Jun 2021   [#17]
Hello,

How to make this STL import to work?

- I put both files in commands folder - it didn't work,
then
- I put the _STLimport.js file in scripts folder, it didn't work either
then I removed above file from the script folder and in Shortcuts window changed the shortcut name for _STLimport.
And it worked but after picking the STL file the error message appears, as the attached.

Any chance to fix it?

Image Attachments:
STL import dialog error.JPG 


From: Michael Gibson
22 Jun 2021   [#18] In reply to [#17]
Hi mk, there are 2 different kinds of STL files, there is a text file version and a binary version. I think the STL import plugin only supports the text version type so make sure you have that kind of STL and not a binary one.

Note that in general it's not very workable to import STL geometry into MoI because STL files only contain faceted triangle mesh data while MoI is designed to work with CAD surfaces and solids and isn't a polygon modeler.

- Michael