r/openscad • • 1d ago

Fully printed linear rail in OpenSCAD: V wheels, flexure preload, filament axles

82 Upvotes

A linear rail with no bearings or springs. Four printed V wheels run in 90 degree grooves and spin on pieces of 1.75 mm filament. One side of the carriage is a flexure leaf that presses its wheels against the rail to take out play.

The OpenSCAD side:

  • Everything is a number in params.scad (rail length, preload, fits)
  • A check script intersects the parts to confirm what should touch does, and what shouldn't doesn't
  • First print had 2.25 mm flexure beams, too soft. Now 3.25 mm

250 mm rail, 100 mm carriage. PETG rail and carriage, PLA wheels. It fits and rolls smoothly; I have not measured load, side stiffness or creep.

Source and design notes: https://github.com/PeithonKing/PrintableParts/tree/main/roller_rail

Feedback on the flexure or the wheel profile is welcome.


r/openscad • • 5h ago

I built a small code-CAD language for AI assistants, here's a plant label script and the STL (ParaScript)

0 Upvotes

Disclosure: this is my own project.

I like OpenSCAD, but I wanted something an AI assistant could learn from a single file and write reliably. ParaScript is a small script language for 3D solids with a solver that runs in the browser and exports STL.

Here's the first test, a plant label (60x25 mm, 2 mm thick, 50 mm spike, 4 mm hanging hole). An assistant wrote it from the language guide; it compiled first time and the STL came out watertight (haven't printed it yet).

setup {
    name: "Plant Label",
    units: "mm",
    coordinate_system: "Z-up"
}

// Visible sizes are grouped by part. bite is a small overlap so unions stay closed.
parameters {
    tag: {
        width: 60.0,
        depth: 25.0,
        thickness: 2.0
    },
    spike: {
        width: 10.0,
        length: 35.0,
        bite: 1.0,
        tip: {
            width: 1.0,
            length: 15.0
        }
    },
    hole: {
        radius: 2.0,
        margin: 5.0
    }
}

// A flat taper from the shaft width down to a printable point, thickness unchanged.
// y = 0 is the point, y = tip length is the wide end. That end seats bite mm into the shaft.
// Faces follow the broom bristles: six walls of one closed solid.
def Tip = Component(
    solid: coords =>
        let length = $spike.tip.length in
        let thick = $tag.thickness in
        let wide = $spike.width in
        let narrow = $spike.tip.width in
        let half = u =>
            ((length - u) * (narrow / 2.0) / length) + (u * (wide / 2.0) / length) in
        let bottom = Surface2D(
            max_u: length,
            min_v: u => 0.0 - half(u: u),
            max_v: u => half(u: u),
            formula: u => v => Vector(coords: coords, x: v, y: u, z: 0.0)
        ) in
        let top_face = Surface2D(
            max_u: length,
            min_v: u => 0.0 - half(u: u),
            max_v: u => half(u: u),
            formula: u => v => Vector(coords: coords, x: v, y: u, z: thick)
        ) in
        let left = Surface2D(
            max_u: length,
            min_v: u => 0.0,
            max_v: u => thick,
            formula: u => v => Vector(coords: coords, x: 0.0 - half(u: u), y: u, z: v)
        ) in
        let right = Surface2D(
            max_u: length,
            min_v: u => 0.0,
            max_v: u => thick,
            formula: u => v => Vector(coords: coords, x: half(u: u), y: u, z: v)
        ) in
        let wide_end = Surface2D(
            max_u: wide,
            min_v: u => 0.0,
            max_v: u => thick,
            formula: u => v => Vector(
                coords: coords,
                x: u - (wide / 2.0),
                y: length,
                z: v
            )
        ) in
        let narrow_end = Surface2D(
            max_u: narrow,
            min_v: u => 0.0,
            max_v: u => thick,
            formula: u => v => Vector(
                coords: coords,
                x: u - (narrow / 2.0),
                y: 0.0,
                z: v
            )
        ) in
        Solid3D(faces: [bottom, top_face, left, right, wide_end, narrow_end]),
    expose: coords => {
        up: Vector(coords: coords, x: 0.0, y: 0.0, z: 1.0),
        right: Vector(coords: coords, x: 1.0, y: 0.0, z: 0.0),
        top: Vector(
            coords: coords,
            x: 0.0,
            y: $spike.tip.length,
            z: 0.0
        )
    }
)

def Shaft = Box(
    width: $spike.width,
    depth: $spike.length + (2.0 * $spike.bite),
    height: $tag.thickness
)

def Spike = Component(
    solid: join(
        frame: Shaft,
        placed: Tip,
        using: frame => placed => align(
            planar: meet(
                frame: frame.up,
                placed: placed.up
            ),
            translation: meet(
                frame: frame.corner.offset(
                    x: $spike.width / 2.0,
                    y: $spike.bite,
                    z: 0.0
                ),
                placed: placed.top
            ),
            rotation: meet(
                frame: frame.right,
                placed: placed.right
            )
        ),
        combine: frame => placed => frame + placed
    ),
    expose: coords => {
        up: Vector(coords: coords, x: 0.0, y: 0.0, z: 1.0),
        right: Vector(coords: coords, x: 1.0, y: 0.0, z: 0.0),
        top: Vector(
            coords: coords,
            x: $spike.width / 2.0,
            y: $spike.length + (2.0 * $spike.bite),
            z: 0.0
        )
    }
)

def Tag = Box(
    width: $tag.width,
    depth: $tag.depth,
    height: $tag.thickness
)

def TagWithSpike = Component(
    solid: join(
        frame: Tag,
        placed: Spike,
        using: frame => placed => align(
            planar: meet(
                frame: frame.up,
                placed: placed.up
            ),
            translation: meet(
                frame: frame.corner.offset(
                    x: $tag.width / 2.0,
                    y: $spike.bite,
                    z: 0.0
                ),
                placed: placed.top
            ),
            rotation: meet(
                frame: frame.right,
                placed: placed.right
            )
        ),
        combine: frame => placed => frame + placed
    ),
    expose: coords => {
        up: Vector(coords: coords, x: 0.0, y: 0.0, z: 1.0),
        right: Vector(coords: coords, x: 1.0, y: 0.0, z: 0.0),
        corner: Vector(coords: coords, x: 0.0, y: 0.0, z: 0.0)
    }
)

def PlantLabel = Component(
    solid: join(
        frame: TagWithSpike,
        placed: Cylinder(
            radius: $hole.radius,
            height: $tag.thickness
        ),
        using: frame => placed => align(
            planar: meet(
                frame: frame.up,
                placed: placed.up
            ),
            translation: meet(
                frame: frame.corner.offset(
                    x: $tag.width / 2.0,
                    y: $tag.depth - $hole.margin,
                    z: 0.0
                ),
                placed: placed.bottom
            ),
            rotation: meet(
                frame: frame.right,
                placed: placed.right
            )
        ),
        combine: frame => placed => frame - placed
    ),
    expose: coords => {
        origin: Vector(
            coords: coords,
            x: $tag.width / 2.0,
            y: $tag.depth / 2.0,
            z: 0.0
        )
    }
)

export(PlantLabel)

Differences from OpenSCAD that I'm unsure about, and would like opinions on: components are positioned by aligning exposed frames/points with join + align rather than nested translate/rotate transforms, and there are no text or taper primitives yet (so the tapered spike tip had to be built as a custom Solid3D from surfaces).

Try it (no sign-up): https://parascript.lindeque.family/ — there's a language guide and an llms.txt / AI assets file if you want to try it with your own assistant.

What would you want it to do that OpenSCAD makes awkward?


r/openscad • • 14h ago

Hackaday: Gardening With…OpenSCAD?

Thumbnail
hackaday.com
2 Upvotes

My wall-garden, designed in OpenSCAD, was promoted on the Hackaday blog!

OpenSCAD is where the innovation happens!

"To our knowledge, it’s the first time somebody sat down and wrote out all the code to generate a 3D model of a vertical garden in OpenSCAD." Tom Nardi

The project is open-source: https://github.com/wall-garden


r/openscad • • 1d ago

Parametric Ramp for Robot Vacuums & Wheelchairs

Thumbnail
gallery
58 Upvotes

A fully customizable ramp generator for door thresholds, small steps and curbs. It is ideal for robot vacuums, wheelchairs, RC cars and carts, and other wheeled devices, and it also handles thresholds with complex geometry. You can customize the shape, size and surface of the ramp to match your exact threshold. Enter the size you need and the ramp is split into modules that fit your print bed and lock together with dovetail joints. Everything is in mm, and parts print flat on the bed. The lip option may need supports.

Opposing ramps option

This option is designed for crossing the threshold in both directions. Enable it to build a matching ramp for each side of the threshold and tie them together. Each ramp gets dovetail sockets in its top platform. You print separate joint parts (bars or a bridge) that lie across the top of both ramps and lock into the sockets with dovetail tongues. Set the gap to match the width of your threshold. The top platform is lengthened automatically if it is too short for the sockets.


r/openscad • • 1d ago

The one box to end all the boxes, + patterns, + attachments

Thumbnail
gallery
84 Upvotes

Do you know this feeling when you browse one of the stl sites and you like a wall pattern of a model, an attachment of another, and the object itself again on another and you end up mushing these together ?

I am not much of a visual modeller, much rather a techie, so I figured lets give openscad and paramterized "prorammed" 3d modelling a chance, driven by ai agents ofcourse for sake of time. This lib started as something to solve my own pains but kept growing, sharing it here to get some feedback / ideas / comments on it, maybe i'm doing something someone else has already done? Or its so much easier in <software x> ? Curious to hear your thoughts!

Try the online browser based model generator: https://tamaygz.github.io/tg_3d_modelling/
Create a box: https://tamaygz.github.io/tg_3d_modelling/custombox
See the repo & underlying lib + openscad code: https://github.com/tamaygz/tg_3d_modelling


r/openscad • • 2d ago

100% OpenSCAD Gingerbread Man Ornaments

Thumbnail gallery
13 Upvotes

Gingerbread men Christmas ornaments, made entirely in OpenSCAD. Just posted on makerworld.com if anyone is interested.

Maker World link: https://makerworld.com/en/models/3711550-angry-gingerbread-man-christmas-ornament-bite-me

GitHub repo with OpenSCAD source: https://github.com/billism1/3d-print-angry-gingerbread-man


r/openscad • • 3d ago

Un crochet de grue avec OpenSCAD

Post image
2 Upvotes

Voici un objet qui n'est pas trop difficile à réussir sur OpenSCAD.
Vous trouverez tous les détails sur ces pages de mon site 😄

https://robotix.ah-oui.org/site/main.php?found=261129-cranehook

et

https://robotix.ah-oui.org/site/main.php?found=261128-curved-tubes


r/openscad • • 3d ago

I built validation checks for AI-written OpenSCAD: collisions, motion sweep, fits, screw lengths

0 Upvotes

I make most of my parts with Claude Code + OpenSCAD now. The models often looked right and still came out wrong: a bore sealed behind a wall, gears colliding halfway through rotation, a screw too long for its hole.

So I wrote a set of skills that check the model before export: connectivity, bbox vs. declared dims, actual bore size, collisions by penetration depth, a full motion sweep, ISO 286 fits, fastener paths, overhangs/teardrop hints, and some basic strength (snap-fits, buckling, HDT). Every check has a test that proves it can fail.

Free, MIT: https://github.com/Altern92/openscad-cad-skills

I’m the author. Feedback welcome, especially cases where it passes something it shouldn’t.


r/openscad • • 3d ago

Openscad > Fusion on Maker World in Maker Lab

Thumbnail makerworld.com
1 Upvotes

r/openscad • • 4d ago

Assemblage de fragments tubulaires courbes

Post image
1 Upvotes

Ici, nous avons un module (pouvant être utilisé dans un "include" qui permet de créer de fragments coudés tubulaires.

On peut ainsi assembler plusieurs fragments de tubes partant en toutes directions.

En appliquant une valeur nulle (0) à la variable "tub" on obtient une suite de coudes pleins.

Dans notre exemple, on voit trois segments de tube dont le diamètre intérieur est de 0.8 ce qui équivaut à 80% du diamètre extérieur.

$fn = 80;

module TUBE(cir,ang,len,pos,tx,ty,scx,scy){
mirror([mir,0,0])
translate([tx,ty,0])
rotate([0,0,pos])
rotate_extrude(angle=ang,convexity=10){
translate([len,0])
scale([scx,scy])
difference(){
circle(r=cir);
circle(r=cir*0.8);}}}

TUBE(30, 60, 80, 50,-42,-63,1.7,1);
# TUBE(30, 60, 80,230, 60, 60,1.7,1);
TUBE(30,120,179.25,290, 25,153,1.7,1);

cir : diamètre du tube
tub : diamètre intérieur du tube
ang : valeur angulaire de 0 à 360°
len : longueur de la section
pos : position angulaire du tube
tx : positionnement sur l'axe X
ty : positionnement sur l'axe Y
scx : déformation de l'axe X du tube
scy : déformation de l'axe Y du tube

Plus d'information sur mon site 😄
https://robotix.ah-oui.org/site/main.php?found=261128-curved-tubes


r/openscad • • 4d ago

Review my OpenSCAD design for a 3D printed power bank case (32140 cell + round PCB), will it fit and print well?

Thumbnail
gallery
1 Upvotes
Hi everyone, I am learning OpenSCAD and 3D printing. I designed a round case for a DIY power bank and I would like your feedback before I print it. English is not my first language, so sorry for any mistakes.

**Parts**
- Battery: 32140 cell, 32 mm diameter x 140 mm long
- Circuit board: round power bank board, 42.5 mm diameter, 1.6 mm thick, with USB-A, USB-C, a power button and an LED display
- Screws: M2.5 x 5 mm into 4 printed standoffs

**Design**
- Body: 44 mm inside diameter, 49 mm outside diameter, 182.5 mm tall
- Battery hole: 32.8 mm (0.4 mm free on each side), with 3 small centering ribs
- 18 mm of free space above the battery for thick wires (I will fill the extra space with foam)
- 45° internal shelf and sloped rib bottoms, so I hope it prints with no supports
- 8 small rails on the outside so it does not roll
- Two friction-fit caps: top (with an LED window) and bottom
- Printer: [your printer model, max Z height]. Material: [PLA / PETG]

**My questions**
1. Will the battery and board fit with these gaps? Are my tolerances good for FDM printing?
2. Is a 0.3 mm gap on the caps good for a friction fit, or should I add a snap or a screw tab?
3. Will the ribs and shelf print without supports?
4. The body is tall and thin (182.5 mm). Will it print well, or should I print it in two parts?
5. Do you see any mistake in the code that could cause problems?


I checked the sizes by calculation only. I have not printed it yet. Code is below. Thank you for your time!

**Code:**


// =========================================================
// Final Round 32140 Power Bank (v7 - All Fixes Applied)
// Open LED Window, 45-Deg Sloped Ribs, 14mm USB-C, 360 Anti-Roll
// Use M2.5 x 5mm screws for PCB | Needs >= 185mm Printer Z-Height
// =========================================================


part_to_render = "all"; // Options: "all", "body", "top_cap", "bottom_cap"


// --- COMPONENT DIMENSIONS (mm) ---
cell_d = 32.0;
cell_l = 140.0;
cell_tol = 0.8;         // Smooth slide-in fit (32.8mm)
batt_wire_space = 18.0; // 14mm net wire room after 4mm bottom cap plug


pcb_d = 42.5;
pcb_thick = 1.6;
pcb_tol = 1.5;          // 44.0mm internal diameter


// --- ENCLOSURE PARAMETERS (mm) ---
wall = 2.5;
cap_tol = 0.3;
$fn = 80;


// --- CALCULATED DIMENSIONS ---
inner_d = pcb_d + pcb_tol;                  // 44.0mm uniform ID
outer_d = inner_d + wall * 2;               // 49.0mm uniform OD
batt_id = cell_d + cell_tol;                // 32.8mm


batt_bay_h = cell_l + batt_wire_space;      // 158.0mm
shelf_h    = 6.5;                           // 45-deg internal shelf
head_h     = 18.0;                          // Standoffs + PCB + USB-A clearance
total_h    = batt_bay_h + shelf_h + head_h; // 182.5mm total height


standoff_h = 4.5;
pcb_z      = batt_bay_h + shelf_h + standoff_h;
pcb_top_z  = pcb_z + pcb_thick;


// Verified 42.5mm PCB mounting hole coordinates (for M2.5 x 5mm screws)
hole_coords = [
    [-11.0,  15.5], // Top-Left
    [-11.0, -15.5], // Bottom-Left
    [ 18.0,   8.0], // Top-Right
    [ 18.0,  -8.0]  // Bottom-Right
];


// --- 1. MAIN BODY ---
module main_body() {
    difference() {
        union() {
            // Outer uniform cylinder
            difference() {
                cylinder(h=total_h, d=outer_d);
                translate([0, 0, -1])
                    cylinder(h=total_h + 2, d=inner_d);
            }
            
            // 8 Symmetric Anti-Roll Rails all around (zero-support 45-deg tapers)
            for (angle = [22.5 : 45 : 359]) {
                rotate([0, 0, angle])
                    translate([outer_d/2 - 0.4, 0, 0]) {
                        cylinder(h=2.0, d1=0.8, d2=3.6);
                        translate([0, 0, 2.0])
                            cylinder(h=pcb_z - 3.5, d=3.6);
                        translate([0, 0, pcb_z - 1.5])
                            cylinder(h=1.5, d1=3.6, d2=0.8);
                    }
            }
            
            // 3 Internal Battery Centering Ribs with 45-deg bottom slope (zero sagging)
            for (angle = [0, 120, 240]) {
                rotate([0, 0, angle])
                    intersection() {
                        cylinder(h=batt_bay_h + 1, d=inner_d + 1);
                        hull() {
                            // Starts flush against inner wall at z=6mm
                            translate([inner_d/2 - 0.5, -1.5, 6.0])
                                cube([1.0, 3.0, 0.5]);
                            // Reaches full rib depth at z=12mm (~45-deg slope)
                            translate([batt_id/2, -1.5, 12.0])
                                cube([(inner_d - batt_id)/2 + 0.5, 3.0, batt_bay_h - 11.0]);
                        }
                    }
            }
            
            // Internal 45-deg Tapered Shelf (zero-support overhang)
            translate([0, 0, batt_bay_h])
                difference() {
                    cylinder(h=shelf_h, d=inner_d + 1);
                    translate([0, 0, -0.5])
                        cylinder(h=shelf_h + 1, d1=inner_d, d2=31.0);
                }
        }
        
        // Wide 5.8mm x 11.8mm slot on -X side of shelf for thick 10-12 AWG wire
        translate([-19.0, 0, batt_bay_h - 1])
            hull() {
                translate([0, -3.0, 0]) cylinder(h=shelf_h + 2, d=5.8);
                translate([0,  3.0, 0]) cylinder(h=shelf_h + 2, d=5.8);
            }
            
        // --- DROP-IN SIDE CUTOUTS FOR PORTS & BUTTON ---
        // USB-A Port Slot (+Y, 90 deg)
        translate([0, outer_d/2, pcb_top_z + 6.5])
            cube([16.0, wall * 3, 14.0], center=true);
            
        // USB-C Port Slot (+X, 0 deg) - Widened to 14mm for thick cable heads
        translate([outer_d/2, 0, pcb_top_z + 6.5])
            cube([wall * 3, 14.0, 14.0], center=true);
            
        // Power Button Finger Cutout (45 deg, upper-right edge)
        rotate([0, 0, 45])
            translate([outer_d/2, 0, pcb_top_z + 6.5])
                cube([wall * 3, 11.0, 14.0], center=true);
    }
    
    // 4 PCB Mounting Standoffs (for M2.5 x 5mm screws)
    for (p = hole_coords) {
        difference() {
            translate([p[0], p[1], batt_bay_h + shelf_h])
                cylinder(h=standoff_h, d=5.2);
            translate([p[0], p[1], batt_bay_h + shelf_h - 1])
                cylinder(h=standoff_h + 2, d=2.1);
        }
    }
}


// --- 2. TOP CAP (Fully Open LED Window, Printed Upside-Down) ---
module top_cap() {
    difference() {
        union() {
            cylinder(h=wall, d=outer_d);
            translate([0, 0, wall])
                difference() {
                    cylinder(h=2.5, d=inner_d - cap_tol*2);
                    translate([0, 0, -0.5])
                        cylinder(h=3.5, d=inner_d - cap_tol*2 - 3.2);
                }
        }
        // Fully open LED Display Window ("188%") centered at [0, -11]
        translate([0, -11.0, wall/2])
            cube([15.5, 10.5, wall + 4], center=true);
    }
}


// --- 3. BOTTOM CAP (Clean Snap-In Plug) ---
module bottom_cap() {
    union() {
        cylinder(h=wall, d=outer_d);
        translate([0, 0, wall])
            difference() {
                cylinder(h=4.0, d=inner_d - cap_tol*2);
                translate([0, 0, -0.5])
                    cylinder(h=5.0, d=inner_d - cap_tol*2 - 3.6);
            }
    }
}


// --- RENDER LAYOUT ---
if (part_to_render == "all") {
    main_body();
    translate([outer_d + 12, 0, 0]) top_cap();
    translate([outer_d + 12, outer_d + 10, 0]) bottom_cap();
} else if (part_to_render == "body") {
    main_body();
} else if (part_to_render == "top_cap") {
    top_cap();
} else if (part_to_render == "bottom_cap") {
    bottom_cap();
}

// =========================================================
// Final Round 32140 Power Bank (v7 - All Fixes Applied)
// Open LED Window, 45-Deg Sloped Ribs, 14mm USB-C, 360 Anti-Roll
// Use M2.5 x 5mm screws for PCB | Needs >= 185mm Printer Z-Height
// =========================================================


part_to_render = "all"; // Options: "all", "body", "top_cap", "bottom_cap"


// --- COMPONENT DIMENSIONS (mm) ---
cell_d = 32.0;
cell_l = 140.0;
cell_tol = 0.8;         // Smooth slide-in fit (32.8mm)
batt_wire_space = 18.0; // 14mm net wire room after 4mm bottom cap plug


pcb_d = 42.5;
pcb_thick = 1.6;
pcb_tol = 1.5;          // 44.0mm internal diameter


// --- ENCLOSURE PARAMETERS (mm) ---
wall = 2.5;
cap_tol = 0.3;
$fn = 80;


// --- CALCULATED DIMENSIONS ---
inner_d = pcb_d + pcb_tol;                  // 44.0mm uniform ID
outer_d = inner_d + wall * 2;               // 49.0mm uniform OD
batt_id = cell_d + cell_tol;                // 32.8mm


batt_bay_h = cell_l + batt_wire_space;      // 158.0mm
shelf_h    = 6.5;                           // 45-deg internal shelf
head_h     = 18.0;                          // Standoffs + PCB + USB-A clearance
total_h    = batt_bay_h + shelf_h + head_h; // 182.5mm total height


standoff_h = 4.5;
pcb_z      = batt_bay_h + shelf_h + standoff_h;
pcb_top_z  = pcb_z + pcb_thick;


// Verified 42.5mm PCB mounting hole coordinates (for M2.5 x 5mm screws)
hole_coords = [
    [-11.0,  15.5], // Top-Left
    [-11.0, -15.5], // Bottom-Left
    [ 18.0,   8.0], // Top-Right
    [ 18.0,  -8.0]  // Bottom-Right
];


// --- 1. MAIN BODY ---
module main_body() {
    difference() {
        union() {
            // Outer uniform cylinder
            difference() {
                cylinder(h=total_h, d=outer_d);
                translate([0, 0, -1])
                    cylinder(h=total_h + 2, d=inner_d);
            }
            
            // 8 Symmetric Anti-Roll Rails all around (zero-support 45-deg tapers)
            for (angle = [22.5 : 45 : 359]) {
                rotate([0, 0, angle])
                    translate([outer_d/2 - 0.4, 0, 0]) {
                        cylinder(h=2.0, d1=0.8, d2=3.6);
                        translate([0, 0, 2.0])
                            cylinder(h=pcb_z - 3.5, d=3.6);
                        translate([0, 0, pcb_z - 1.5])
                            cylinder(h=1.5, d1=3.6, d2=0.8);
                    }
            }
            
            // 3 Internal Battery Centering Ribs with 45-deg bottom slope (zero sagging)
            for (angle = [0, 120, 240]) {
                rotate([0, 0, angle])
                    intersection() {
                        cylinder(h=batt_bay_h + 1, d=inner_d + 1);
                        hull() {
                            // Starts flush against inner wall at z=6mm
                            translate([inner_d/2 - 0.5, -1.5, 6.0])
                                cube([1.0, 3.0, 0.5]);
                            // Reaches full rib depth at z=12mm (~45-deg slope)
                            translate([batt_id/2, -1.5, 12.0])
                                cube([(inner_d - batt_id)/2 + 0.5, 3.0, batt_bay_h - 11.0]);
                        }
                    }
            }
            
            // Internal 45-deg Tapered Shelf (zero-support overhang)
            translate([0, 0, batt_bay_h])
                difference() {
                    cylinder(h=shelf_h, d=inner_d + 1);
                    translate([0, 0, -0.5])
                        cylinder(h=shelf_h + 1, d1=inner_d, d2=31.0);
                }
        }
        
        // Wide 5.8mm x 11.8mm slot on -X side of shelf for thick 10-12 AWG wire
        translate([-19.0, 0, batt_bay_h - 1])
            hull() {
                translate([0, -3.0, 0]) cylinder(h=shelf_h + 2, d=5.8);
                translate([0,  3.0, 0]) cylinder(h=shelf_h + 2, d=5.8);
            }
            
        // --- DROP-IN SIDE CUTOUTS FOR PORTS & BUTTON ---
        // USB-A Port Slot (+Y, 90 deg)
        translate([0, outer_d/2, pcb_top_z + 6.5])
            cube([16.0, wall * 3, 14.0], center=true);
            
        // USB-C Port Slot (+X, 0 deg) - Widened to 14mm for thick cable heads
        translate([outer_d/2, 0, pcb_top_z + 6.5])
            cube([wall * 3, 14.0, 14.0], center=true);
            
        // Power Button Finger Cutout (45 deg, upper-right edge)
        rotate([0, 0, 45])
            translate([outer_d/2, 0, pcb_top_z + 6.5])
                cube([wall * 3, 11.0, 14.0], center=true);
    }
    
    // 4 PCB Mounting Standoffs (for M2.5 x 5mm screws)
    for (p = hole_coords) {
        difference() {
            translate([p[0], p[1], batt_bay_h + shelf_h])
                cylinder(h=standoff_h, d=5.2);
            translate([p[0], p[1], batt_bay_h + shelf_h - 1])
                cylinder(h=standoff_h + 2, d=2.1);
        }
    }
}


// --- 2. TOP CAP (Fully Open LED Window, Printed Upside-Down) ---
module top_cap() {
    difference() {
        union() {
            cylinder(h=wall, d=outer_d);
            translate([0, 0, wall])
                difference() {
                    cylinder(h=2.5, d=inner_d - cap_tol*2);
                    translate([0, 0, -0.5])
                        cylinder(h=3.5, d=inner_d - cap_tol*2 - 3.2);
                }
        }
        // Fully open LED Display Window ("188%") centered at [0, -11]
        translate([0, -11.0, wall/2])
            cube([15.5, 10.5, wall + 4], center=true);
    }
}


// --- 3. BOTTOM CAP (Clean Snap-In Plug) ---
module bottom_cap() {
    union() {
        cylinder(h=wall, d=outer_d);
        translate([0, 0, wall])
            difference() {
                cylinder(h=4.0, d=inner_d - cap_tol*2);
                translate([0, 0, -0.5])
                    cylinder(h=5.0, d=inner_d - cap_tol*2 - 3.6);
            }
    }
}


// --- RENDER LAYOUT ---
if (part_to_render == "all") {
    main_body();
    translate([outer_d + 12, 0, 0]) top_cap();
    translate([outer_d + 12, outer_d + 10, 0]) bottom_cap();
} else if (part_to_render == "body") {
    main_body();
} else if (part_to_render == "top_cap") {
    top_cap();
} else if (part_to_render == "bottom_cap") {
    bottom_cap();
}

r/openscad • • 4d ago

J'ai modélisé et fait imprimer cet objet mathématique :

Post image
0 Upvotes

r/openscad • • 5d ago

Parametric boat hull in OpenSCAD

Thumbnail gallery
3 Upvotes

r/openscad • • 5d ago

OpenSCAD FAIT DES VAGUES

Post image
9 Upvotes

Oui on peut onduler assez facilement avec OpenSCAD grâce à l’instruction "rotate"_extrude et bien sur l’extraordinaire boucle "for".

Dans le modèle de la barre avec des colonnes ondulées on a utilisé un cercle ("circle") dans "rotate_extrude" et la plaque de fond de l’objet qui pourrait être une boite à savon, on utilise de la même façon l’instruction "rotate_extrude" mais avec un rectangle ("square") à la place du cercle.

module SECT1(){
rotate_extrude(angle=90,convexity=10)
translate([20,40])
circle(10);}

module SECT2(){
SECT1();
translate([0,40,0])
mirror([1,1,0])
SECT1();}

module ONDE(){
rotate([0,90,0])
rotate([0,0,45])
for(i=[0:4]){
translate([i*-40,i*40,40])
SECT2();}}

translate([-80,-10,20]) ONDE();

Trouvez de code OpenSCAD et plus d’explication sur :

https://robotix.ah-oui.org/site/main.php...

#OpenSCAD #Modelisation_3d #FabLab #Maker #Parametric_design #3D_design


r/openscad • • 6d ago

New CAD Software

0 Upvotes

Hey everyone, I'm Bruno Renostro, founder of argopower.com.br I built an AutoCAD plugin to help engineers create electrical plans following Brazilian standards. Since it got a good user base, I started looking into OEM CAD engines to turn it into a standalone software, and I found the existing options way too expensive.

So, I decided to build my own affordable CAD solution targeting developers who want to bring their ideas to life on a tight budget. That's how I started argocad.com a much cheaper alternative. It's not a fork of CADCraft, but a completely new solution from scratch, and the first CAD in the world that can run AutoCAD .NET/C# .dll plugins natively out of the box.

The perpetual license will be just $100 for end users, and the OEM solution starts at $1,000. Follow the project if you're interested I'm launching it this January.


r/openscad • • 6d ago

开发日志:高难度长桥病例

0 Upvotes

r/openscad • • 7d ago

iPad 口腔CAD 设计

0 Upvotes

r/openscad • • 8d ago

Scadly parametric model maker

0 Upvotes

Next on scadly, i added a parametric model library of common items that you can modify, and get the scad code at the end
Or if you wanna start from scratch , click start canvas


r/openscad • • 8d ago

自动化牙冠开发进度

0 Upvotes

持续更新开发进度…


r/openscad • • 8d ago

自动化牙冠开发进度

0 Upvotes

持续更新开发进度,欢迎一起来讨论学习。


r/openscad • • 9d ago

How would I go about taking a 3d model I made and converting it to openscad for parametric modeling?

Post image
3 Upvotes

I created a wedding cake topper for my own wedding, and have had numerous requests for a parametric modeler for makersworld so that others can use a similar design and font to mine, but alter the initials and change the dog face in the center. Ideas? Never worked with OpenScad before. The dogs face is layered for 3d effect. Roast me for all I care 🤣 looking for genuine suggestions. Thank you!


r/openscad • • 9d ago Bravo

I made a small CAD presentation/documentation tool to use alongside Fusion 360

Post image
0 Upvotes

r/openscad • • 9d ago

variable name as part of parameters in module call (..., varname1=n, varname2=n)

0 Upvotes

Hello,
Excuse my perhaps stupid question.
I have the following statement: module_abc(20, varname1=4, varname2=13);
What actual means the listing of (a variable name) as part of the parameter with the assignment of a value ?
e.g. varname1= and varname2=

And what are the implication I have to be aware of?
Is there perhaps somewhere a piece of documentation about it that I have missed?
Thanks for answering.


r/openscad • • 9d ago

Pourquoi coder en 3D, c'est très facile à comrendre !

0 Upvotes

Çà faisait un moment déjà que j’avais envie de comparer le codage dans OpenSCAD à la saisie directe à l’écran à l’aide de la souris. On trouve de nombreux exemples d’utilisation du logiciel de CAO Catia V5 – je fait donc une vidéo pour comparer la réalisation d’une pièce simple en écrivant du code dans OpenSCAD avec la réalisation à l’écran de la même pièce avec Catia V5.

Cette comparaison permet de comprendre le coté descriptif de OpenSCAD ou on crée des formes « cuboides » en indiquant simplement les dimensions X, Y, et Z de l’objet en millimètres, pus en le plaçant là où il correspond grâce à l’instuction « translate »

Puis « union » qui regroupe deux objets à transpercer par un cylindre, avec l’instruction « difference »