Coder Social home page Coder Social logo

Comments (1)

jordanbrown0 avatar jordanbrown0 commented on June 2, 2024

See also #4286 and many others (#4442, #4780, #4546, #4335, et cetera).

The simple answer is that yes, the previewer gets Z-fighting artifacts any time that a face of a negative object aligns with a face of a positive object. There can be similar issues when faces that have been subtracted away align with positive faces of a different color.

Here's the FAQ entry: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview?

There are roughly two strategies for addressing this problem:

  • Arrange that those cases don't happen. The major case there is where you are subtracting a negative object from a positive one and cutting into its surface. Arrange that the negative object extends outside the positive object. (But that doesn't directly help your particular scenario.)
  • Wrap strategic pieces with render(), which forces OpenSCAD to fully evaluate the geometry of that subassembly.

In your particular case, wrapping the difference() in ikea() in a render() appears to address the problem.

...
module ikea(r = 5, h = 3) {
   render() difference() {
                union() {
...

Why does it do this, and why doesn't somebody fix it? Because the previewer does black magic to get its performance, and it's a wonder that it works as well as it does, and nobody has a better answer. Recent work to dramatically improve render performance may provide a viable replacement, though it's still slower than the previewer and more limited in other ways like color and transparency support.

from openscad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.