Skip to main content
14 votes
Accepted

How to prevent z-fighting in OpenSCAD?

The general advice in the OpenSCAD community is to "extend your cuts and embed your joins" (source). The rendering artifacts are one thing but rather just an annoyance; however z-fighting can also ...
tanius's user avatar
  • 413
11 votes
Accepted

OpenSCAD can't render union of two polyhedrons, but can preview just fine

This is a case of "Mis-ordered faces". That means the order in which the vertices making up one or more faces aren't in the correct order. The vertices of a face should be listed in ...
nc404's user avatar
  • 281
10 votes

Can the `render` function be used to speed up rendering?

First a disclaimer: I am far from an expert on the subject, I'm just a regular Joe who happens to use OpenSCAD and have done some experimentation with it. I believe the answer below to be correct, ...
mac's user avatar
  • 4,775
8 votes

Is there an easy way to split models in OpenSCAD?

Rather than differencing a copy of the object from itself, which is subject to numerical instability, choose a box ("cube" in OpenSCAD terminology), and intersect it with one copy of the object, then ...
R.. GitHub STOP HELPING ICE's user avatar
8 votes
Accepted

Why is 2 / -2 / 2 equal to -2 in OpenSCAD? (Mathematical Order of Operations)

I suspect the behavior you are seeing is an undocumented feature (aka, bug) of OpenSCAD. I've found in the latest stable release that if the - is placed on either end, the result is -0.5, but in the ...
fred_dot_u's user avatar
7 votes

Are there any "best" or at least "common" practices to handle allowances in OpenSCAD code?

It helps to understand the different aspects of dimensions, so you can use the terminology correctly. This will help you define your variables in OpenSCAD with correct names. (Tolerance is the wrong ...
John Deters's user avatar
7 votes
Accepted

OpenSCAD ERROR: Current top level object is not a 2D object

Use the projection() feature of OpenSCAD to effectively generate a plane cut. Position the cube structure in such a manner that the x/y plane intersects the desired shape to be exported. Rendering the ...
fred_dot_u's user avatar
6 votes

OpenSCAD linear_extrude from multiple path svg import

Lame solution: creating stepped pyramid with offset. I realized that scale will not worked for motives with holes inside. Offset seems then more appropriate than scale for my application (creation of ...
Oneira's user avatar
  • 211
6 votes
Accepted

What is the operator precedence in OpenSCAD?

Within OpenSCAD expressions, the order of precedence is: Operators Description () [] group, vector, or range () [] . function call, indexing, member lookup ^ exponentiation ! + - unary operations ...
Curt's user avatar
  • 176
5 votes

OpenSCAD library for empty space/holes

I'm not aware of libraries that do that for you (but you can create your own, see end of the answer), but creating a relieve hole pattern is not that difficult or tedious using iterator functions (e.g....
0scar's user avatar
  • 37.1k
4 votes

Why is 2 / -2 / 2 equal to -2 in OpenSCAD? (Mathematical Order of Operations)

I filed this issue as a bug with the OpenSCAD project, and there is now a fix merged into master, as well as a test case to prevent regression. The latest nightly builds should handle this correctly ...
Joel Coehoorn's user avatar
4 votes

OpenSCAD 2018 Command line

You can specify variable values from command line using: openscad ...\ ... \ [ -D var=val [..] ] \ ... \ ... \ filename See the ...
Bouc's user avatar
  • 41
4 votes

Creating "pie slice" in OpenSCAD?

This is what I use: module pieSlice(a, r, h){ // a:angle, r:radius, h:height rotate_extrude(angle=a) square([r,h]); } pieSlice(110,20,3);
CFreitas's user avatar
  • 141
4 votes

OpenSCAD weirdness with imported STL

I see you've accepted cmm's answer, but I'd still like to take a stab at the mechanism of the failure based on your comment on it: Excellent explanation, thanks. The "WTH" cylinder is centered on ...
R.. GitHub STOP HELPING ICE's user avatar
4 votes
Accepted

OpenSCAD not rendering polyhedron

Usually when there's an overlap in two objects during a difference action, F6 render will resolve the problem. There's something more than that involved here, as reducing the height of the cube ...
fred_dot_u's user avatar
4 votes
Accepted

Why does OpenSCAD fail to cut holes in polygon sides that are exactly the width of the wall?

openSCAD simply allows having surface solutions that result in a wall of 0 thickness. The walls appear to clip in those areas and can at times be seen from both sides, like in your example: A 0 ...
Trish's user avatar
  • 22.5k
4 votes
Accepted

Can OpenSCAD bend text (project it on curved surface)?

another way may be a simple intersection() (inspired by this discussion: How to a make a curved sheet (cube) in OpenSCAD?) ...
julien's user avatar
  • 56
3 votes

Spiral bevel gears in OpenSCAD

I read this question a few months ago, and thought I knew what you wanted. Re-reading it now confuses me a little. But, I think you may be asking for a large, flat surface with a spiral in it, like ...
cmm's user avatar
  • 4,591
3 votes
Accepted

How to remove internal part of a hex grid

I ended up finding a reasonable solution myself: Basically, I diffed two identical, non-hollow geometries, in which the first one had the cells larger than they needed to be (so overlapping with ...
mac's user avatar
  • 4,775
3 votes

OpenSCAD "not valid 2-manifold" useful information

Occasionally, a model created in OpenSCAD will have, as you suggest, overlapping segments. Often enough, this will generate the message you receive. OpenSCAD has an implied union function when it ...
fred_dot_u's user avatar
3 votes
Accepted

OpenSCAD 2018 Command line

I could finally solve the issue. Calling openscad from command line with parameters does NOT work with the AppImage I used. It works fine with a "standard" ...
Hermann Gebhard's user avatar
3 votes
Accepted

Is there a technique for turning an image into a 2d model?

As you are already familiar with OpenSCAD, consider to use the projection() function to accomplish your goal. If you allow for an interpretation that one can cast a shadow of the part on a surface ...
fred_dot_u's user avatar
3 votes
Accepted

.STEP/.F3D to .SCAD file?

Even though OpenSCAD can import a variety of formats, the file structure will not be accepted by Thingiverse in the manner presented by the OP. OpenSCAD is a text-based description language. One ...
fred_dot_u's user avatar
3 votes

.STEP/.F3D to .SCAD file?

Actually there's a solution, albeit not directly from within openscad. I've just found this: https://github.com/agordon/openscad-step-reader/tree/master You will need to install or build yourself ...
calocedrus's user avatar
3 votes
Accepted

How to combine difference with concatinate object

The union syntax addresses this: ...
dan sawyer's user avatar
3 votes

OpenSCAD render (F6) fails with "ERROR: CGAL error in CGAL_Nef_polyhedron3()"

Reading between the lines on other forums, I found that the GCAL renderer will render a malformed object, but it will fail when a binary operator, such as union or intersection, is applied to that ...
cmm's user avatar
  • 4,591
3 votes

Can OpenSCAD bend text (project it on curved surface)?

I can't say if this is better than your method, but it is a library resource specific to your requirements. Text_on OpenSCAD The library covers various shapes, including cylindrical: Image from ...
fred_dot_u's user avatar
3 votes

Print Object Without Top Layer But With Intermediate Layers

I just confirmed it works flawlessly in PrusaSlicer as it did in Slic3r, the software from which PrusaSlicer is forked. Just use the solution provided in "Different infill in the same part", ...
0scar's user avatar
  • 37.1k
3 votes

Cut a Möbius strip in four parts with interlocking

Cutting to pieces To cut the ring into pieces you can take the intersection() of the object and the quadrant of interest (e.g. using a cube, but a wedge would have worked as well). ...
0scar's user avatar
  • 37.1k
2 votes
Accepted

Handing OpenSCAD module parameters derived from other variables

This seems to be a limitation of the language. One workaround that's only moderately ugly is, in the body of the module: ...
R.. GitHub STOP HELPING ICE's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible