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

Try to use glam or nalgebra to replace OCC's transform #24

Open
happydpc opened this issue Mar 31, 2023 · 7 comments
Open

Try to use glam or nalgebra to replace OCC's transform #24

happydpc opened this issue Mar 31, 2023 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@happydpc
Copy link

OCC's transform is too hard to use with rust, we can replace it with rust's math library, and cast back.

@DSchroer
Copy link
Owner

I'm guessing you mean construct the transformation matrix in rust and then push that to a OCC transform?

Sounds like a good plan. Feel free to submit a PR if you are interested in doing this.

@DSchroer DSchroer added enhancement New feature or request good first issue Good for newcomers labels Mar 31, 2023
@DSchroer
Copy link
Owner

Out of curiosity, what are you attempting to achieve with this? Did you try something and run into limits or is this an improvement without an immediate need?

@happydpc
Copy link
Author

I want to use some exist rust repos to interact with occ.But the occ's gp_Trs or gp_GTrs is so hard to use, As we just need to pass a 43 or 44 array, just use a replaced type and cast to occ may ease the case.

@DSchroer
Copy link
Owner

Makes sense. Lets start with getting the API you need in https://github.com/bschwind/opencascade-rs. After that we can use it here. What API for gp_Trs or gp_GTrs do you need in order to replace your transforms?

@happydpc
Copy link
Author

Maybe replace the types directly by glam::Affine3A and glam::Mat4, hope that user doesn't need to know occ's math types one day.

I have tried truck repo before , it's still too young 😓.Using occ is the last choice.

@bschwind
Copy link

Things are still majorly in flux, but for now I've started using glam in my higher level OCC bindings

I wouldn't recommend using it yet, but it's quite easy to integrate so there's no reason we can't use those more ergonomic types here.

@DSchroer
Copy link
Owner

Makes sense. I am happy to accept a PR for that into DSLCAD. Right now my focus is on getting parity with the web editor and will move back to the language work after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants