_c_ Posted January 17, 2022 Share Posted January 17, 2022 (edited) Hello, I'd like to collect and study some valid third party Python libraries for Vectors, what do you use? So far I tested: the one in this example: https://developer.vectorworks.net/index.php/Python_Sample_2D_Path_Object: mind that the __div__ defs are obsolete. This looks like a reduced version of something else McLeonards: https://gist.github.com/mcleonard/5351452 Pygame 3D vectors: https://www.pygame.org/wiki/3DVectorClass?parent=CookBook. I am on this one now thank you _c_ Edited January 17, 2022 by _c_ 1 Quote Link to comment
twk Posted January 17, 2022 Share Posted January 17, 2022 I use the McLeonards one for 2D vector calcs at the moment. For scalars and other basic arithmetic with vectors. Never seen the 3D one before, looking through it now. Thanks for the share! 1 Quote Link to comment
BillW Posted January 19, 2022 Share Posted January 19, 2022 I had a go at converting python code for vectors back in 2016 see attached. I never really used the code as I can't guarantee that the vector python file will exist in all settings. It may be of use. Also units in VW python are not really handled as in Vectorscript ie 20mm in code will be automatically converted to the current units - not so in python. Find attached a go at handling automatic conversion. PS I couldnt upload .py files so I had to rename files below as .txt files. Just rename back to .py vwvector.txt vwunits.txt 2 Quote Link to comment
BillW Posted January 19, 2022 Share Posted January 19, 2022 As an aside I found some code for handling euler and quaterion rotations which I'm trying to figure out. As far as I can tell 3D rotations in VW code are world based which doesnt help if you want to rotate an object around it's local orientation. Find attached a zip file with the main python code being 'pyrotation.py' which needs numpy loaded. pyrotation.zip 2 Quote Link to comment
twk Posted January 20, 2022 Share Posted January 20, 2022 Ah, @BillW, these are great. Much cleaner to implement as well. Quote Link to comment
_c_ Posted January 20, 2022 Author Share Posted January 20, 2022 @BillW, thank you so much for the library files, precious stuff you have there. Quote Link to comment
Jayme McColgan Posted January 20, 2022 Share Posted January 20, 2022 (edited) in my python externals folder i've added Pillow PIL and Requests (and the requested libraries for them). EDIT: well i guess i did'nt fully read the topic before posting... lol these 2 haven othing to do with vectors... sorry Edited January 20, 2022 by Jayme McColgan stupid me Quote Link to comment
_c_ Posted January 20, 2022 Author Share Posted January 20, 2022 Don't worry Jayme, and thank you for the hint: I will give a look to them as well. I just want to find all the problems with the vector stuff, then I am looking forward to expand to new themes. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.