The code described in the previous post includes a Python function that rotates 3D coordinates by an angle defined with two vectors, using Rodrigue’s Rotation. I have now added this function to the IP2_py spreadsheet, where it is used in the original application (fitting a circular arc to 3D data points), and also in the PView user defined function (UDF), to generate a perspective projection of any 3D framework. The new spreadsheet and associated Python code may be downloaded from:
IP2_py.zip
As well as the new functions, the update includes:
- Updated Python and VBA code for the latest version of xlwings.
- Updates to the Python GlobLoc3 and Gamma3 functions.
- Python code re-named IP2_py.py.
Examples of the new PView and Fit_Circ3D functions are shown in the screenshots below:
As for the previous application, to use the spreadsheet:
- If necessary, install Python, Numpy, and xlwings. All the necessary packages are included in the default Anaconda Python installation.
- Copy IP2_py.xlsb and IP2_py.py to any convenient directory.
- Run IP2_py.xlsb, and if necessary enable macros.