116 lines
3.7 KiB
Markdown
116 lines
3.7 KiB
Markdown
# 6 — Threaded jar & screw-on lid
|
|
|
|
> **Prompt**
|
|
>
|
|
> Create a small storage jar with external screw threads at the neck and a matching screw-on lid with internal threads. Jar body 60 mm diameter, 70 mm tall, 2.5 mm walls; show the lid unscrewed and sitting beside the jar.
|
|
|
|
Fully parametric OpenSCAD built from the prompt above — adjustable dimensions and colours, exported as `.SCAD` and rendered to the orbiting preview with [`render.sh`](render.sh).
|
|
|
|
<p align="center"><img src="06-threaded-jar-and-lid.gif" alt="Threaded jar & screw-on lid — orbiting render" width="380"></p>
|
|
|
|
**Parametric controls:** 9 dimensions · 2 colours
|
|
|
|
**What it demonstrates**
|
|
|
|
- Two **mating** threaded parts that share a pitch and diameter (external neck thread + internal lid thread) via BOSL2 threading
|
|
- Hollow jar body with printable walls
|
|
- Lid with a fluted grip rim, shown unscrewed beside the jar
|
|
|
|
**Editable parameters**
|
|
|
|
| Parameter | Default | Range / options | Description |
|
|
| --- | --- | --- | --- |
|
|
| `jar_diameter` | `60` | `[20:1:100]` | |
|
|
| `jar_height` | `70` | `[20:1:200]` | |
|
|
| `wall_thickness` | `2.5` | `[1:0.1:5]` | |
|
|
| `neck_diameter` | `55` | `[20:1:100]` | |
|
|
| `neck_height` | `15` | `[5:1:30]` | |
|
|
| `thread_pitch` | `3` | `[1:0.5:5]` | |
|
|
| `lid_clearance` | `0.5` | `[0:0.1:2]` | |
|
|
|
|
<details>
|
|
<summary>OpenSCAD source — <code>06-threaded-jar-and-lid.scad</code></summary>
|
|
|
|
```scad
|
|
include <BOSL2/std.scad>
|
|
include <BOSL2/threading.scad>
|
|
|
|
/* [Jar Dimensions] */
|
|
jar_diameter = 60; // [20:1:100]
|
|
jar_height = 70; // [20:1:200]
|
|
wall_thickness = 2.5; // [1:0.1:5]
|
|
|
|
/* [Neck and Threading] */
|
|
neck_diameter = 55; // [20:1:100]
|
|
neck_height = 15; // [5:1:30]
|
|
thread_pitch = 3; // [1:0.5:5]
|
|
lid_clearance = 0.5; // [0:0.1:2]
|
|
|
|
/* [Colors] */
|
|
jar_color = "LightSkyBlue";
|
|
lid_color = "SteelBlue";
|
|
|
|
$fn = 64;
|
|
|
|
shoulder_height = 5;
|
|
body_height = jar_height - neck_height - shoulder_height;
|
|
|
|
// Position jar
|
|
translate([-35, 0, 0])
|
|
color(jar_color)
|
|
difference() {
|
|
// Solid exterior
|
|
union() {
|
|
// Body
|
|
cylinder(d=jar_diameter, h=body_height);
|
|
// Shoulder
|
|
translate([0, 0, body_height])
|
|
cylinder(d1=jar_diameter, d2=neck_diameter, h=shoulder_height);
|
|
// Neck
|
|
translate([0, 0, body_height + shoulder_height])
|
|
threaded_rod(d=neck_diameter, l=neck_height, pitch=thread_pitch, anchor=BOTTOM);
|
|
}
|
|
|
|
// Hollow interior
|
|
union() {
|
|
// Body interior
|
|
translate([0, 0, wall_thickness])
|
|
cylinder(d=jar_diameter - 2 * wall_thickness, h=body_height - wall_thickness + 0.01);
|
|
|
|
// Shoulder interior
|
|
translate([0, 0, body_height])
|
|
cylinder(d1=jar_diameter - 2 * wall_thickness, d2=neck_diameter - 2 * wall_thickness, h=shoulder_height + 0.01);
|
|
|
|
// Neck interior
|
|
translate([0, 0, body_height + shoulder_height])
|
|
cylinder(d=neck_diameter - 2 * wall_thickness, h=neck_height + 1);
|
|
}
|
|
}
|
|
|
|
// Position lid beside the jar, upside down to show internal threads
|
|
translate([35, 0, neck_height + wall_thickness])
|
|
rotate([180, 0, 0])
|
|
color(lid_color)
|
|
difference() {
|
|
lid_outer_d = neck_diameter + 2 * wall_thickness + 2 * lid_clearance + 2;
|
|
|
|
// Lid exterior with grips
|
|
difference() {
|
|
cylinder(d=lid_outer_d, h=neck_height + wall_thickness);
|
|
|
|
// Grips
|
|
for (i = [0 : 15 : 359]) {
|
|
rotate([0, 0, i])
|
|
translate([lid_outer_d/2, 0, -1])
|
|
cylinder(r=1.5, h=neck_height + wall_thickness + 2, $fn=16);
|
|
}
|
|
}
|
|
|
|
// Internal threads cutout
|
|
translate([0, 0, -0.1])
|
|
threaded_rod(d=neck_diameter + lid_clearance, l=neck_height + 0.2, pitch=thread_pitch, anchor=BOTTOM, internal=true);
|
|
}
|
|
```
|
|
|
|
</details>
|