evereux / pycatia

python module for CATIA V5 automation
MIT License
196 stars 53 forks source link

Create coords_relative_to_axis_system.py #183

Closed Mithro86 closed 9 months ago

Mithro86 commented 9 months ago

Useful script to get the coordinates of a point relative to an axis system.

evereux commented 9 months ago

Great stuff, thanks for this.

I'm not a fan of the use of global here. They're a little frowned upon and not used unless strictly necessary which I don't believe they are here. Lots of articles out there regarding the use of them. I would simply move that section of code to before your function definitions and remove the global assignments.

Mithro86 commented 9 months ago

Corrected. Thanks for the input!

evereux commented 9 months ago

Awesome, thanks. I'll merge as soon as I can.

evereux commented 9 months ago

What is the normalize_vector function doing within the function coords_relative_to_axis? I ask since the results n_x, n_y and n_z aren't used.

Mithro86 commented 9 months ago

What is the normalize_vector function doing within the function coords_relative_to_axis? I ask since the results n_x, n_y and n_z aren't used.

Nice catch, I had made an error. I did a new pull request with the corrected one.

evereux commented 9 months ago

What is the normalize_vector function doing within the function coords_relative_to_axis? I ask since the results n_x, n_y and n_z aren't used.

Nice catch, I had made an error. I did a new pull request with the corrected one.

It was pycharms catch, not mine. :-)