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

rotateExtrude behaves oddly when given noncontinuous functions #368

Open
isovector opened this issue Dec 27, 2020 · 1 comment
Open

rotateExtrude behaves oddly when given noncontinuous functions #368

isovector opened this issue Dec 27, 2020 · 1 comment

Comments

@isovector
Copy link
Contributor

test :: SymbolicObj3
test = rotateExtrude 4.0 (Right $ \case
                        3.1847910293530797->V2 3.0 (-6.681629751553052)
                        _->V2 0.0 0.0
                    ) (Right $ const 0) (polygon [V2 9.0 (-3.3500040166499234),V2 0.0 (-16.711593776250552),V2 0.0 0.0]) 

this shape doesn't have the property that rotate3 (V3 (2 * pi) 0 0) test =~= test

@lepsa
Copy link
Contributor

lepsa commented Nov 19, 2022

I'm thinking that this might be an issue with the extra layer of floating point maths going on. (=~=) is using Test.QuickCheck.=== under the hood, which is using Eq, and that doesn't play nicely with floating point values. I've generated STLs for both the test object and the rotate3-ed test object at a 0.2 resolution, and with an STL diff tool they look visually the same. See attached images. The only major differences I can see are that the point of the cone on the rotated object isn't as clean, and the center grove also has some very minor artifact. Both of these issues get better with finer resolutions however, leading to my conclusion that it is a floating point issue, not a underlying maths issue.

image
image

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

2 participants