mrWheel / YAPP_Box

Yet Another Parametric Projectbox Box
https://willem.aandewiel.nl/index.php/2022/01/02/yet-another-parametric-projectbox-generator/
MIT License
279 stars 47 forks source link

Function logic correction #85

Closed ron4mac closed 7 months ago

ron4mac commented 8 months ago

With a roundRadius of 1.0, the inside of my lid was solid rather than hollowed out. I found that a slight correction to the logic of a function solved the issue.

around line 4876 ... made less than or equal function getMinRad(p1, wall) = (p1<=wall) ? 1 : p1 - wall;

The function probably needs a greater amount of logic where p1==wall.

BTW: really nice work done on a great library

ron4mac commented 8 months ago

More complete function logic: function getMinRad(p1, wall) = p1<wall ? 1 : (p1==wall ? p1 : p1 - wall);

rosenhauer commented 8 months ago

Can you share your whole file? Just setting round radius to 1.0 doesn't get me the same result (non hollow case).

ron4mac commented 8 months ago

sample.scad.txt (non hollow lid)

OpenSCAD 2024-03-25

ron4mac commented 8 months ago

Has not recurred with the latest generator version (2024-03-26) ... even without my modification. 🤷🏼‍♂️

ron4mac commented 7 months ago

This issue has reared its head again. Without the modified function above, a lid ridge is not properly formed when the wallThickness is 2.0 sample.scad.txt

rosenhauer commented 7 months ago

Is that with the 3.1 version that was released just a few days ago.

ron4mac commented 7 months ago

Yes .. sorry .. 3.1 (as well as 3.0.5)

rosenhauer commented 7 months ago

Traveling right now. I'll look at it again in the next few days and roll in your fix.

rosenhauer commented 7 months ago

This has been merged into 3.1.1