New module for screws

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

New module for screws

DarioPellegrini
Hello, I've just finished coding a new module for creating objects by
rotational extrusion including pitch, suitable for things such as
cylindrical helices and screws.
I aimed at achieving light and fast rendering, therefore I work totally with
meshes and just at the end I build a single polyhedron. I would love you to
try it out and return some feedback!

revolve.scad <http://forum.openscad.org/file/t2340/revolve.scad>  

https://www.thingiverse.com/thing:3205929




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: New module for screws

DarioPellegrini
There were several things that I didn't like in the previous module, so I
rewrote it in a simpler way which is also quite more powerful.
https://www.thingiverse.com/thing:3215997

Fresh starting OpenSCAD, this scene renders (F6) on my laptop (i7-4870HQ @
2.50GHz) in less than a minute, 57 seconds to be exact.

<http://forum.openscad.org/file/t2340/revolve2.png>



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: New module for screws

memsfactory

Looks very useful. However, I get this error when I run the code downloaded
from Thingiverse:

"ERROR: Parser error in line 317: syntax error
ERROR: Compilation failed! "


Does code work for: OpenSCAD version 2015.03-1 ?




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: New module for screws

fred_dot_u
I commented out the last block of code, the one that references troubleshooting and the error disappeared. F5 then generates a thread and a couple sliced coned threaded objects. Unfortunately, my lack of understanding extended only that far and I'm unable to create anything useful from there. No reflection on the creator, only on this user.

On Wednesday, November 14, 2018, 4:18:44 PM EST, memsfactory <[hidden email]> wrote:



Looks very useful. However, I get this error when I run the code downloaded
from Thingiverse:

"ERROR: Parser error in line 317: syntax error
ERROR: Compilation failed! "


Does code work for: OpenSCAD version 2015.03-1 ?





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: New module for screws

DarioPellegrini
Hi, thank you for testing and reporting!
I added the simplest possible example that I could think of:

revolve(profile=[[0,5],[1,6],[2,5]], length=10, nthreads=1, $fn=8);

<http://forum.openscad.org/file/t2340/revolve2.png>

Does this make any sense?

I could try to better document the code by adding figures explaining the
profile meaning and generation, or maybe I could make a video tutorial...

I was also planning to code some ISO threads so that they can be easily
used.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: New module for screws

roland78
Hi, Dario. I can run your code.
<http://forum.openscad.org/file/t1725/Screenshot_%2813%29.png> I write to
you a mail about your code yesterday, if what is in the picture can be do
it. Can be used more shapes in your code in 1 screw? Where to do in the code
this shapes? If i don't want to use screw ,but a smooth surface where to do
the change in the code?  Can do a module or function to be twisted too , to
this code? Is in the code somewhere to be done a tube , empty in the middle?
Thank you.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: New module for screws

robijn
In reply to this post by DarioPellegrini
Hi Dario,

I tried somethings similar some time ago. Difference was I made a lot of pie shapes and built up the thread (or other shape) in
that way. Similar result, but yours is nicer in the way that you don't have anything inside the shape.

But the problem for me with these things is performance. Both yours and mine are just terribly slow for real work. If you include
only 10 M10 bolts of 40mm length, you'll be stuck for 10 seconds or so for preview (at resolution of 32). So I really think this
should be done inside openscad. With a pitch extension to rotate_extrude (I think that's all that's needed).

Currently I am using linear_extrude with twists, which is lightning fast but gives very ugly threads. It's very suboptimal with
regards to the shape and amount of polygons that's used.

I think in your example below, the resolution parameter at the end should be f, instead of $fn.
I always put some test code, which can also serve as an example, at the end of my library code. If you "use < >" the library, it's
not in the way, but if you open the library you can show the example with Preview.

Best regards,
Joris


On 14 Nov 2018 at 16:05, DarioPellegrini wrote:

> Hi, thank you for testing and reporting!
> I added the simplest possible example that I could think of:
>
> revolve(profile=[[0,5],[1,6],[2,5]], length=10, nthreads=1, $fn=8);
>
> <http://forum.openscad.org/file/t2340/revolve2.png>
>
> Does this make any sense?
>
> I could try to better document the code by adding figures explaining the
> profile meaning and generation, or maybe I could make a video tutorial...
>
> I was also planning to code some ISO threads so that they can be easily
> used.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>


--
Joris Robijn <[hidden email]>
Phone: +31 6 288 41 964



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org