discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Metric screws and bolts

KE
Karl Exler
Tue, Jun 8, 2021 9:49 AM

could you please send me one small file, which works on my
OpenScad-Installation, where I can see the syntax and the stuff with
INCLUDE ? Please.

e.g. making an M8 screw and/or a M8 bolt..

That would be great

thank you very much in advance

Karl

Am 08.06.21 um 11:08 schrieb fred via Discuss:


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

could you please send me one small file, which works on my OpenScad-Installation, where I can see the syntax and the stuff with INCLUDE ? Please. e.g. making an M8 screw and/or a M8 bolt.. That would be great thank you very much in advance Karl Am 08.06.21 um 11:08 schrieb fred via Discuss: > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Ray West
Tue, Jun 8, 2021 10:23 AM

//twist nut 8mm blank
include<NopSCADlib/utils/thread.scad>

//module male_metric_thread(d, pitch, length, center = true, top = -1,
bot = -1, solid = true, colour = undef) { //! Create male thread with
metric profile

translate([0,0,10])
difference(){
      union(){
      translate ([0,0, 5])  sphere( 12);
      scale([1.5,1,1])translate ([0,0,-5])  rotate ([90,0,0])
cylinder(h=3,d=15,center=true);
      cylinder (h=20,d=16,center=true);
}
     male_metric_thread(8,1.25,21);

     translate([0,0,-60])  cube([100,100,100],true); //chop off bottom

}

$fn=80;

fyi,well worth looking at NopSCADlib

hth

On 08/06/2021 10:49, Karl Exler wrote:

could you please send me one small file, which works on my
OpenScad-Installation, where I can see the syntax and the stuff with
INCLUDE ? Please.

e.g. making an M8 screw and/or a M8 bolt..

That would be great

thank you very much in advance

Karl

Am 08.06.21 um 11:08 schrieb fred via Discuss:


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

//twist nut 8mm blank include<NopSCADlib/utils/thread.scad> //module male_metric_thread(d, pitch, length, center = true, top = -1, bot = -1, solid = true, colour = undef) { //! Create male thread with metric profile translate([0,0,10]) difference(){       union(){       translate ([0,0, 5])  sphere( 12);       scale([1.5,1,1])translate ([0,0,-5])  rotate ([90,0,0]) cylinder(h=3,d=15,center=true);       cylinder (h=20,d=16,center=true); }      male_metric_thread(8,1.25,21);      translate([0,0,-60])  cube([100,100,100],true); //chop off bottom } $fn=80; fyi,well worth looking at NopSCADlib hth On 08/06/2021 10:49, Karl Exler wrote: > could you please send me one small file, which works on my > OpenScad-Installation, where I can see the syntax and the stuff with > INCLUDE ? Please. > > e.g. making an M8 screw and/or a M8 bolt.. > > > That would be great > > thank you very much in advance > > Karl > > Am 08.06.21 um 11:08 schrieb fred via Discuss: >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
T
Terrypin
Wed, Jun 9, 2021 8:26 AM

D: Just tried that and get the error shown on line 5:

http://forum.openscad.org/file/t3184/ThreadCodeError.jpg

Terry

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

D: Just tried that and get the error shown on line 5: <http://forum.openscad.org/file/t3184/ThreadCodeError.jpg> Terry -- Sent from: http://forum.openscad.org/
NH
nop head
Wed, Jun 9, 2021 8:40 AM

You need to download NopSCADlib, or clone it from github, and set the
OPENSCADPATH environment variable to point to the directory containing
NopSCADlib. Or put it in one of the directories already listed in Hlep /
Library info.

I think the syntax error is because the commented out module definition is
split on to two lines and the second line isn't commented out. i.e. line 5
is part way through a comment. The line probably got broken by an email
client.

On Wed, 9 Jun 2021 at 09:26, Terrypin terrypingm@gmail.com wrote:

D: Just tried that and get the error shown on line 5:

Terry

Sent from the OpenSCAD mailing list archive http://forum.openscad.org/
at Nabble.com.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

You need to download NopSCADlib, or clone it from github, and set the OPENSCADPATH environment variable to point to the directory containing NopSCADlib. Or put it in one of the directories already listed in Hlep / Library info. I think the syntax error is because the commented out module definition is split on to two lines and the second line isn't commented out. i.e. line 5 is part way through a comment. The line probably got broken by an email client. On Wed, 9 Jun 2021 at 09:26, Terrypin <terrypingm@gmail.com> wrote: > D: Just tried that and get the error shown on line 5: > > > > Terry > ------------------------------ > Sent from the OpenSCAD mailing list archive <http://forum.openscad.org/> > at Nabble.com. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
T
Terrypin
Wed, Jun 9, 2021 2:03 PM

Thanks, understood. Should have set it up earlier but now done so. Does this
look OK?
OPENSCADPATH
C:\Program
Files\OpenSCAD\libraries;C:\Users\terry\Documents\OpenSCAD\libraries;C:\Users\terry\Dropbox\3D
Printer\OpenSCAD\LIBRARIES

I can see why I should leave those in \Program Files, but can I move the
contents of *C:\Users\terry\Documents\OpenSCAD\libraries

  • to my newly defined \LIBRARIES folder?

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

Thanks, understood. Should have set it up earlier but now done so. Does this look OK? OPENSCADPATH C:\Program Files\OpenSCAD\libraries;C:\Users\terry\Documents\OpenSCAD\libraries;C:\Users\terry\Dropbox\3D Printer\OpenSCAD\LIBRARIES I can see why I should leave those in \Program Files, but can I move the contents of *C:\Users\terry\Documents\OpenSCAD\libraries * to my newly defined *\LIBRARIES* folder? -- Sent from: http://forum.openscad.org/
T
Terrypin
Wed, Jun 9, 2021 2:43 PM

I'm expanding my earlier reply (as you're an email user so would not see it
if I just edited it).

I read the following in usage.md

"NopSCADlib usage
Requirements

  1. OpenSCAD 2021.01 or later, download it from here:
    https://www.openscad.org/downloads.html

  2. Python 2.7+ or 3.6+ from https://www.python.org/downloads/

  3. ImageMagick 7 www.imagemagick.org

As a mere end user, neither programmer nor developer, do I really need 2 &
3?


BTW, I note that Karl's post mid-thread renamed it to 'Re: Metric screws and
bolts' . But when I open the forum on the web to look for your post, the
thread is still named 'How do I edit/create code snippets?'.

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

I'm expanding my earlier reply (as you're an email user so would not see it if I just edited it). I read the following in usage.md "NopSCADlib usage Requirements 1. OpenSCAD 2021.01 or later, download it from here: https://www.openscad.org/downloads.html 2. Python 2.7+ or 3.6+ from https://www.python.org/downloads/ 3. ImageMagick 7 www.imagemagick.org As a mere end user, neither programmer nor developer, do I really need 2 & 3? -------------------- BTW, I note that Karl's post mid-thread renamed it to 'Re: Metric screws and bolts' . But when I open the forum on the web to look for your post, the thread is still named 'How do I edit/create code snippets?'. -- Sent from: http://forum.openscad.org/
NH
nop head
Wed, Jun 9, 2021 2:47 PM

You need 2 and 3 to run any of the scripts that do things like make the
bill of materials, STLs, assembly drawings and project instruction manual.
You don't need them to simply run the OpenSCAD code in the GUI and then
manually export the STL.

On Wed, 9 Jun 2021 at 15:43, Terrypin terrypingm@gmail.com wrote:

I'm expanding my earlier reply (as you're an email user so would not see
it if I just edited it).

I read the following in usage.md

"NopSCADlib usage
Requirements

  1. OpenSCAD 2021.01 or later, download it from here:
    https://www.openscad.org/downloads.html

  2. Python 2.7+ or 3.6+ from https://www.python.org/downloads/

  3. ImageMagick 7 www.imagemagick.org

As a mere end user, neither programmer nor developer, do I really need 2 &
3?


BTW, I note that Karl's post mid-thread renamed it to 'Re: Metric screws
and bolts' . But when I open the forum on the web to look for your post,
the thread is still named 'How do I edit/create code snippets?'.

Sent from the OpenSCAD mailing list archive http://forum.openscad.org/
at Nabble.com.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

You need 2 and 3 to run any of the scripts that do things like make the bill of materials, STLs, assembly drawings and project instruction manual. You don't need them to simply run the OpenSCAD code in the GUI and then manually export the STL. On Wed, 9 Jun 2021 at 15:43, Terrypin <terrypingm@gmail.com> wrote: > I'm expanding my earlier reply (as you're an email user so would not see > it if I just edited it). > > I read the following in usage.md > > "NopSCADlib usage > Requirements > > 1. OpenSCAD 2021.01 or later, download it from here: > https://www.openscad.org/downloads.html > > 2. Python 2.7+ or 3.6+ from https://www.python.org/downloads/ > > 3. ImageMagick 7 www.imagemagick.org > > As a mere end user, neither programmer nor developer, do I really need 2 & > 3? > > -------------------- > > BTW, I note that Karl's post mid-thread renamed it to 'Re: Metric screws > and bolts' . But when I open the forum on the web to look for your post, > the thread is still named 'How do I edit/create code snippets?'. > ------------------------------ > Sent from the OpenSCAD mailing list archive <http://forum.openscad.org/> > at Nabble.com. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Ray West
Wed, Jun 9, 2021 5:09 PM

I've not bothered to put in the dimensions you need, I'm not sure if
they are correct anyway (whatever 😁), and if you go with hex socket you
need to check the af value (and the ,866, maybe) It takes a while to
render. but should get you on your way. I've printed 6mm and larger
threaded stuff, (see my previous post) but I would not bother with much
smaller on fdm. I started by making the studding (generally for bolt
lengths the length does not include the head)  then added the head, then
took out the hex socket.

/ cap head screw
include<NopSCADlib/utils/thread.scad>

$fn=20; //whatever

length=30; //whatever
diam=2.7; //  out of tolerance 3mm?
head_thick =4; // whatever
head_diameter = 6 ; //whatever
pitch =0.5; // whatever or 0.35
af =4 ; //hex socket

// make blank studding
difference(){
    union(){
      male_metric_thread(diam,pitch,length+head_thick,false);
// head
     cylinder (head_thick,d=head_diameter);
    }
//socket
   #cylinder(head_thick-1,d=af*0.866,$fn=6);
}

On 09/06/2021 15:43, Terrypin wrote:

I'm expanding my earlier reply (as you're an email user so would not
see it if I just edited it).

I read the following in usage.md

"NopSCADlib usage
Requirements

  1. OpenSCAD 2021.01 or later, download it from here:
    https://www.openscad.org/downloads.html
    https://www.openscad.org/downloads.html

  2. Python 2.7+ or 3.6+ from https://www.python.org/downloads/
    https://www.python.org/downloads/

  3. ImageMagick 7 www.imagemagick.org

As a mere end user, neither programmer nor developer, do I really need
2 & 3?


BTW, I note that Karl's post mid-thread renamed it to 'Re: Metric
screws and bolts' . But when I open the forum on the web to look for
your post, the thread is still named 'How do I edit/create code
snippets?'.

Sent from the OpenSCAD mailing list archive
http://forum.openscad.org/ at Nabble.com.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've not bothered to put in the dimensions you need, I'm not sure if they are correct anyway (whatever 😁), and if you go with hex socket you need to check the af value (and the ,866, maybe) It takes a while to render. but should get you on your way. I've printed 6mm and larger threaded stuff, (see my previous post) but I would not bother with much smaller on fdm. I started by making the studding (generally for bolt lengths the length does not include the head)  then added the head, then took out the hex socket. / cap head screw include<NopSCADlib/utils/thread.scad> $fn=20; //whatever length=30; //whatever diam=2.7; //  out of tolerance 3mm? head_thick =4; // whatever head_diameter = 6 ; //whatever pitch =0.5; // whatever or 0.35 af =4 ; //hex socket // make blank studding difference(){     union(){       male_metric_thread(diam,pitch,length+head_thick,false); // head      cylinder (head_thick,d=head_diameter);     } //socket    #cylinder(head_thick-1,d=af*0.866,$fn=6); } On 09/06/2021 15:43, Terrypin wrote: > I'm expanding my earlier reply (as you're an email user so would not > see it if I just edited it). > > I read the following in usage.md > > "NopSCADlib usage > Requirements > > 1. OpenSCAD 2021.01 or later, download it from here: > https://www.openscad.org/downloads.html > <https://www.openscad.org/downloads.html> > > 2. Python 2.7+ or 3.6+ from https://www.python.org/downloads/ > <https://www.python.org/downloads/> > > 3. ImageMagick 7 www.imagemagick.org > > As a mere end user, neither programmer nor developer, do I really need > 2 & 3? > > -------------------- > > BTW, I note that Karl's post mid-thread renamed it to 'Re: Metric > screws and bolts' . But when I open the forum on the web to look for > your post, the thread is still named 'How do I edit/create code > snippets?'. > ------------------------------------------------------------------------ > Sent from the OpenSCAD mailing list archive > <http://forum.openscad.org/> at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
T
Terrypin
Wed, Jun 9, 2021 5:42 PM

Thanks. Did you also see my two previous questions?

Reply | Threaded | More
Jun 09, 2021; 3:03pm
Re: Metric screws and bolts
Terrypinonline
29 posts

Thanks, understood. Should have set it up earlier but now done so. Does this
look OK?
OPENSCADPATH
C:\Program
Files\OpenSCAD\libraries;C:\Users\terry\Documents\OpenSCAD\libraries;C:\Users\terry\Dropbox\3D
Printer\OpenSCAD\LIBRARIES

I can see why I should leave those in \Program Files, but can I move the
contents of C:\Users\terry\Documents\OpenSCAD\libraries
to my newly defined \LIBRARIES folder?

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

Thanks. Did you also see my two previous questions? Reply | Threaded | More Jun 09, 2021; 3:03pm Re: Metric screws and bolts Terrypinonline 29 posts Thanks, understood. Should have set it up earlier but now done so. Does this look OK? OPENSCADPATH C:\Program Files\OpenSCAD\libraries;C:\Users\terry\Documents\OpenSCAD\libraries;C:\Users\terry\Dropbox\3D Printer\OpenSCAD\LIBRARIES I can see why I should leave those in \Program Files, but can I move the contents of C:\Users\terry\Documents\OpenSCAD\libraries to my newly defined \LIBRARIES folder? -- Sent from: http://forum.openscad.org/
T
Terrypin
Wed, Jun 9, 2021 5:46 PM

... and here's the image I included in the web post:

http://forum.openscad.org/file/t3184/NopSCADLib.jpg

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

... and here's the image I included in the web post: <http://forum.openscad.org/file/t3184/NopSCADLib.jpg> -- Sent from: http://forum.openscad.org/