/r/openscad

Photograph via snooOG

Share news, tips and tricks, and ask questions about how to use 3D CAD modelers for programmers, such as OpenSCAD, CoffeeSCAD, and ImplicitCAD

Quick Links

/r/openscad

5,633 Subscribers

1

Can you show/hide modules?

I have a file with six or seven modules that combine to make a part via a customizer. I would like to be able to view certain modules independently, but am having trouble figuring out an efficient way to do so. I there a way to execute only certain modules, or easily comment out a whole module, or some other way to toggle what is visible in the Preview?

4 Comments
2024/11/03
00:32 UTC

3

Openscad with external editor

Hi, How I can use openscad with external editor, I want to use it with helix... Thanks in advance!

7 Comments
2024/11/02
13:03 UTC

1

GT2 8mm pulley?

I'm trying to create a model for a timing gear - specifically a GT2 8mm. I've looked around for openscad content that already fills this need, Github, Thingiverse, etc. I did find a GT2 5mm model, but when I generate that its far bigger than it should be https://github.com/rbuckland/openscad.parametric-pulley/blob/master/ I've tried to effectively rotate two sets of a cylinders around in a circle, first cylinder is the tooth at a width 1.38mm, and spacing of 1.2mm a depth of 0.76mm, the second is the gap needed to accept the tooth from the band.

I'm in the process of trying this in a linear fashion to fine tune what I've done and then rotate that around a cylinder, but I have to imagine this is a solved problem in openscad - anyone have any references? Thank you

1 Comment
2024/11/02
11:24 UTC

9

Help modeling 3D curves

I've been using OpenSCAD as a hobbyist for a few years now, so I feel comfortable with the basics. I'd like to learn to model more complex, curved shapes. For example, the knife handle in the pictures below is curved in all sorts of different ways. The trouble is I have no clue where to start. I can reproduce a 2D profile using bezier curves, but I don't know how to approach creating such a thing in three dimensions.

I don't need to exactly reproduce this particular object (though doing so would be a good learning exercise), but I'd like to understand how to even approach creating shapes such as this. Perhaps OpenSCAD isn't the best tool for the job? Thanks in advance.

https://preview.redd.it/v6dk7wqysgyd1.jpg?width=3072&format=pjpg&auto=webp&s=b0568ac556ebd446c1e2cb8944d7415aea302b8b

https://preview.redd.it/fp9q1vwvogyd1.jpg?width=4096&format=pjpg&auto=webp&s=027f941efa52ebf2b413ab33cd10e21f96ce5bef

https://preview.redd.it/amm4evwvogyd1.jpg?width=4096&format=pjpg&auto=webp&s=b82bcdc46735d41dfd6c9f953ae8240682588398

https://preview.redd.it/a92bovwvogyd1.jpg?width=4096&format=pjpg&auto=webp&s=302153aef461ed6c3d56f80fc76835f42f50bf97

https://preview.redd.it/6gh1w0xvogyd1.jpg?width=4096&format=pjpg&auto=webp&s=c533f49f8f384ba90870b947218e998fa60dae12

19 Comments
2024/11/02
10:02 UTC

3

BOSL2 paths in solidpython2

Using SolidPython2 for the first time, I love the integration with BOSL2.

However, I notive the generated file has several include several statements like this

include </Users/<MYUSERNAME>/anaconda3/envs/<ENV>/lib/python3.11/site-packages/solid2/extensions/bosl2/BOSL2/version.scad>;

Usually I import from the library location so include statements look like this

include <BOSL2/std.scad>;

Wondering if it's possible in solid2 to get this type of include statement and whether the number of includes can be reduced to just the ones that are needed vs the entire list of files

0 Comments
2024/11/01
19:58 UTC

14

Blender Python API vs OpenSCAD

I bought a 3D printer and started building models in Blender using Python API. Then I found out about OpenSCAD - never tried it. But it seems like Blender Python API is much more powerful than OpenSCAD, I am wondering if anyone has experience with both and can provide advice?

11 Comments
2024/11/01
05:22 UTC

2

Disappearance of "--enable manifold" in recent snapshots?

Im wondering if support for manifold was removed intentionally?

It did make builds extremely fast...

3 Comments
2024/10/30
05:15 UTC

2

Is something like this lampshade possible to do with openscad?

Hi there, pretty new to this

Curious if something like this was done using openscad

Link to model: https://makerworld.com/en/models/13717#profileId-13429

More images: https://i.imgur.com/LdxKXoY.png

https://i.imgur.com/zVZpvLa.png

some sort of a spiral extrude with a dynamic spiral?

4 Comments
2024/10/30
03:12 UTC

2

BOSL2 - align/attach are not working if the parent is a module ... what am I missing?

I'm trying to create an DIY camper plan to be built with aluminum extrusion. I have created modules for my extrusion pieces, but when I try to use attach or align from BOSL2 to create and align children parts, they are not created if the parent is a module. It works fine if the parent is a primitive.

The red part, is parent=primitive & children=primitive ... works fine
The purple part, is parent=primitive & children=module ... works fine
The cyan part, is parent=module & children=module ... Doesn't work
The red part, is parent=module & children=primitive ... Doesn't work

Do I need to create my module in a specific way?

https://preview.redd.it/0rmn5gpw4rxd1.png?width=2197&format=png&auto=webp&s=b75e3c8fe9e117404f26fce52aa363cb00d9e8b8

include <BOSL2/std.scad>

ext15 = 1.5;
length = 24;

module Ext1515x(length) {
    cube([length,1.5,1.5], anchor=CENTER);
}

module Ext1515y(length) {
    cube([1.5,length,1.5], anchor=CENTER);
}

module Ext1515z(length) {
    cube([1.5,1.5,length], anchor=CENTER);
}

back(5)
color("red")
cube([length, ext15, ext15], anchor=CENTER) {
  attach(TOP, BOTTOM, align=[LEFT])  cube([ext15, ext15, length], anchor=CENTER);
  attach(TOP, BOTTOM, align=[RIGHT]) cube([ext15, ext15, length], anchor=CENTER);
}

back(10)
color("purple")
cube([length, ext15, ext15], anchor=CENTER) {
  attach(TOP, BOTTOM, align=[LEFT])  Ext1515z(length);
  attach(TOP, BOTTOM, align=[RIGHT]) Ext1515z(length);
}

color("cyan")
Ext1515x(length) {
  attach(TOP, BOTTOM, align=[LEFT])  Ext1515z(length);
  attach(TOP, BOTTOM, align=[RIGHT]) Ext1515z(length);
}

fwd(5)
color("yellow")
Ext1515x(length) {
  attach(TOP, BOTTOM, align=[LEFT])  cube([ext15, ext15, length], anchor=CENTER);
  attach(TOP, BOTTOM, align=[RIGHT]) cube([ext15, ext15, length], anchor=CENTER);
}

2 Comments
2024/10/29
20:08 UTC

4

Length and angle of diagonal beam in a specific arrangement: MATH!

Hi everyone, I need a formula for calculating the length and angle of a diagonal beam arranged like so between two upright beams (cross section from FreeCAD, which easily solves this, but I want to do this in OpenSCAD):

https://preview.redd.it/zr21yfyczqxd1.jpg?width=699&format=pjpg&auto=webp&s=25d2bba1a474a9a9a1f94e8ae074580f89b6f460

The length and width of the side beams and the distance between them (blue dotted line) is given, and I need to calculate the angle of the diagonal beam and its length.

I have spent more hours on this than I'd like to admit with my limited trigonometry knowledge, and can't figure it out. Is this a hard problem or am I just missing something obvious? Please help!

19 Comments
2024/10/29
20:00 UTC

5

The OpenSCAD Customizer is more and more important for new openscad users. This model is less than 72h online. The Customizer and his features should be ranked higher on the openscad TODO list.

29 Comments
2024/10/27
09:02 UTC

3

Arm-64 Builds for Apple Silicon Macs (M1-M3)

Looks like there was work done on this but I don’t see any releases either in GitHub or elsewhere that work on Apple Silicon without requiring Rosetta Stone. Anyone figured this out? I’m not above compiling from source but I’d rather get official releases or at least a daily snapshot.

3 Comments
2024/10/26
18:05 UTC

1

Manifold missing after installing the latest nightly build.

I just installed the latest 2024.10.25 macOS and 2024.10.24 nightly builds, and noticed that rendering was 100x slower and the distance&angle interactive measuring wasn't working. It made me double-check if I have manifold enabled in "preferences->features", but I don't even see the option to enable it now.

Perhaps the option to enable it was moved to somewhere else? Or perhaps I don't see it because I installed it wrong? Or was manifold just removed entirely from these builds?

If removed, then does anyone know if permanently or if it's going to be added back in some later snapshots, and does anyone please know when exactly this happened? Just so I know which of the previous snapshots should I grab in order to get manifold back. I got really used to the cool measuring tool and the fast rendering times were also nice.

Thanks.

4 Comments
2024/10/26
17:36 UTC

5

Can OpenSCAD do NURBS?

I know silly question, I just looked at alternatives. I don't even know what they are better at and what alternatives there are.

9 Comments
2024/10/26
16:49 UTC

28

I found BOSL!!!

If you're using OpenSCAD, please take a look at BOSL library. I was switching from openscad to freecad because it was too troublesome to create some common shapes (I was creating them by "hand" and thinking I should build a library) but then I discovered BOSL and it shone a completely new light on OpenSCAD.

I'm sure there are a bunch of other amazing libraries, but this one hit the spot for me.

You can find it here: https://github.com/revarbat/BOSL

11 Comments
2024/10/26
10:43 UTC

0

how can i do this in openscad?

using chatgpt i got this code:

// Dimensions in mm

cylinder_diameter = 4 * 25.4; // 4 inches in mm

cylinder_height = 4 * 25.4; // 4 inches in mm

rib_count = 50; // Number of vertical ribs

rib_width = 50; // Width of each rib in mm

rib_depth = 3; // Height/Depth of each rib in mm

// Main Function to Create Ribbed Cylinder

module ribbed_cylinder() {

union() {

// Base cylinder

cylinder(d = cylinder_diameter, h = cylinder_height, $fn = 200);

// Loop to create ribs around the cylinder

for (i = [0 : 360 / rib_count : 360]) {

rotate([0, 0, i])

translate([cylinder_diameter / 2 - rib_depth, 0, cylinder_height / 2]) // Adjusted Z translation to match the height of the cylinder

cube([rib_depth, rib_width, cylinder_height], center = true);

}

}

}

// Render the Ribbed Cylinder

ribbed_cylinder();

but am not able to get the results as in the picture i have shared.

https://preview.redd.it/b6avwcpekywd1.jpg?width=178&format=pjpg&auto=webp&s=55bea6e9ba6a42cc7f30dbd440eaea80f3cf85a9

11 Comments
2024/10/25
19:59 UTC

7

Where do people prefer to download/share models and .scad files for 3d printing these days?

It seems like thingiverse is dying and I'm wondering where everyone is going to. Where do you share your stuff?

16 Comments
2024/10/24
22:29 UTC

6

abused openscad

Abused openscad to use it as a simple print cost calculator:

https://makerworld.com/en/models/724437#profileId-658304

What do you think about the coding style?
Trying to figure out a clean reader friendly way.

Would it be cool to have a kind of coding style guide for openscad as we have for other languages?

5 Comments
2024/10/24
08:09 UTC

7

Help making a rounded triangle

I need to make a rounded triangle with rounded sides. I found an example here https://www.stkent.com/2018/04/06/really-rounded-polygons.html the bottom one where it says 500px. I've been trying to convert that code, but am stuck on plotting the points. Wanted to see if anyone could help.

29 Comments
2024/10/22
21:00 UTC

2

Import() SVG Metrics?

Is there a way to algorithmically extract the bounding box information for SVG icons / STL's we import()? Textmetrics has been invaluable for rescaling a bunch of projects I've done, and it would be awesome if there was a way to extend that to paths/geometry.

8 Comments
2024/10/21
22:32 UTC

1

file exists, but no code

Hi all,

Yesterday I tested printed a design I made in Openscad.

Today, when I try to open the file in openscad, A) it no longer shows up in my recent file list and B) when I try to open it by navigating to the file location, my Editor is empty except for "OpenSCAD Model".

There should be about 60? lines of code--I'm not sure but it's not a huge file. The file itself has about 18 Kilobytes of information.

I'm on a linux machine (linux mint).

Maybe the problem is that I saved my files in project directory and Openscad doesn't like that?

But still, I can navigate to the file and open it with openscad but the code isn't shown.

Any advice is appreciated.

15 Comments
2024/10/21
17:15 UTC

5

Possible to draw a line in OpenSCAD? I.e. somehow convert a polyline + line width into a polygon or something?

Say I want to build a model that has a diagram on top. (Maybe extruded, maybe embossed, haven't decided yet.) The diagram is basically a few lines, or a polyline. Is there some sort of way that I can feed the points list plus a line width into some kind of function and make a 2-d shape that can be extruded?

A little googling shows that Minkowski sum could do it, but in OpenSCAD that operates on two polygons.

8 Comments
2024/10/21
17:12 UTC

1

Using the search function

I can't seem to wrap my head around the search function and could use some help. Let's say I have a matrix like so:

array = [
          ["A",[1,"Foo"]],
          ["B",[2,"Bar"]]
        ];

And I want to search for index B. Would this be the correct search?

echo(search("B",array, index_col_num=0));

And if so, how do I interpret the results?

I know that BOSL2 has the structs code but everytime I add BOSL2 I end up with missing value errors.

6 Comments
2024/10/21
12:37 UTC

1

Splines or Arcs in Polygon?

As a G-code enthusiast, being able to make arcs with a G2/G3 within an otherwise straight path is pretty convenient. With how powerful the polygon command is, significantly complex shapes would be much easier if radii or other arc-based geometry could be added inline with the array of points. Are there ways of doing this?

Similarly, splines through control points would offer similar utility, but I have had trouble finding good information on either

19 Comments
2024/10/19
22:38 UTC

10

Trying to make a Hexagon (noob)

I've been playing with this for 2 hours. I have a shape, and eventually I want to fill it with hexagons. But before I get to that, I want to make a hexagon.

I cannot for the life of me get this to show up. I've tried F5, I've tried F6. I'm confident I'm missing something, I just don't know what. Advise me please.

hex=[[0,5],[5,0],[10,0],[15,5],[10,10],[5,10]];

p=[0,1,2,3,4,5,0];

polygon(hex,p,10);

https://preview.redd.it/u5xiix2gqqvd1.png?width=1198&format=png&auto=webp&s=cf68b38317c040fcda9dd7320af5a7875d36d4aa

28 Comments
2024/10/19
16:39 UTC

2

Trying for a simple cylinder (pencil box) with 35cm in length with 14cm diameter and atleast 2cm reinforced screw joint in the middle. To hold my posters !!

Started to write code for this but have been not able to proceed in right direction !!

$fn = 100; // Increase resolution of the cylinder

module pencil_box() { // Main body of the pencil box difference() { cylinder(h = 35, d = 14, center = true); translate([0, 0, -2]) cylinder(h = 39, d = 12, center = true); // Hollow inside } }

// Screw joint part module screw_joint() { translate([0, 0, 0]) cylinder(h = 2, d = 14); translate([0, 0, 1]) cylinder(h = 2, d = 12); }

// Assembling the pencil box with screw joint translate([0, 0, -17.5]) pencil_box(); translate([0, 0, -2]) screw_joint(); translate([0, 0, 17.5]) pencil_box(); translate([0, 0, 15.5]) screw_joint();

6 Comments
2024/10/19
08:30 UTC

2

Career change to CAD advice

Hey everyone,

I’m looking for some advice on transitioning from 3D generalist modeling to CAD design. I went to school for digital media, focusing on 3D modeling within the games/animation industry. However, after completing a AAA games internship last summer and now working in my current role, I’ve realized that it’s not quite the right fit for me. I find myself increasingly interested in themed entertainment and I think CAD would be a good segway that is similar enough to what I've done previously to now work towards.

I’m curious about the recommended steps for making this transition. Would I need to go back to school for formal training in CAD (thinking of possibly doing an associates in a community college while I work full time), or are there alternative pathways to breaking into the field? I’ve been researching on my own, but I’d love to hear from those who have made similar career shifts or have experience in CAD.

Thanks in advance

3 Comments
2024/10/17
16:08 UTC

2

OpenSCAD in Manjaro Linux will not follow symbolic links (or even list them)

Version OpenSCAD version 2021.01

All of my work is on a separately mounted partition with symbolic links. OpenSCAD does not even show the links.

If I navigate to the file and right-click -> Open with OpenSCAD, errors and it won't open.

12 Comments
2024/10/16
10:59 UTC

1

Help creating simple Gridfinity baseplate - applyUnion3D CGAL ERROR

I'm trying to add gridfinity to my project, but for some strange reason, this code is giving me a CGAL ERROR for assertion violation. Any ideas why this would be happening?

CODE:

difference()  {
        cube(size = [42,42,4.65]);
        //gridfinity base profile
          translate(v = [4,38,5.6]) 
                rotate(a = [180,0,0]) 
                    minkowski() {
                        rotate_extrude($fn=50) 
                            polygon(points = [[0,0],[4,0],[3.3,0.7],[3.3,2.5],[1.15,4.65],[0,4.65]]);
                        cube(size = [34,34,1]);
                    }
}

Error:

ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion violation!

Expr: itl != it->second.end()

File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_external_structure.h

Line: 1150

https://preview.redd.it/mgxewusvi1vd1.png?width=795&format=png&auto=webp&s=47921f12394b29556a1f4e3282062ebe6a339104

https://preview.redd.it/1296yhhui1vd1.png?width=874&format=png&auto=webp&s=1aec2274edfc894b2231648fe79a0c7f5ca003b0

5 Comments
2024/10/16
03:52 UTC

Back To Top