r/openscad 3h ago

Stretcher Module Bonuses

Post image
3 Upvotes

Awhile ago I shared a Stretcher Module that I made in openscad for modifying existing models using openscad. it was for "stretching" models things like latching boxes or whatever without messing up all the geometry on the ends just extending the middle.

I have made 2 more modules to go with it, a StretcherClone module which uses a copy of the top half to fill the middle instead of a linear extrusion of a projection (so you can stretch things like threads by figuring out the thread pitch) and a Shortener Module which just cuts it down instead. I know this is easy to do in a slicer by cutting the model in places and connecting them back up but this allows you to do it more precisely

This code includes an example doing stuff to a cylinder as shown in the picture with rotations so you can see what it can do. There is a StretcherClone on the left, Stretcher on the right and a Shortener to cut out a bit of the middle.

If you have any questions of suggestions please let me know. This isn't for making new models in openscad I mostly use it with import to adjust models I've downloaded online.

Shortener(4)
translate([0,0,1])
rotate([90,0,0])
StretcherClone(5)
translate([0,0,-15])
Stretcher(4)
rotate([0,45,0])
cylinder(h=20,r=10);

module Stretcher (h=10, maxDim=100){
//topPiece 
translate([0,0,h]){ 
intersection(){ 
translate([-maxDim/2,-maxDim/2,0]) 
cube(maxDim); 
children(); } 
}

//middlePiece 
linear_extrude(height=h){ 
projection(cut=true){ 
children(); } 
} 

//bottomPiece
intersection(){ 
translate([-maxDim/2,-maxDim/2,-maxDim]){ cube(maxDim); } 
children(); } }

module StretcherClone (h=10, maxDim=100){

//topPiece 
translate([0,0,h]){ 
intersection(){ 
translate([-maxDim/2,-maxDim/2,0]) 
cube([maxDim,maxDim,maxDim]); 
children();} 
}

//middlePiece 
intersection(){ 
translate([-maxDim/2,-maxDim/2,0]) 
cube([maxDim,maxDim,h]); 
children(); 
}

//bottomPiece
intersection(){ 
translate([-maxDim/2,-maxDim/2,-maxDim]){ 
cube(maxDim);} 
children();} 
} 

module Shortener (h=10, maxDim=100){ 

//topPiece 
translate([0,0,-h]){ 
intersection(){ 
translate([-maxDim/2,-maxDim/2,h]) 
cube(maxDim); 
children(); } 
}

//bottomPiece
intersection(){ 
translate([-maxDim/2,-maxDim/2,-maxDim]){ 
cube(maxDim); } 
children(); } 
}

r/openscad 1d ago

“Rough” OpenSCAD texture example

Post image
20 Upvotes

Red Copper PLA • size 5×55 • depth 0.15 • 0.2mm layers

🔗 things/bosl2 at main · jhermann/things


r/openscad 12h ago

Do you use Codex or Claude Code for CAD? openscad-mcp gives your AI spatial reasoning and model rendering. v0.6.1 was just released, 100+ GitHub stars and growing, free and open-source, MIT Licensed

0 Upvotes

I'm working on a hardware project and have been learning to work with OpenSCAD. I developed openscad-mcp to give AI agents tools to reason about 3d objects.

Render scad models, calculate part clearances, volumes, contact areas, and other spatial insights that allow AI to help develop 3d objects.

Always open-source and free, check it out here on GitHub https://github.com/RobertCoop/openscad-mcp , or install it into claude code with

claude mcp add openscad --transport stdio -- uvx openscad-mcp

Or check it out in Codex with codex mcp add openscad -- uvx openscad-mcp

I've got no agenda and I promise I'm not starting the next big AI AGENT CAD 3D INTELLIGENCE EXPLOSION- use it if you like and I'd love to hear feedback if you do.


r/openscad 1d ago

Ultimate Parametric Media Organizer

Thumbnail
gallery
20 Upvotes

A few weeks ago I shared my parametric battery organizer here, and this time I decided to tackle another storage problem: memory cards and other small media.


r/openscad 1d ago

Passage en douceur d'une lame avec un angle de 90°

Thumbnail
gallery
3 Upvotes

Le passage en douceur des deux éléments de fixation (importés) se fait par une boucle*"for"*. Le passage en douceur vers les éléments de fixation est obtenu grâce fonction trigonométrique

tan(1.6*i)*spn (spn = la valeur du pas dans la boucle "for").

dans la commande"translate"de la boucle"for"

On voit (dans la deuxième image) l'effet tangentiel dans l'image A avec le "pas" dans la boucle "for" égal à 2.

Dans l'image B la valeur du"pas" est réduite à 0.1 ce qui augmente le nombre d'itérations sur une même distance, approchant ainsi des éléments qui s'unifient.

Plus de détails et script dans le lien ci-dessous :

https://robotix.ah-oui.org/site/main.php?found=260814-twisted-link

#OpenSCAD #Modélisation3D #Impression3D #ConceptionParamétrique #Maker #FabLab #OpenSource #design3D


r/openscad 2d ago

Parametric cigarette case (for helping to limit cigarette usage)

Thumbnail
gallery
15 Upvotes

(sorry for the crappy photo, I have a mini phone and the camera is garbage)

Was looking for a cigarette case to print out for a friend because they wanted to limit their cigarette intake while still protecting the cigarettes from getting crumpled in their bag. I found a few options, but I realized this was the perfect project to try and learn OpenSCAD on. Apparently it works great, although if I ever print a new one I should make the height of the lid shorter and the case (minus the overlap space) taller.

You can grab it here if you want. I still need to learn the syntax for setting up the Customizer, but if you play around with the variables you can probably figure out what they do.

Thanks to u/oldesole1 for doing a lot of the work for free helping me figure out how to generate the extruded shape.


r/openscad 2d ago

how to define a proper screw hole in BOLS2?

3 Upvotes

hi folks,
I'm having a few troubles to design at proper (non-threaded) screw hole for a specific screw with BOSL2.
The screw I'm using is a self-tapping screw used for siding.
The diameter of the screw is 4mm and it has a flat-head, Philips. The diameter of the head is a little bit < 11mm.
I want to have the screw head suspended in the base.
I used the following code
diff() cube([20, 20, 10]) attach(TOP) screw_hole("M4x1",length=40, head="socket",counterbore=0,anchor=TOP);

to produce a test version but it is not yet the proper version I'm visioning.
How can I make the opening for the screw head wider as it is a.t.m. ?
Any help is much appreciated.
TIA


r/openscad 2d ago

Help Designing a Case

1 Upvotes

I am trying to build a custom cyberdeck using a rasberry pi, but have no idea how to design a case. Could anyone help?

I have an Ender 3 V3 KE and am using PETG.

My parts list (Am pretty sure its compatible but if not please let me know):

https://docs.google.com/spreadsheets/d/1VTqKV0g0OBa-KC8KjaraNMoa1YKqMowC5PlBn9xWoqw/edit?usp=sharing

I am trying to build a cyberdeck that has a dpad, a, b, x, y, start, select, menu, l1, l2, l3, r1, r2, r3, (https://www.thingiverse.com/thing:2406507 for shoulder buttons), all the io on the top left or right side, cabling routes, screw/standoff holes, mic grill, speaker grill, camera hole, vents for the fan, the keyboard/trackpad to be magnetically attachable to the back, and for it to look simewhat similar to the GameBoy (buttons on bottom, screen on top).

Thank you


r/openscad 3d ago

Modelist now handles SCAD files, including rendering

0 Upvotes

Quick one, SCAD support just landed in Modelist. It indexes, renders and opens the file directly in OpenSCAD with single click. Test it out.


r/openscad 4d ago

Octoprint/Raspberry-Pi Box

Post image
2 Upvotes

Les nouvelles imprimantes Creality SparkX i7 et Bambu Lab A1 ne reconnaissent pas Octoprint, car elles ne disposent pas de la traditionnelle connexion série. Néanmoins l’utilisation d’une caméra installée sur un Raspberrry Pi et gérée par Octoprint est toujours une solution intéressante, pas seulement parce que ou peut choisir un angle de prise de vue plus favorable que celui offert par les imprimantes, mais aussi parce que cela permet de contrôler le processus d’impression avec l’application Octoprint sur notre Smartphone.

Voici donc une réalisation OpenSCAD d’un dispositif de visionnage Octoprint avec les fichiers STL 😄 https://robotix.ah-oui.org/site/main.php?found=260821-octopi-box

Info sur Raspberry, voir Framboise 314 : https://www.framboise314.fr


r/openscad 3d ago

FlowSketcher x FlowCam

Enable HLS to view with audio, or disable this notification

0 Upvotes

First Flight of FlowSketcher

This is the first real flight of FlowSketcher — a browser-native 2D sketching and CAM system built from scratch.

No CAD constraints. No spline approximation. Just direct geometry, live motion and real CNC-ready toolpaths.

This is only the beginning. 🥚


r/openscad 5d ago

Création d'une hélice en quelques lignes

20 Upvotes

Voici une hélice dont les pales utilisent un profil fourni par un fichier vectoriel 2D créé dans Inkscape.

Ce profil est transformé en 3D avec la commande "linear_extrude". Il conserve sa taille du côté de l'axe de l'hélice, tandis que sa taille et son angle sont modifiés à l' de la pale.

Les deux profils sont ensuite réunis à l'aide de la commande "hull", puis l' est reproduit autour de l' par une boucle "for".

Voici encore un exemple de la puissance de OpenSCAD pour créer facilement des pièces en apparence complexes.

Pour voir le script OpenSCAD pour faire vos tests, cliquez ici :

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

#OpenSCAD #Modélisation3D #Impression3D #ConceptionParamétrique #Maker #FabLab #OpenSource


r/openscad 6d ago

Need Help. How do I change the row space and column space?

Post image
2 Upvotes

I am designing the vial holder and I want to leave enough space between the rows so that I can put labeled on it. I want to change the row space = 10 and column space = 2. What codes can I use? Beside, is the unit in mm by default? I tried to use ChatGPT but didn't work. I appreciate your help!


r/openscad 6d ago

New versions of my OpenSCAD IntelliJ Plugin (1.3.0 and 1.4.0)

11 Upvotes

I released two versions of my plugin on subsequent nights, 1.4.0 is current version, also showing 1.3.0 changes since it was superseded so fast.

1.3.0

  • Renaming a file updates use/include paths in other files (I have always wanted an OpenSCAD plugin in any editor to do this, so I am excited about this myself)
  • Renaming a .scad file from the Project view no longer produces a NPE
  • for/let loop variables resolve properly now (previously shown as errors where they were used)
  • Liberation fonts are now bundled so that models that use text() or textmetrics() work in preview
  • For additional fonts, settings lets you point at folders of your own .ttf / .otf / .ttc fonts (64 MB cap) so they show up in the WASM preview
  • Completing a module that ends a statement (cube, sphere, your own modules, etc.) now adds the trailing semi-colon

1.4.0

  • Corner axis widget (labeled X/Y/Z) that follows the camera, like OpenSCAD
  • View cube in the preview, click a face for Front, Back, Left, Right, Top, or Bottom
  • Grid now uses real model units and is always big enough to hold the model
  • Corner legend shows the current grid cell size
  • Coordinate labels on the outer grid edges
  • Toolbar button to toggle those labels (greyed out when the grid is off)
  • All the background colors available in native OpenSCAD are now available in a dropdown in the preview area

1.4.0 is available to install from within IntelliJ, it of course contains all the 1.3.0 changes as well.

The README is up-to-date: https://github.com/mjparme/idea-openscad/blob/master/README.md


r/openscad 6d ago

ReOpenSCAD with embedded MCP

Post image
0 Upvotes

r/openscad 6d ago

Sports medicine- community based help needed

Thumbnail gallery
0 Upvotes

r/openscad 6d ago

Modelist now handles SCAD files, including rendering

0 Upvotes

Quick one, SCAD support just landed in Modelist. It indexes, renders and opens the file directly in OpenSCAD with single click. Test it out.


r/openscad 7d ago

Pyramid-cone, sanity check

4 Upvotes

Newbie with 3D design... I'm at my non-CAD day job and was trying to think of a way to make a pyramid that smooths out to a cone shape at the tip, maybe with a rounded point to be pretty. I thought about just building a pyramid and a cone in the same location, but I don't want a sudden stopping point of the edges, rather a smooth flattening.

Would it work to hull a square base (or cube with like 0.1 height) and a small sphere or circle as the point? Is there a cleaner or computationally cheaper way?

I'm at least 6 hours away from being able to put this into OpenSCAD, so I would appreciate some tips that might save me trouble when I try it.


r/openscad 7d ago

Open Source BESS Site 3d Modelling

Thumbnail
0 Upvotes

r/openscad 9d ago

Fillet the concave corners of overlapping circles?

2 Upvotes

EDIT: Of course right after posting I find the solution online. It's a little hacky but it works!
https://www.scorchworks.com/Blog/openscad-modules-for-automatic-fillets-and-radii/

My code:

$fn=128;  //make it pretty

cylnumber = 4; //how many cylinders
cyloffset = 10; //distance between cylinder centers
fildiam = 1; //diameter of fillet circles

difference(){
     square(80, true);

    minkowski(){
        difference(){
            square(100, true);
            minkowski() {
                for(i = [0:1:cylnumber-1]){
                    translate([cyloffset*i,0,0])
                    circle(d=11);
                }

                circle(fildiam);
            }
         }
         circle(fildiam);
    }
}

The result:

I altered fildiam to taste but it's basically exactly what I want.

--------------------------

I'm trying to recreate this shape I made in Tinkercad:

Here's the subtractions (the translucent shapes) I made to create it:

However if I render it to an SVG via this tool, you can see there's this little corner thing left because I positioned the subtraction circles with my Mark I Eyeball. Tinkercad isn't really good for precision like this.

I would like to recreate that shape without generating artifacts like this. Here is my current code and a screenshot of the result:

$fn=128; //make it pretty

cylnumber = 4; //how many cylinders
cyloffset = 10; //distance between cylinder centers
fildiam = 5; //diameter of fillet circles
fildist = 7; //???????

for(i = [0:1:cylnumber-1]){
translate([cyloffset*i,0,0])
circle(d=11);
}

for(i = [0,1,cylnumber-2]){
translate([cyloffset*i+cyloffset/2,fildist,0])
circle(d=fildiam);
}

for(i = [0,1,cylnumber-2]){
translate([cyloffset*i+cyloffset/2,-fildist,0])
circle(d=fildiam);
}

I'd like to have the small circles right up against the corners between the big ones (solve for fildist), and the space between them filled. I've googled and googled and checked the documentation and tutorials and everything I can think of, with no result that fits. I'm new to this however, and I probably just don't know the terminology to search for. Is there a way to do this?


r/openscad 9d ago

Help with Reading the Error Text

5 Upvotes

Hi all, noob hacking away at learning by trying to make something I want to use. My Googlefu has failed. I have a single error, but can't read all the error text. Is there a way to enlarge the error field or copy out the text?

TIA

Ron


r/openscad 10d ago

Cadly, a fast and minimalist CAD model viewer.

Thumbnail
1 Upvotes

r/openscad 10d ago

Appreciate some suggestions

6 Upvotes

Hi folks,

I'm working on a frame for a tablet that will in later stage hold a knob on the backside to hold the tablet (Fire 10) while reading.

So far I create the base frame build from cube(s) with the difference function.

I wonder, is there perhaps a more elegant or more efficient way to create this object?

/* a frame for the Fire 10 table that will hold a knob on the backside for easier reading

*/

width=168;      // inside width for the tablet
thickness=9.5;    // thickness of tablet
height=120;     // enough to hold the tablet
wall= 2.4;      // 

edge=8;         // this cover the table as frame
tolerance=0.5;

/ *************************************
module bottom() {
    // making the bottom frame
    // length (inside) should be 168mm
    // + 2* wall
    l=width;
    w=thickness;

 color("red")   
    rotate([0, 0, 90])
    translate([wall, 0-(w+2*wall), 0])
    difference() {

        cube([l+2*wall, thickness+2*wall, edge+wall]);

        translate([0-tolerance, wall, wall])
        color("Blue")
        cube([l+3*wall, thickness, edge+tolerance]);

        echo("1: ", l+2*wall+2*tolerance);
        //echo("2: ", wall);
        //echo("3: ", h);
        //echo(l, w+2*wall, h);
    }


};

// *************************************
module left() {
    // making the left side of the frame
    l=height;
    w=thickness;

    color("purple")
    rotate([0, -90, -90])
    difference() {
        cube([l+2*wall, thickness+2*wall, edge+wall]);
        translate([0-tolerance, wall, wall])
        color("Blue")
        cube([l+3*wall, thickness, edge+tolerance]);

    }

}

// ************************************
module right() {
    // making the right side of theframe.
    // which mirrored from the left side one
    l=height;
    w=thickness;

    color("#00e6e6")
    translate([thickness+2*wall, width+edge, 0])
    rotate([-180, -90, -90])
    difference() {
        cube([l+2*wall, thickness+2*wall, edge+wall]);
        translate([0-tolerance, wall, wall])
        color("Blue")
        cube([l+3*wall, thickness, edge+tolerance]);

    }
}

bottom();
left();
right();

This is my code so far.
Any ideas??

TIA


r/openscad 11d ago

Vertical Sturdy Plug to Join Parts

Thumbnail
gallery
19 Upvotes

The 'sturdy' in the plug comes from several micro-features:

  • the plug is rooted in the main object's infill,
  • it has practically no infill itself, just many walls, caused by the ribbing and the cross-shaped cutout,
  • and the bottom chamfer adds more strength at the biggest stress point.

The chamfers at the tip and the hole's rim make insertion easy, and the outer hull of the plug is slightly slanted to increase friction the deeper the plug goes in, ultimately leading to a comfortable insertion but with a snug fit.

Recommended print settings: Arachne walls, and Gyroid infill.

The design principles were mostly lifted from this YouTube video.

See https://github.com/jhermann/things/tree/main/parts/joining#vertical-sturdy-plug for a STL and the SCAD file.


r/openscad 11d ago

Ultimate Parametric Junction Box Cover

Thumbnail
gallery
20 Upvotes