/r/openscad
Share news, tips and tricks, and ask questions about how to use 3D CAD modelers for programmers, such as OpenSCAD, CoffeeSCAD, and ImplicitCAD
/r/openscad
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?
Hi, How I can use openscad with external editor, I want to use it with helix... Thanks in advance!
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
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.
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
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?
Im wondering if support for manifold was removed intentionally?
It did make builds extremely fast...
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?
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?
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);
}
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):
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!
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.
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.
I know silly question, I just looked at alternatives. I don't even know what they are better at and what alternatives there are.
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
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.
It seems like thingiverse is dying and I'm wondering where everyone is going to. Where do you share your stuff?
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?
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.
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.
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.
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.
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.
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
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);
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();
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
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.
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