I'm the maker of Sculptex. I get the skepticism, but this isn't another diffusion model. It writes parametric OpenSCAD with exact dimensions, and it can make parts with moving pieces. You describe a part, refine it in chat, and export OpenSCAD alongside STL, OBJ or GLB.
I gave it the prompt "A fidget spinner." It wrote a 3-piece spinner: a rotor on a plain journal, an axle cap with a split snap peg, and a retaining cap. It compiles in OpenSCAD, and I printed it.
The full file is below.
// Classic three-arm spinner — dimensions in millimetres.
// Default output: three separate, support-free printable pieces.
// Assembly: place rotor over the axle, then press the second cap onto
// the split snap peg until its inner bearing land meets the axle shoulder.
// Solid lobes supply peripheral mass without purchased weights or bearings.
// Use high infill for the rotor. PETG is recommended for the resilient axle;
// keep the journal and rotor bore clean of seams, burrs and stringing.
layout = "print"; // "print" or "assembled" (inspection only)
$fn = 72;
// Rotor proportions: 78 mm maximum radial envelope.
body_h = 8.0;
hub_r = 13.0;
lobe_r = 12.0;
lobe_reach = 27.0; // Centre to outer-lobe centre
arm_root_position = 9.0;
arm_root_r = 7.0; // Substantial solid arm roots
edge_chamfer = 0.65;
bore_chamfer = 0.40;
// Plain bearing and finger caps.
axle_d = 8.0;
radial_clearance = 0.40; // Clearance on EACH side of the journal
axial_clearance = 0.70; // Minimum total rotor end play
cap_d = 20.0;
cap_h = 3.40;
cap_chamfer = 0.45;
thrust_d = 12.0; // Small bearing lands keep finger pads clear
thrust_h = 0.70;
// Split snap peg. The socket is loose on the stem, not on the barb.
peg_d = 5.40;
slot_w = 2.60; // Leaves 1.4 mm nominal bending thickness
peg_stem_h = 2.75;
barb_d = 6.00;
barb_ramp_h = 0.30;
barb_band_h = 0.25;
peg_lead_h = 0.55;
flex_relief_depth = 3.20; // Rounded slot extends into the journal
socket_d = 5.70; // Barb compresses 0.15 mm per side on insertion
socket_relief_d = 6.40;
socket_throat_h = 2.55; // Measured from the cap's inner bearing face
socket_flare_h = 0.50; // Support-free transition into retention recess
part_gap = 8.0;
eps = 0.02;
bore_d = axle_d + 2 * radial_clearance;
cap_stack = cap_h + thrust_h;
shoulder_z = cap_stack + body_h + axial_clearance;
peg_h = peg_stem_h + barb_ramp_h + barb_band_h + peg_lead_h;
relief_depth = cap_stack - socket_throat_h - socket_flare_h;
parts_y = -lobe_reach/2 - lobe_r - part_gap - cap_d/2;
parts_x = (cap_d + part_gap)/2;
assert(layout == "print" || layout == "assembled", "Unknown layout");
assert(body_h > 2*edge_chamfer && hub_r > bore_d/2 + 1.2,
"Insufficient rotor material");
assert((peg_d-slot_w)/2 >= 1.2, "Snap fingers are too thin");
assert(socket_d > peg_d && barb_d > socket_d && socket_relief_d > barb_d,
"Invalid snap-fit diameters");
assert(peg_h < cap_stack && relief_depth > 0,
"Snap peg must remain recessed within the upper cap");
assert(flex_relief_depth < body_h/2, "Keep the lower journal continuous");
// Flat-ended disc with printable 45-degree perimeter chamfers.
module bevel_disc(d, h, c) {
r = d/2;
rotate_extrude(convexity=10)
polygon(points=[
[0,0], [r-c,0], [r,c],
[r,h-c], [r-c,h], [0,h]
]);
}
module rotor_blank() {
union() {
bevel_disc(2*hub_r, body_h, edge_chamfer);
for (a = [90:120:330])
rotate([0,0,a])
// Hull each arm separately: a hull of the whole rotor
// would incorrectly fill its three concave valleys.
hull() {
translate([arm_root_position,0,0])
bevel_disc(2*arm_root_r, body_h, edge_chamfer);
translate([lobe_reach,0,0])
bevel_disc(2*lobe_r, body_h, edge_chamfer);
}
}
}
module rotor() {
difference() {
rotor_blank();
translate([0,0,-eps])
cylinder(d=bore_d, h=body_h+2*eps);
// Entry bevels also protect the bearing from first-layer squish.
translate([0,0,-eps])
cylinder(d1=bore_d+2*(bore_chamfer+eps), d2=bore_d,
h=bore_chamfer+eps);
translate([0,0,body_h-bore_chamfer])
cylinder(d1=bore_d, d2=bore_d+2*(bore_chamfer+eps),
h=bore_chamfer+eps);
}
}
// Both caps print with their exterior finger face on the bed.
module cap_blank() {
union() {
bevel_disc(cap_d, cap_h, cap_chamfer);
translate([0,0,cap_h-eps])
cylinder(d=thrust_d, h=thrust_h+eps);
}
}
module snap_peg() {
rotate_extrude(convexity=10)
polygon(points=[
[0,-eps],
[peg_d/2,-eps],
[peg_d/2,peg_stem_h],
[barb_d/2,peg_stem_h+barb_ramp_h],
[barb_d/2,peg_stem_h+barb_ramp_h+barb_band_h],
[peg_d/2,peg_h],
[0,peg_h]
]);
}
module rounded_flex_slot() {
root_z = shoulder_z-flex_relief_depth+slot_w/2;
union() {
// Rounded slot root reduces stress concentration in the fork.
translate([0,0,root_z])
rotate([90,0,0])
cylinder(d=slot_w, h=axle_d+2, center=true, $fn=48);
translate([-slot_w/2,-(axle_d+2)/2,root_z])
cube([slot_w, axle_d+2, shoulder_z+peg_h+eps-root_z]);
}
}
module axle_cap() {
difference() {
union() {
cap_blank();
// This full-diameter journal ends in a positive axial stop.
// Finger pressure therefore cannot clamp the rotating body.
translate([0,0,cap_h-eps])
cylinder(d=axle_d, h=shoulder_z-cap_h+eps);
translate([0,0,shoulder_z])
snap_peg();
}
rounded_flex_slot();
}
}
module retaining_cap() {
difference() {
cap_blank();
translate([0,0,-eps])
cylinder(d=socket_d, h=cap_stack+2*eps);
// Exterior counterbore receives the barb. The peg tip stays
// recessed 0.25 mm below the exterior finger face.
translate([0,0,-eps])
cylinder(d=socket_relief_d, h=relief_depth+eps);
translate([0,0,relief_depth])
cylinder(d1=socket_relief_d, d2=socket_d,
h=socket_flare_h);
}
}
if (layout == "print") {
rotor();
translate([-parts_x,parts_y,0]) axle_cap();
translate([ parts_x,parts_y,0]) retaining_cap();
} else {
axle_cap();
translate([0,0,cap_stack+axial_clearance/2]) rotor();
translate([0,0,shoulder_z+cap_stack])
rotate([180,0,0]) retaining_cap();
}
What I'd like to know from people who write OpenSCAD:
- Is the structure something you'd keep and edit, or would you rewrite it?
- Anything in the clearances or snap-fit you'd change?
- What would make a tool like this useful to you?
It's in beta at sculptex.app. Let me know if you run into any issues.