Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor transparency calculation for previewing extruded hollow shapes with holes cut into them #5060

Closed
MethylBromide opened this issue Mar 22, 2024 · 2 comments

Comments

@MethylBromide
Copy link

Describe the bug
When an extruded 2D shape with internal holes is perforated via the "difference" function, large portions of the remaining surface vanish from preview.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new SCAD file.
  2. Paste in the below code and execute. The script creates two objects -- one is an extruded flat shape with an interior hole, and the other is the same shape with slots cut into it via the difference function.
  3. Move the perspective around to see the issue. Depending on angle of view, large portions of the surface become transparent.

Expected behavior
This is a simple enough shape I would expect the preview and the rendered version to look nearly identical.

Code reproducing the issue
/* [Hidden] */ $fa = 1; $fs = 0.4; for (slots=[false, true]) translate([slots?40:0,0,0]) difference() { linear_extrude(height=18) { difference() { offset(r=4) polygon([[15,0], [0,15], [-15,0], [0,-15]]); offset(r=3) polygon([[15,0], [0,15], [-15,0], [0,-15]]); } } if (slots) { translate([0,0,-1]) cylinder(17, r=9); for(z=[1:3:13]) translate([12,0,z]) cube([12,12,1], center=true); } }

Screenshots
Screenshot_161
Screenshot_162

Environment and Version info (please complete the following information):

  • OS: Windows 11.
  • System: Intel PC 64-bit
  • OpenSCAD Version: 2024.03.22 (git 9688356) from OpenSCAD website.

Additional context
This is severely impacting my ability to create complex models to post on Thingiverse for use with the Customizer, because huge swaths of my model turn into gaping holes in the preview. People can't see what they're getting.

@UBaer21
Copy link
Contributor

UBaer21 commented Mar 22, 2024

linear_extrude(height=18, convexity=5)
Add the convexity parameter for correct preview display.

@t-paul
Copy link
Member

t-paul commented Mar 22, 2024

@t-paul t-paul closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
@t-paul t-paul removed the Type: Bug label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants