hominoids / SBC_Case_Builder

Autonomous SBC case generation using SBC Model Framework
GNU General Public License v3.0
381 stars 24 forks source link

Fixes spacing of vents and rendering #14

Closed davejlong closed 2 years ago

davejlong commented 2 years ago

Rendering tests of new logic on various sizes:

40mm: 63ms 80mm: 67ms 1000mm: 178ms

New vent spacing creates 4mm wide arcs with 4mm space in between.

davejlong commented 2 years ago

So it seems like there might still be something about the 80mm fan mask when it's used in a difference() call like it would normally be used. It might just be my computer, but the rendering for the new fan_mask.scad shows:

Loaded design 'E:/Projects/SBC_Case_Builder/tests/fan_mask.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
Geometries in cache: 143
Geometry cache size in bytes: 1251784
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 5386 elements!
Compile and preview finished.
Total rendering time: 0:00:00.045

Removing just the 80mm Mask Punchout block yields:

Loaded design 'E:/Projects/SBC_Case_Builder/tests/fan_mask.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
Geometries in cache: 143
Geometry cache size in bytes: 1251784
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 258 elements!
Compile and preview finished.
Total rendering time: 0:00:00.019

The odd part to me is the significant change to the Normalized Tree, but I'm not sure what exactly the Normalized Tree is.

Compared to the old logic, I get this rendering (removing the 30mm fans) with the new logic:

Loaded design 'E:/Projects/SBC_Case_Builder/tests/fan_mask.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
Geometries in cache: 143
Geometry cache size in bytes: 1251784
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 5307 elements!
Compile and preview finished.
Total rendering time: 0:00:00.039

And the old logic for the mask:

Loaded design 'E:/Projects/SBC_Case_Builder/tests/fan_mask.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
Geometries in cache: 143
Geometry cache size in bytes: 1251784
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 1303 elements!
Compile and preview finished.
Total rendering time: 0:00:00.096
hominoids commented 2 years ago

I get 2 errors with the 40mm and the 80mm causes my system to lag hard to the point of not being usable with the h2_shell, as one example. They look better with your recent changes but the 80 and 90 are not acceptable the way they are and none of them are great aesthetically. With the errors and system lag, this isn't ready.

davejlong commented 2 years ago

I think I nailed it down now. OpenSCAD gets really unhappy with the amount of union and difference calls being made to build the large fans. To get around that, I set a value to calculate all of the sizing off of how many rings you want in the fan grate. I find it looks best using 4 rings on a smaller fan (40mm and lower) and 6 rings on larger ones.

With the latest commits, previewing the H2 Shell case takes only 1.006 seconds and doesn't seem to slow down my computer at all. I can still move around the viewport without issue.

image

hominoids commented 2 years ago

I'm still getting errors and the 40mm does not display correctly either. Design wise it also looks like the largest ring openings are to small for the fan sizes. For fans, the most air is generated at the ends of the blades so the opening has to be as large as the actual fan opening. The number of rings that you talked about above don't seems to be reflected in the masks either, the 40mm only has 3 rings and the 80mm 5.

new_fan

Thinking about this more, having multiple fan designs is a good thing because it's a significant part of a case and people can be particular about their cooling. So lets set this up as another fan style 3, instead of replacing the other. But, the errors need to be fixed and the design checked to make sure it's practical and functional before the PR can be accepted.

davejlong commented 2 years ago

I tested against 64-bit 2021.01 and 2019.05 on Windows without any of the warnings from your screenshot. I'll have to see if I have a Linux VM to test against.

image image

The outer most part of the fan is based on being 90% of the size of the fan. In doing some quick measurements of a couple fans I have laying around, it looks like the fan is usually ~90-95% of the width of the fan (40mm fan uses a 36mm wide fan opening).

The reason for the count being off in the rings is because there's actually a ring at the center that has been getting closed by the cross bars. If I expand out the rings to be 95% of the fan spacing, you can see the 4th ring on the 30 and 40mm fans, but it's still hidden behind the center bars on the 80mm fan.

I'll do some more tweaking and post here once I have everything sorted. I'll update the new logic to be the 3rd option.

davejlong commented 2 years ago

Testing the most recent version of the mask style 3 and still haven't been able to replicate the warnings you saw.

Linux 2021.09: image

Linux 2019.05: image

hominoids commented 2 years ago

I still get 2 errors for the 80mm on Linux neanderthal 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux on OpenSCAD 19.5 from the repository and a 21.1 nightly appimage. It did work on an old Windows 7 laptop running 19.1.x nightly. So it may be an issue for the software stack I'm running. I'll go ahead a merge this for now on that assumption.