Discussion:
[OpenSCAD] New module for screws
DarioPellegrini
2018-11-09 20:21:37 UTC
Permalink
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/
DarioPellegrini
2018-11-14 15:11:40 UTC
Permalink
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/
memsfactory
2018-11-14 21:17:59 UTC
Permalink
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/
fred
2018-11-14 22:06:36 UTC
Permalink
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 <***@gmail.com> 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/
DarioPellegrini
2018-11-14 23:05:48 UTC
Permalink
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/
roland78
2018-11-15 19:33:33 UTC
Permalink
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/
Joris Robijn
2018-11-17 10:40:21 UTC
Permalink
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
> ***@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>


--
Joris Robijn <***@robijn.net>
Phone: +31 6 288 41 964
Loading...