CAD Software My generic OpenSCAD rocketry scripts (so far)

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Winston

Lorenzo von Matterhorn
Joined
Jan 31, 2009
Messages
9,560
Reaction score
1,748
My script creations up to now.
 

Attachments

  • OpenSCAD scripts for model rocketry v3.zip
    28.7 KB · Views: 87
Thanks for those, always good to see how other folks do things in OpenSCAD.
The truly great thing about openSCAD is that users don't need to know anything about the CAD program to use a pre-made script other than how to click on a few icons in the bar at the top of the program and change comment identified numeric and "switch" values within the script to meet their requirements. There is no learning curve other than knowing what few icons to click on.
 
Cool I like it, but why metric inputs??? All LPR and HPR body tubes are listed in inch measurements...
That's the native mode for OpenSCAD. I could have put in conversions, but didn't because I absolutely HATE the incredibly stupid Imperial measurement system (even though I'm in the US) and want others to learn it. Apogee Rockets, unlike many OEMs who too often don't bother to list exact measurements even in Imperial units (!), has the precise Imperial and metric values for every component they sell.

Once you find a precise Imperial unit measurement, go to Google and type "XXX inches to mm". The answer will show up in a table, a table where you can then change the inch value to any value you want.

Or go to one of the many on-line conversion tools:

https://inchesmm.com/

Or multiply the inch value by 25.4 to get millimeters.
 
Last edited:
That's the native mode for OpenSCAD. I could have put in conversions, but didn't because I absolutely HATE the incredibly stupid Imperial measurement system (even though I'm in the US) and want others to learn it. Apogee Rockets, unlike many OEMs who too often don't bother to list exact measurements even in Imperial units (!), has the precise Imperial and metric values for every component they sell.

Once you find a precise Imperial unit measurement, go to Google and type "XXX inches to mm". The answer will show up in a table, a table where you can then change the inch value to any value you want.

Or go to one of the many on-line conversion tools:

https://inchesmm.com/

Or multiply the inch value by 25.4 to get millimeters.
I know how to do conversions, but had oroginally found that (on at least one other files set for OPENScad, the accuracy was limited to two decimal places which did not work well enough. First print was too tight... I later figured out how to modify that variable to do three decimal places... Another script I found used the radius instead of the diameter, in general it would seem to be best to be able to input the exact dimensions listed by tube supplier. I do not have any problems with metric system. U use metric nuts n bolts to build stuff, forced my hand there because I don't have a set of imperial inch sized hex keys...lol imperial = the dark side... rofl
 
I know how to do conversions, but had oroginally found that (on at least one other files set for OPENScad, the accuracy was limited to two decimal places which did not work well enough. First print was too tight... I later figured out how to modify that variable to do three decimal places... Another script I found used the radius instead of the diameter, in general it would seem to be best to be able to input the exact dimensions listed by tube supplier. I do not have any problems with metric system. U use metric nuts n bolts to build stuff, forced my hand there because I don't have a set of imperial inch sized hex keys...lol imperial = the dark side... rofl
Inherent dimensional accuracy of a given 3D printer is also an issue. With the "future landfill" novelties that many people print, exact dimensions don't make a difference even for multiple-part prints because the same error bias is experienced by all of the pieces involved.

However, with us, printing small parts which need to be an exact dimension, printer dimensional accuracy can be a real problem. As an example, I printed a 29mm von Karman nose cone (shown below) on my $325 printer and the same STL on a very expensive printer I have access to. The one from the expensive printer was perfect, the one from mine was a tiny bit small, fitting looser in the body tube. Likewise, the base of the nose cone printed on the expensive printer perfectly matched the OD of the body tube, but my home print was a tiny bit small.

One issue also related to dimensions is what slicers can do. Many can't do thin wall prints (extruder nozzle orifice width) correctly, from what I've experienced even when a "thin wall" box buried in "advanced" settings is checked making walls more than one orifice width wide. I've read that using a spiral print mode might help and that reminds me to try it.

I've just made an OpenSCAD test model to allow one to measure one's printer accuracy offset (OpenSCAD specified vs printed), something that can then be used to compensate the dimensional inputs when specifying dimensions within a script. I need to do a test print of it before I post it here. It uses common model rocket body tube ODs and IDs to allow the print accuracy of both to be measured.

I'd appreciate reviewing the other script you found which uses radius inputs if you can give me a link or attach it here so I can see exactly what it's doing.

47967522713_8dda3955ef_o.jpg
 
Tools for anyone planning to do 3D printing of rocketry parts which, unlike novelty prints, require precise dimensions:

I have a large collection of body tubes, nose cones, and other building parts from Apogee, Balsa Machining Service, Semroc, Estes, and Aerotech, so rather than looking up their dimensions for use within OpenSCAD, which would a a PITA, I simply measure parts I plan to use with:

Inexpensive digital calipers:

https://www.amazon.com/s?k=digital+calipers

Inexpensive metric tape measure:

https://www.amazon.com/Starrett-KTS12-3-5M-N-Measuring-Graduation-Interval/dp/B00ELMR0ZQ

For an accurate mass to enter into OpenRocket and Rocksim, I use digital scales. I own a small one of very high accuracy and a larger, lower accuracy one for larger components. For body tubes, I weigh an on-hand length of it, calculate the mass per mm, and multiply that by the number of milimeters specified in the design to be simulated to manually override the simulation program's mass and CG estimates.

Inexpensive digital scales:

https://www.amazon.com/s?k=digital+scale

Body tube dimension table at eRockets:

https://www.erockets.biz/body-tube-sizes/
 
Inherent dimensional accuracy of a given 3D printer is also an issue. With the "future landfill" novelties that many people print, exact dimensions don't make a difference even for multiple-part prints because the same error bias is experienced by all of the pieces involved.

However, with us, printing small parts which need to be an exact dimension, printer dimensional accuracy can be a real problem. As an example, I printed a 29mm von Karman nose cone (shown below) on my $325 printer and the same STL on a very expensive printer I have access to. The one from the expensive printer was perfect, the one from mine was a tiny bit small, fitting looser in the body tube. Likewise, the base of the nose cone printed on the expensive printer perfectly matched the OD of the body tube, but my home print was a tiny bit small.

One issue also related to dimensions is what slicers can do. Many can't do thin wall prints (extruder nozzle orifice width) correctly, from what I've experienced even when a "thin wall" box buried in "advanced" settings is checked making walls more than one orifice width wide. I've read that using a spiral print mode might help and that reminds me to try it.

I've just made an OpenSCAD test model to allow one to measure one's printer accuracy offset (OpenSCAD specified vs printed), something that can then be used to compensate the dimensional inputs when specifying dimensions within a script. I need to do a test print of it before I post it here. It uses common model rocket body tube ODs and IDs to allow the print accuracy of both to be measured.

I'd appreciate reviewing the other script you found which uses radius inputs if you can give me a link or attach it here so I can see exactly what it's doing.

47967522713_8dda3955ef_o.jpg
Here is the other script I found (Original one and with the input resolution changed from .01" to .001"), I tried to "find" it again and the thread eludes me as to where I found it here in TRF. I am not familiar yet with how the whole scripting language works, trying to learn it... there must be a simple way to change the input from radius to diameter,just haven't learned the syntax or where the best place to change the code. This cone was designed using that to fit Estes BT-50 printed with petg on a $2450 Artemis 300 RTP. Needed to sand it a little bit but it fit decent, noted that it was printed with supports...not necessary with this cone in the future. Was also printed fast, not with best precision, more interested in fit than perfection...

IMG_20190531_104519417.jpg
 

Attachments

  • Desktop.zip
    14.2 KB · Views: 34
Here is the other script I found (Original one and with the input resolution changed from .01" to .001"), I tried to "find" it again and the thread eludes me as to where I found it here in TRF. I am not familiar yet with how the whole scripting language works, trying to learn it... there must be a simple way to change the input from radius to diameter,just haven't learned the syntax or where the best place to change the code. This cone was designed using that to fit Estes BT-50 printed with petg on a $2450 Artemis 300 RTP. Needed to sand it a little bit but it fit decent, noted that it was printed with supports...not necessary with this cone in the future. Was also printed fast, not with best precision, more interested in fit than perfection...

View attachment 384633

It looks like my script from the "3D printing large parts" thread.
https://www.rocketryforum.com/threads/3d-printing-large-parts.151124/#post-1869674

If you want to change from specifying radius to diameter, rename the input parameter and then compute the old radius parameter just below the END_OF_CUSTOMIZER_VARIABLES module:

lines 28-29:
// Diameter at shoulder
Cone_Diameter = 6; // [0:0.01:200]

line 122:
module END_OF_CUSTOMIZER_VARIABLES() {}
Cone_Radius = Cone_diameter / 2;

P.S. It looks like you don't have the latest version of that script. See post #20 in the above thread.
https://www.rocketryforum.com/threads/3d-printing-large-parts.151124/#post-1887387
 
I am not familiar yet with how the whole scripting language works, trying to learn it... there must be a simple way to change the input from radius to diameter,just haven't learned the syntax or where the best place to change the code.

The change is easy, but I'm not understanding how specifying radii in the OpenSCAD script rather than diameters makes any difference in printing accuracy. Is there a significant figures used difference? The particular slicer used and the settings made within it definitely can affect the end dimension in a number of ways.
 
Last edited:
V3.1 of my script collection which includes a dimensional accuracy jig/gauge to determine printing correction factors for your particular printer, slicer, filament, and settings.
 

Attachments

  • OpenSCAD scripts for model rocketry v3.1.zip
    145.1 KB · Views: 41
It looks like my script from the "3D printing large parts" thread.
https://www.rocketryforum.com/threads/3d-printing-large-parts.151124/#post-1869674

If you want to change from specifying radius to diameter, rename the input parameter and then compute the old radius parameter just below the END_OF_CUSTOMIZER_VARIABLES module:

lines 28-29:
// Diameter at shoulder
Cone_Diameter = 6; // [0:0.01:200]

line 122:
module END_OF_CUSTOMIZER_VARIABLES() {}
Cone_Radius = Cone_diameter / 2;

P.S. It looks like you don't have the latest version of that script. See post #20 in the above thread.
https://www.rocketryforum.com/threads/3d-printing-large-parts.151124/#post-1887387
I tried that change, for some reason it generated dozens of errors. Worked at it a few ways and got it to work this way finally: I figured out something that made this easier to do by accident. I opened the file in Scad and Notepad simultaneously, make a change in notepad, the click File--> Save and Scad updates immediately. that is cool!

Lines 28-29:
// Diameter at shoulder
Cone_Diameter = 1; // [0:0.001:20]

Lines 134-139:
// Outer shell parameters
R = Cone_Diameter / 2;
L = Cone_Length;
R_t = Tip_Radius;
L_t = Tip_Length;
W_t = Wall_Thickness;

Here is my updated one for you if want it...Changed to dia. and updated start values to smaller cone and to my printer which is being shipped for delivery next week... (Creality Ender 3 Pro) Seems to be working ok. If you see anything messed up don't hesitate to let me know...
 

Attachments

  • NoseConeDesigner - updated.scad.txt
    21.9 KB · Views: 37
Last edited:
Here is my updated one for you if want it...Changed to dia. and updated start values to smaller cone and to my printer which is being shipped for delivery next week... (Creality Ender 3 Pro) Seems to be working ok. If you see anything messed up don't hesitate to let me know...

Your changes look fine.

FYI, instead of editing the initial values in the script you can use the "+" and "save preset" buttons at the top of the customizer panel to create named sets of parameter values.
 
Collection v3.2:

v3 - Minor bug fix, nosecone/tailcone option added, hemispherical top to nose cone anchor holes to eliminate need for supports, added delta/clipped delta fin can generator with integrated launch lug option. All resulting STLs from all scripts should be printable without supports.
v3.1 - Added dimensional accuracy test jig/gauge.
v3.2 - Minor fix to delta and clipped delta fin can generator, added fin alignment aid sleeve generator v2, strap-on pod mount generator, and elliptical leading edge generator.
 

Attachments

  • OpenSCAD scripts for model rocketry v3.2.zip
    97 KB · Views: 27
Collection v3.3: Added rocket stand and centering ring alignment aid generators.
 

Attachments

  • OpenSCAD scripts for model rocketry v3.3.zip
    99.9 KB · Views: 10
Collection v3.31 - minor bug fix to v3.3.
 

Attachments

  • OpenSCAD scripts for model rocketry v3.31.zip
    100 KB · Views: 17
Rocket stands made from the associated generator script in the collection:

51123288564_b4c49ee496_b.jpg
 
Back
Top