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

Strange behaviour of the rounded union #204

Open
elimohl opened this issue May 26, 2018 · 8 comments
Open

Strange behaviour of the rounded union #204

elimohl opened this issue May 26, 2018 · 8 comments

Comments

@elimohl
Copy link
Contributor

elimohl commented May 26, 2018

The union of two rectangles:
squares

I expected the rounded union be something like
want

But actually I get this:

union(r=10) {
    square([10, 10]);
    translate([10, 0])
        square([10, 20]);
}

sample

@elimohl
Copy link
Contributor Author

elimohl commented May 26, 2018

union(r=10) {
    square([10, 10]);
    translate([10, -5])
        square([10, 20]);
}

sample2

@TLC123
Copy link

TLC123 commented May 26, 2018 via email

@Renha
Copy link

Renha commented May 29, 2018

@TLC123 why?

@l29ah
Copy link
Contributor

l29ah commented Jun 28, 2019

Also occurs with 3D objects:

@l29ah
Copy link
Contributor

l29ah commented Jun 29, 2019

The culprit is

getImplicit2 (UnionR2 r symbObjs) =
    \p -> let
        objs = map getImplicit2 symbObjs
    in
        if r == 0
        then minimum $ map ($p) objs
        else rminimum r $ map ($p) objs

I don't really understand how is it supposed to work though, and it feels to me that it's not enough to know the distances from a point to each of the objects to find the distance to the rounded union of the objects.

@l29ah
Copy link
Contributor

l29ah commented Jul 9, 2019

Reading https://christopherolah.wordpress.com/2011/11/06/manipulation-of-implicit-functions-with-an-eye-on-cad/

(NB. This particular formation of rounded unions is a little bit naive. If you union and the sides aren’t orthogonal, this version will make a bump, which is not the expected behavior. This can be corrected for quite easily by looking at the dot product of the discrete gradients.)

I have no idea how to do this w/o explosive computational complexity growth.

@julialongtin
Copy link
Member

still present.

@julialongtin
Copy link
Member

hmm. still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants