TLC123 / OpenSCAD_stuff

My OpenSCAD labs
23 stars 1 forks source link

unionRound() fails for (some) non-convex operands #1

Open RonaldoCMP opened 3 years ago

RonaldoCMP commented 3 years ago

I have tried unionRound with:

    unionRound(1, 2) {
        translate([2, 5, 5]) union() { sphere(6); cylinder(8); }
        rotate([10, 20, 30]) cube(10, true);
    }

and it fails to respect the detail argument; in fact, it fails also with detail=4 although it seems to be fine with detail=3 or 1. I could not understand why.

Besides, I got a fast (and apparently correct) results for non-convex operands masking the region around their intersection. That will be fast provided that the operand intersection is convex. The simple mask I used was :

module mask(i,r) {
    intersection() {
        children(i) ;
        clad(r) intersection() { children(0); children(1); }
    }
}

That mask would be used as: mask(0,r) { children(0); children(1); }; instead of children(0); in all places it is appears under the hull(). The same is done with children(1).

TLC123 commented 3 years ago

Thank for the feedback/bug. I'll have a look at it. You masking techniques is almost identical to the one i have in unionRoundMask. unionRoundMask is the module i recommend for general use. raw unionRound is less guarded and the user has to take responsibility for correct input. Going forward unionRoundMask.scad will be the maintained file, for a while here and as part of Irev-Devs Round-Anything library.(Not yet merged)