How do I edit/create code snippets?

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

Re: Metric screws and bolts

nophead
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 <[hidden email]> wrote:
D: Just tried that and get the error shown on line 5:



Terry

Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

Terrypin
This post was updated on .
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/
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

Terrypin
In reply to this post by nophead
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 at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

nophead
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 <[hidden email]> 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 at Nabble.com.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

mondo
In reply to this post by Terrypin

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

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 at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

Terrypin
In reply to this post by nophead
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 the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

Terrypin
In reply to this post by nophead
... and here's the image I included in the web post:




Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

nophead
I think so but you should rename the top level NopSCADlib from NopSCADlib-master. That is an annoying feature of github when you download as zip because when you clone using it you get the correct name.

On Wed, 9 Jun 2021 at 18:47, Terrypin <[hidden email]> wrote:
... and here's the image I included in the web post:




Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Metric screws and bolts

Terrypin
In reply to this post by mondo
Thanks a lot!

Resized it to my small diameter and reduced the head size to match - and after printing it actually worked. I'll redo it at standard quality (0.16 in Cura rather than my LQ print at 0.28), and I'll also try laying it on its side instead of vertically as I've just done.



Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
12