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

Add support for mirroring #300

Merged
merged 10 commits into from
Nov 26, 2020
Merged

Add support for mirroring #300

merged 10 commits into from
Nov 26, 2020

Conversation

isovector
Copy link
Contributor

@isovector isovector commented Nov 20, 2020

This PR adds a mirror method to Object which mirrors an object across a hyperplane defined by a given normal.

Example:

let cutcube =
      difference
        [ rect3R 0 (-3, 0, -3) (0, 3, 0)
        , sphere 3
        ]
 in union
      [ cutcube
      , mirror (1, 0, 1) cutcube
      ]

2020-11-23-090402_357x295_scrot

@julialongtin
Copy link
Member

yeah, you're going to have to fix rotation, AND expose this via scad for me to accept it.

@isovector isovector changed the title Add ReflectX primitive Add support for mirroring Nov 23, 2020
@isovector
Copy link
Contributor Author

@julialongtin PTAL. The arbitrary reflection axis is now implemented, though I'm going to push back against the scad stuff. I don't use that interface, nor do I have any plan to. If someone else would like to expose this functionality, I'd be all for it, but this PR provides useful functionality as it is.

@julialongtin
Copy link
Member

After discussion with the OpenSCAD folks, this is more powerful than their mirror() construct. I have two asks with this one: could you rename this version reflect(), and could you implement a mirror() that does not include the original object in the output? no and no is a fine answer, don't hurt me for asking. :)

@isovector
Copy link
Contributor Author

isovector commented Nov 24, 2020

This version doesn't include the original object either --- notice the union in the example! Am I missing something?

@julialongtin julialongtin merged commit d9c7156 into Haskell-Things:master Nov 26, 2020
@isovector isovector mentioned this pull request Nov 27, 2020
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

Successfully merging this pull request may close these issues.

2 participants