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

differed does not work #13

Closed
jdawgaz opened this issue Aug 24, 2017 · 5 comments
Closed

differed does not work #13

jdawgaz opened this issue Aug 24, 2017 · 5 comments

Comments

@jdawgaz
Copy link

jdawgaz commented Aug 24, 2017

The following code on the wiki does not provide the desired result:

differed("hole")
ball(50)
orient([x,y,z])
rod(d=25, h=55, $class="hole");

I am on osx Sierra (10.12.4), openscad (2017.08.03). Latest version on relativity.scad.

rel1

@davidson16807
Copy link
Owner

Have you tried building with F6?

@jdawgaz
Copy link
Author

jdawgaz commented Aug 24, 2017 via email

@davidson16807
Copy link
Owner

differed() takes the difference between positive and negative spaces. If you don't specify the positive space, it defaults to whatever the children are. So that code takes the hole and subtracts it from the hole plus some other stuff. Subtracting a part by itself can produce this sort of behavior.

The problem goes away if you set the positive space not to include the hole:

differed("hole", "not(hole)")
ball(50)
orient([x,y,z])
rod(d=25, h=55, $class="hole");

So maybe this is an issue with defaults? We could set positive space to be the negation of the negative space, if no default is provided.

@jdawgaz
Copy link
Author

jdawgaz commented Aug 25, 2017

I changed to code to this, and it works (and looks as expected).

You could change the wiki to reflect what the code should be, or change the defaults, so that when we put the code (that I first posted, from the wiki), it looks and acts as expected.

thanks.

@aleung
Copy link
Contributor

aleung commented Sep 11, 2018

It's better to change the default positive selector to "not()".

aleung added a commit to aleung/relativity.scad that referenced this issue Apr 12, 2019
davidson16807 added a commit that referenced this issue Apr 19, 2019
Fix #13: change differed() positive default
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