Foxelmanian / ToOptixFreeCADAddon

Addon for FreeCAD using ToOptix
GNU General Public License v2.0
17 stars 2 forks source link

Python2.7 vs. Python3 and some structural things #1

Open joha2 opened 5 years ago

joha2 commented 5 years ago

Hi Martin,

On my repo and in a new "workbench" branch I started developing a FreeCAD workbench which should work similar to your FreeCAD macro. There are still some issues, we have to deal with:

From that two points: Wouldn't it be better to remove things like type annotations which are clearly not supported by Python2.7 to get at least with this version some compatibility? It would also simplify testing: At the moment, in particular for my older Linux Mint 18.3, I have to use some 0.19-Py3-Qt5 AppImage, decompress it, install ToOptixCore and FreeCADAddon into it, and perform the tests in FreeCAD.

Another point is: I realized that these several run_optimization.py files are not needed, if we do not need to start a subprocess. Therefore a very useful Python interface is already given by the OptimizationController in ToOptixCore. I would suggest:

Once it is available in the appropriate Python environment we can rely on its functionality from FreeCAD or Blender via non problematic module imports. The user just has to pip install ToOptixCore and pip install ToOptixFreeCADAddOn. What do you think?

Best wishes Johannes

Foxelmanian commented 5 years ago

Hi Johannes, sorry for the late response (vacation :) ).

  1. Yes your right. I ll remove the annotations, than it will perform on Python2.7 aswell. Just give me this night :).

  2. This is a great Idea and way more better than the solution with the submodule. I ll create a setup.py file. The generic class is already implemented. The run_optimization.py just calls this object.

Best wishes

Martin

joha2 commented 5 years ago

Hi Martin,

The late response is no problem, I already thought that you are on vacation, since it is (was) holiday time :-) Take your time for removing the annotations. There is no hurry.

Best wishes Johannes

Foxelmanian commented 5 years ago

Hi Johannes,

you can use python 2.7 atleast for the "ToOptixCore Repo". Now I will add a "setup.py" file like in your branch.

Best Regards

Martin

Foxelmanian commented 5 years ago

Hi @joha2,

you can install the core functions now via python setup.py install.

Now you can use it as a package. Best Regards

Martin