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 a Mirror command #122

Merged
merged 4 commits into from
Oct 20, 2021
Merged

Add a Mirror command #122

merged 4 commits into from
Oct 20, 2021

Conversation

Billiam
Copy link
Contributor

@Billiam Billiam commented Oct 19, 2021

Adds a Mirror command.

I feel like this should be doable with a single transformation, but I could not manage to get SetMirror with gp_ax2 argument to actually mirror the shape, rather than creating a rotation.

It looks like passing a single Point to SetMirror does work, but requires rotating, and reversing the faces afterward.

Example

@vercel
Copy link

vercel bot commented Oct 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/zalo/cascade-studio/27syGMeef1UnQ4wRq2X9tJY49Qed
✅ Preview: https://cascade-studio-git-fork-billiam-feature-mirror-zalo.vercel.app

@zalo
Copy link
Owner

zalo commented Oct 19, 2021

Thanks for the PR!

Looking at this thread, it seems like I have the wrong overload of the SetMirror transformation exposed…
https://dev.opencascade.org/content/mirroring-objects

I’ll look into fixing that since I know funny things/edge cases can happen when solids are buried under too many transformations.

(Due to the version of OCC in the main branch, only one overload of a function (per # of arguments) is exposed at a time; the embind branch fixes this at the cost of a bit of extra overhead)

The build for that is happening here:
https://github.com/zalo/opencascade.js/runs/3944135079

@Billiam
Copy link
Contributor Author

Billiam commented Oct 19, 2021

Due to the version of OCC in the main branch, only one overload of a function (per # of arguments) is exposed at a time

Oh, I was wondering how that worked.

I can reopen a new PR when that's changed, or update this one as you like.

@zalo
Copy link
Owner

zalo commented Oct 20, 2021

I just committed the new WASM and simplified mirroring function.

For reference, how that works is I make a commit to this repo (an ancient fork of opencascade.js that I like because it's smallish, loads fastish, and doesn't mangle the names of the functions) and Github Actions commits the build products back into it:
https://github.com/zalo/opencascade.js/commits/master

The latest OpenCascade.js integrates in this branch, and it handles all of the function overloads (at the cost of appending numbers to the function names).

Either way, this PR is looking good now, so I'm merging it...

@Billiam
Copy link
Contributor Author

Billiam commented Oct 20, 2021

Thank you!

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