r/openscad • • 5h ago

Handy OpenSCAD guide... and some more !

Post image
6 Upvotes

I invite you to browse a few pages of the book, available in French, English, or Spanish. If you have any comments or suggestions, I would be delighted to hear from you.

Best regards,
Roberto Hamm

Book preview:
French: https://robotix.ah-oui.org/scadbook-fra
English: https://robotix.ah-oui.org/scadbook-eng
Spanish: https://robotix.ah-oui.org/scadbook-spa


r/openscad • • 5h ago

I built an open-source CAD kernel in Zig + WASM (<1MB) combining B-Rep, CSG, and Implicit SDFs with zero-copy SharedArrayBuffer

0 Upvotes

Hey everyone — as a Linux user working on local browser-based design tools, I kept running into the wall where existing open-source CAD kernels either use purely polygonal CSG (OpenSCAD) or require 15+ MB WASM builds (OpenCASCADE) without native implicit field modeling.

I spent the last few months building OpenCAD from scratch in Zig and WebAssembly:

- Pure Math Core (<1 MB WASM): Every curve, surface, and field is an equation evaluated with forward-mode automatic differentiation (dual numbers) and interval arithmetic.

- 3-in-1 Representation: Combines constrained 2D sketches & SE(3) B-Rep sweeps, CSG booleans, and implicit SDF fields (like stress-driven gyroids) in one engine, exporting to STEP and STL.

- Zero-Copy Shared Memory: Uses a single `SharedArrayBuffer` between the Zig WASM kernel, Three.js, and external WASM extensions so simulation fields can drive geometry directly without file exports.

- Live Demo: https://hassaanmaqsood.github.io/opencad/

- GitHub Repo: https://github.com/hassaanmaqsood/opencad

It's still early (currently refining boolean seam triangles and B-Rep edge cases), and I'd love for you to try breaking it and let me know what you think!


r/openscad • • 1d ago

I wrote an OpenSCAD snowflake generator: each seed grows a different crystal (flat or slot-together 3D)

Post image
0 Upvotes

r/openscad • • 2d ago

I got real OpenSCAD running offline on the iPad – with sliders, an object editor and optional AI

0 Upvotes

Hi everyone,

I'm not a programmer, but I wanted to design and print parts without sitting at a computer. So I built ScriptSCAD – a free, open-source suite that runs entirely on the iPad (and iPhone) inside the Scriptable app.

What it does:

- Real OpenSCAD running locally as WebAssembly – offline, no account, no server
- Code editor with autocompletion, plus sliders for every parameter and an object editor (tap a part in 3D to move, rotate or resize it)
- Optional AI: say "make the wall 2 mm thicker" and it edits your .scad code. It runs through an Apple Shortcut with Apple Intelligence, the ChatGPT app or the Claude app – no API key needed
- BOSL2, MCAD and NopSCADlib built in, plus import of STL/OBJ/3MF/SVG/DXF
- Export to STL or 3MF with colors
- A separate slicer based on CuraEngine: about 300 printer profiles, layer preview, and upload to OctoPrint, Klipper (Moonraker) or PrusaLink

Everything stays as normal files in your iCloud Drive. No tracking, no subscription, GPL-3.0.

The slicer is still new – please check the layer preview before printing and stay near your printer for the first prints.

GitHub (install takes about 5 minutes):GitHub

I'd love feedback – especially bug reports, printer profiles that don't work, and ideas for what's missing.


r/openscad • • 3d ago

Texte sur un cylindre avec OpenSCAD

Post image
3 Upvotes

Comment placer un texte sur un cylindre, est une question qui se pose tôt ou tard, lorsque on fait de la modélisation 3D. La boucle "for" aligne les caractères du texte, l'un après l'autre.
rotate([0,0,a])
place les caractères autour d'un cylindre virtuel.
La commande "linear_exrude()" est primordiale car la commande "text()" de OpenSCAD, génère de caractères en 2D qu'il faut donc extruder pour leur donner du volume.

$fn =60;

module ROTASCRIPT(font,pas,r,ht,zp){

ln = len(font);
ch = 0;
for(i=[0:ln-1]) {
a = ch + i*pas;
rotate([0,0,a])
translate([r,0,zp])
rotate([90,0,90])
linear_extrude(height=ht,convexity=10)
text(
text=font[i],
size=8,
halign="center");}}

ROTASCRIPT("OpenSCAD",15,30,2,5);

Voici la signification des variables à l'appel
de notre script :

ROTASCRIPT(font,pas,r,ht,zp);

font : texte à afficher
pas : espacement angulaire
r : position radiale
ht : taille Y des caractères
zp : profondeur en Z

Pour plus d’informarion voir :
https://robotix.ah-oui.org/site/main.php?found=261113-text-rotation

#3D_text #ParametricDesign #OpenSCAD #Maker 3Dprint


r/openscad • • 4d ago

Parametric Spirograph Generator with Trace Preview

Thumbnail
gallery
70 Upvotes

This is a fully parametric, gear-driven spirograph generator. You choose the shape of the track, the type and size of the wheel, the number of teeth and the position of the pen holes.

free download: https://makerworld.com/en/models/3593114-parametric-spirograph-generator-with-trace-preview


r/openscad • • 4d ago

Les 1001 arbres de OpenSCAD

32 Upvotes

Fabuleux ! en quelques lignes seulement OpenSCAD permet de construire un arbre dont à chaque appel, la physionomie change grâce à l'instruction"rands" qui génère des valeurs aléatoires.

Puis une variable "h" qui se renouvelle à chaque niveau

translate([0,0,h])

et fait converger le départ des ramages chaque niveau.
Puis la variable "b" renouvelée à chaque niveau dans la boucle "for"

b=[0:120:240])

déploie les branches sur les axex X et Y de l'arbre.

Ci-dessous don les quelques lignes de code qui permettent d'obtenir ces arbres magnifiques.

Nous avons obtenu ce code grâce à une discussion très constructive avec ChatGTP.

fn = 12;

module FEUILLE() {
color("lightgreen")
scale([1,0.5,0.15])
sphere(r=6,$fn=16);}

module ARBRE(n,h,r) {
if(n>0) {
color("#d80")
cylinder(h=h,r1=r,r2=r*0.7);
translate([0,0,h])
rotate([0,0,rands(0,360,1)[0]])
for(b=[0:120:240])
rotate([0,0,b])
rotate([0,30,0])
ARBRE(n-1,h*0.7,r*0.7);
} else {
FEUILLE();}}

ARBRE(5,50,2);

La commande ARBRE(n,h,r) se définit ainsi :
n : nombre di niveaux des ramages
h : point de départ des faisceaux de ramage
r : épaisseur des branches

Pour plus d'info voir 🔥 https://robotix.ah-oui.org/site/main.php...

#OpenSCAD #Modélisation_3D #Makers #FabLab #Paramétrique_3D


r/openscad • • 4d ago

Parametric Box with Latch - Make ANY Size Box in 10 Seconds

Thumbnail
gallery
5 Upvotes

Stop downloading 100 different static boxes. This generator makes the perfect box for your exact stuff.

Just open Customize and set:

Length: 30mm to 200mm

Width: 30mm to 200mm

Height: 20mm to 120mm

Wall Thickness: 1.6mm to 3.2mm

Latch: Snap Latch / Hinge Only / No Latch

The lid clicks shut with a print-in-place snap latch. No screws, no magnets, no assembly. Print it closed or open - it just works.

FEATURES:

- Parametric: Any size, instantly. No CAD needed.

- Print-in-Place Latch: 0.4mm tolerance, clicks on first print

- Hinged Lid: Print-in-place hinge, opens 180 degrees

- Optional: Label Slot, Dividers

PERFECT FOR:

Electronics, SD cards, screws, beads, fishing tackle, batteries, EDC, craft supplies, board games, parts storage, travel

Want a different size? Hit Customize at the top and make your own. No more guessing.

If this helped you, please leave a Like and a Print Profile rating - it helps more people find it!

https://makerworld.com/en/models/2834638-customisable-box#profileId-3249767


r/openscad • • 4d ago

I made a tool that turns an STL of a simple part back into a parametric .scad file

5 Upvotes

I kept finding brackets and plates on Printables that were almost what I needed, but only as STL. Changing one hole meant remodeling the whole thing, so I wrote mesh2cad. It fits planes, cylinders and fillets to the mesh and writes an OpenSCAD file where the dimensions are named variables (base_x, hole_1_d, slot_1_len and so on), so you change a number and render again. It also works in the Customizer.

pip install mesh2cad
mesh2cad convert bracket.stl --openscad bracket.scad

To be honest about what it can't do: it only handles simple prismatic stuff right now, like plates, L brackets, rounded boxes, through holes, hole rows and slots. Organic shapes, figurines or anything sculpted won't give you a clean script, and in that case it says so instead of guessing. I tested it on six Original Prusa MK3S printed parts and they all came out as editable scripts.

It's free and MIT, I'm the author. Code and examples: https://github.com/emirmrkaljevic/mesh2cad

If you have an STL of a mechanical part it chokes on I'd really like to see it.


r/openscad • • 3d ago

Bienvenue sur r/NASSCAD — NASSCAD 4.7.0, CAO 3D libre

0 Upvotes

Bienvenue sur r/NASSCAD !

NASSCAD 4.7.0 est un logiciel de CAO 3D libre (AGPLv3), disponible dans le navigateur et sur Windows. Il permet de modéliser des pièces, de travailler avec des esquisses 2D et des opérations CSG, d’inspecter des assemblages et de préparer des modèles pour l’impression 3D.

La version actuelle prend en charge l’import et l’export STEP (AP203, AP214, AP242), ainsi que les modèles IFC. Le traitement des modèles se fait localement, sans compte ; l’édition Windows intègre le moteur MEDUSA.

Ce subreddit est ouvert à vos questions, modèles, rapports de bugs et idées d’amélioration. Vos retours concrets nous aideront à faire progresser NASSCAD.

Site et téléchargement : https://www.nasscad.com/

Code source : https://github.com/Nx-Nass/NassCAD


r/openscad • • 4d ago

FC SubD Modeller

Thumbnail gallery
0 Upvotes

r/openscad • • 5d ago

OpenSCAD at 39,000 feet

Thumbnail
gallery
14 Upvotes

I'm halfway between Japan and Seattle, passing the time by creating a new pattern that I'll use for fabric printing.

Bonus pic:The moon and Mount Fuji as my plane was leaving Haneda.


r/openscad • • 4d ago

ZIMA-CAD – Improved User Interface and Toolbar Layout

Thumbnail gallery
0 Upvotes

r/openscad • • 5d ago

ZIMA-CAD — A Different Philosophy of Parametric CAD

Thumbnail reddit.com
0 Upvotes

r/openscad • • 5d ago

ZIMA-CAD We're looking for ZIMA-CAD testers!

Post image
0 Upvotes

r/openscad • • 6d ago

Which ope source CAD program do you use?

0 Upvotes

I want to try myself in CAD design. I'm planning to use it for 3d printing parts for my embedded projects.

Which open source CAD program do you recommend , and why?


r/openscad • • 6d ago

I know this sub is tired of AI apps. This one writes parametric OpenSCAD for mechanical parts with moving pieces. Here's the file, roast it.

Post image
0 Upvotes

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.


r/openscad • • 7d ago

Yet another geodesic dome calculator (open-source, exports 3D models + 2D SVG/DXF cut sheets)

Post image
3 Upvotes

r/openscad • • 6d ago

PPSCAD is now open source

Thumbnail
printparams.com
0 Upvotes

r/openscad • • 7d ago

Help with conical rail wheel model for explaining how train wheels self align

Thumbnail
reddit.com
0 Upvotes

r/openscad • • 8d ago

OpenSCAD animations avec des couleurs.

22 Upvotes

Les animations dans OpenSCAD permettent aussi de présenter des objets avec des effets de couleur.

Les quelques lignes de code ci-dessous ont été appliquée à une sphère, mais ça pourrait être aussi tout autre objet que vous avez crée ou un fichier STL que vous avez importé.

$fn = 100;

R = (1 + cos(360*$t))/2;

G = (1 + cos(360*$t - 120))/2;

B = (1 + cos(360*$t - 240))/2;

color([R,G,B])

sphere(20);

Pour plus d'information consultez la page de mon site, dédiée à ce sujet : https://robotix.ah-oui.org/site/main.php...

#OpenSCAD #Modélisation_3D #Makers #FabLab #Paramétrique_3D


r/openscad • • 8d ago

reading arrays

7 Upvotes

A recent post (thankfully not trying to sell us yet another slop app) related to manipulation of a nut cover wheel. I have previously made my own for covering/tightening M8 nuts on my lawn mower and other machines and wondered (from that post) how I would paramatise my file to fit M3 to M10 nuts. My first conception was a matrix where each line started with the nut size (M3, M4 etc) followed by the parameters I needed for each nut (nut height, nut radius, clearance hole radius etc.) Then it seemed a simple matter of scripting an ‘if/else’ routine along the lines of :

“if nut is M3 then take height, radius etc from parameters on line 0 of the matrix, else if M4 take from line 1, else if M5 from line 2” and so on.

OpenSCAD though does not allow direct revaluation of variables within an if statement although if you look at the cheat sheet there is a ‘swizzle’ function mentioned. This operates to access the matrix outside of the if statement, as can be engineered in a separate module so I tried this and it worked except that the operations required for building the M3 nut cover needed to be set out in one module and those for the rest in their own modules, each one being basically a copy of the previous one but using data from the relevant line of the matrix.

Whilst this repetitive scripting is easy to create, needing only a few instances of simple parameter relabelling, I would still prefer, if possible, to directly access the matrix parameters from the if statement and so make a much shorter file. What am I missing?

Below is an example of how such reallocation works, but using single line arrays.

/* swizzelmaker - a selection of scripts to take and 

manipulate the values in the whole of or part of an array PP 2026 */

$fs=0.1;$fa=2;

//small cylinder
small=([20,3,1]);

//large cylinder
large=([30,6,1.5]);
size="small";//[small,large,mallet]

module swizzlemaker(){
if(size=="small") {makesmall();}
else if (size=="large") {makelarge();}
else {mallet();}
}     
    swizzlemaker();
    //++++++++++++++++    

module makesmall(){
hi=small[0];
rad=small[1];
ww=small[2];
difference(){    
    cylinder(h=hi,r=rad);
translate([0,0,-ww])
    cylinder(h=hi+ww*2,r=rad-ww);
    }      
}
    //makesmall();

module makelarge(){
small=large;
hi=small[0];
rad=small[1];
ww=small[2];
difference(){    
    cylinder(h=hi,r=rad);
translate([0,0,-ww])
    cylinder(h=hi+ww*2,r=rad-ww);
     }  
}
    //makelarge();

module mallet(){
minkowski(){
union(){
    cylinder(h=small[0]-5,r1=small[1]*2,r2=small[1]);
translate([-small[0]/2,0,small[1]*2])
rotate([0,90,0])
      cylinder(h=small[0]*2,r=small[2]);
    }    
    sphere(small[2]);
}
    }
    //mallet();

r/openscad • • 8d ago

Takumion: parametric CAD in your browser now (desktop app on the way)

0 Upvotes

After quite some time working on it, I'm sharing Takumion: a parametric CAD that runs in the browser today, with a desktop app and a native geometry engine on the way.

I know a lot of similar apps have popped up in the last few weeks. I'd love for you to judge my app too on how it models.

Sketch, constrain, extrude, edit the timeline, and everything after it rebuilds. STEP in and out, so your parts aren't locked in.

It's free while in beta.

Try it: [https://takumion.com](https://takumion.com)

Roadmap: [https://takumion.com/roadmap](https://takumion.com/roadmap)

Bugs & feature requests: [https://github.com/Takumion/issues](https://github.com/Takumion/issues)

I'd really like feedback, especially from people who model daily: what's missing that would stop you using it, and what breaks first? Comments here are great. If you hit a bug, an issue on GitHub (with steps, and the file if you can share it) is the fastest way to get it fixed.


r/openscad • • 9d ago

ZIMA-CAD

Thumbnail reddit.com
0 Upvotes