Questions tagged [openscad]

Questions related to the use of the program OpenSCAD and how it relates to creating parts for 3D printing

OpenSCAD is software for creating solid 3D CAD models. It is free software and available for Linux/UNIX, Windows and macOS. Unlike most free software for creating 3D models (such as Blender) it does not focus on the artistic aspects of 3D modelling but instead on the CAD aspects. More details here.

40 questions
9
votes
1 answer

How to prevent z-fighting in OpenSCAD?

Z-fighting is a 3D rendering artifact of coplanar surfaces (means, of triangles located in exactly the same plane and overlapping each other). It can happen in OpenSCAD's preview mode when doing a difference() or union() operation. In case of…
tanius
  • 303
  • 2
  • 10
8
votes
3 answers

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

I'm designing a few mechanisms with OpenSCAD, and one of the parameters that need adjustment between printers/filaments is allowances between pieces that need to be assembled together (for example, if I want a "5 mm diameter pin" to fasten two…
mac
  • 4,557
  • 1
  • 12
  • 35
6
votes
1 answer

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

I am running into what honestly seems like a bug in OpenSCAD, but I can't believe that something so simple could reveal a bug. I am trying to render the following code: module tri_prism(base1, base2) { polyhedron([ base1[0], base1[1],…
nc404
  • 141
  • 5
5
votes
1 answer

OpenSCAD library for empty space/holes

I am working on a design in OpenSCAD, and need (would want) two things that seem tedious to hand-code: A pattern of holes in a wall, for less weight/material. Could be round holes or some geometric pattern. Empty enclosed space, with some…
Tomas By
  • 509
  • 4
  • 19
5
votes
1 answer

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

I am designing a moderately complicated piece in OpenScad. It renders fast enough in preview mode (1s). But when i do a full render so I can export to STL, it takes ages (In the 10s of minutes) I have read that sometimes the function render is…
5
votes
3 answers

Creating "pie slice" in OpenSCAD?

When making a cylinder, sometimes I need to only take a pie slice. I'm currently using this neat trick to make pie slices for angles under 90 degrees. However, I have need of a few angles over 90 but under 180 degrees. Is there a way to…
Hamy
  • 223
  • 2
  • 6
4
votes
2 answers

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

Recently I have been doing more complicated math in OpenSCAD and I have run into something that I find strange. Take a simple math expression: 2 / 2 / 2. By any programming language this will equal 0.5 (1/2), and OpenSCAD agrees. Something like…
Elijah
  • 43
  • 3
4
votes
2 answers

How to remove internal part of a hex grid

I am modelling a few cut templates to be used on an hexagonal grid (honeycomb) material using OpenSCAD. Basically, from a reference cell, I need to select all cells that are within a given range and given angle. I implemented this by creating an in…
mac
  • 4,557
  • 1
  • 12
  • 35
4
votes
1 answer

Cut a Möbius strip in four parts with interlocking

I'm a beginner with OpenSCAD. I use to work with Rhino, but I have no more license and the new Fablab I'm working with uses OpenSCAD, so I'm learning OpenSCAD now. The picture below shows what I want to do, I need this to be able to 3D print several…
4
votes
1 answer

What is the operator precedence in OpenSCAD?

OpenSCAD User Manual's section on operators does not mention precedence. Quick Web searches found nothing. I assume the usual order of exponentiation, then multiplication, then addition does hold, but how does e.g. a conditional operator or unary…
user31389
  • 143
  • 3
4
votes
1 answer

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

I'm trying to make a frame for a lithograph that I plan to 3D print for my wife for Mother's Day. I typically will have my differences be exactly the right size (rather than oversizing it for the sake of the preview) because it gives me a good feel…
D. Patrick
  • 145
  • 5
4
votes
1 answer

Spiral bevel gears in OpenSCAD

I'm trying to design a "Lifting Table" in OpenSCAD which will consist of 2 concentric cylinders. On the inner cylinder I plan to mount 3 un-powered bevel gears vertically plus a 4th powered one each at the proper location/angle to interface with…
4
votes
1 answer

Streamlining OpenSCAD Code

Is there an efficient approach to discovering what is extraneous ("dead" or "unused") code in OpenSCAD to promote the learning process? I am making progress by using working examples of code; however, some contain code with lots of modules and "test…
4
votes
1 answer

Is there an easy way to split models in OpenSCAD?

I'm wondering if I can take one OpenSCAD object, and cut/splice/split it into two different objects that can then be manipulated independently? One approach is to duplicate the object, difference it along the cut border with a 3rd object, and then…
Hamy
  • 223
  • 2
  • 6
3
votes
2 answers

OpenSCAD 2018 Command line

First, I'm using Linux Mint 18.3 (Sylvia). Until now, I've been using OpenSCAD with the GUI and never experienced issues. Now I try to start OpenSCAD from the command line, but it always opens an empty file, even if a file with the specified name…
1
2 3