plasm-language / pyplasm

http://www.dia.uniroma3.it/~paoluzzi/plasm502/
Other
54 stars 24 forks source link

Links to examples #28

Closed villares closed 3 years ago

villares commented 3 years ago

I'm afraid I can't find links to examples. At the main https://plasm.net page the only place that seemed to lead to an example links back to the main page. Is there an example repository somewhere?

I do have the GPfCAD 2003 Wiley book but I can't make any sense on how to start with pyplasm/Python (I teach and do research with Python so it would be much better for me to try pyplasm).

image

scrgiorgio commented 3 years ago

Thanks for the suggestion. I'm forwarding this email to the author of the book (Prof.Alberto Paoluzzi). I don't know exactly where the new examples are.

On Thu, Sep 17, 2020 at 3:52 AM Alexandre B A Villares < notifications@github.com> wrote:

I'm afraid I can't find links to examples. At the main https://plasm.net page the only place that seemed to lead to and example links back to the main page. Is there an example repository somewhere?

I do have the GPfCAD 2003 Wiley book but I can't make any sense on how to start with pyplasm/Python (I teach and do research with Python so it would be much better for me to try pyplasm).

[image: image] https://user-images.githubusercontent.com/3694604/93410130-cbf2cf00-f86e-11ea-9153-6e123dd13fca.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/plasm-language/pyplasm/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTZP7GHSYQENBAV75OUR3SGFTWVANCNFSM4RPVZICQ .

-- Giorgio Scorzelli Director of Software Development, Center for Extreme Data Management, Analysis and Visualization (CEDMAV) Principal Software Design Engineer, Scientific Computing and Imaging (SCI) Institute, University of Utah

apaoluzzi commented 3 years ago

You can find a LOT of pyplasm examples in https://github.com/plasm-language/pyplasm/tree/master/resources/examples https://github.com/plasm-language/pyplasm/tree/master/src/pyplasm

and in particular in https://github.com/plasm-language/pyplasm/blob/master/src/pyplasm/fenvs.py

of course, the best is to download a local version of https://github.com/plasm-language/pyplasm/

Please find enclosed some slides slides-esco10.pdf about how to move from classic PLaSM language (book GP4CAD) to pyplasm.

Best luck with pyplasm … It is VERY powerful

villares commented 3 years ago

Thank you so much!

May I suggest, please add this wonderful links to the plasm.net page. Grazie molto!

scrgiorgio commented 3 years ago

Good idea. Forwarding. Your message since I'm not the admin of the site. Ciao

On Thu, Sep 17, 2020, 12:35 PM Alexandre B A Villares < notifications@github.com> wrote:

Thank you so much!

May I suggest, please add this wonderful links to the plasm.net page. Grazie molto!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/plasm-language/pyplasm/issues/28#issuecomment-694146570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTZP2PRW4TKUHOUZWVTF3SGHQ6NANCNFSM4RPVZICQ .

villares commented 3 years ago

I'm having some trouble with the examples, I think the interface might have changed for some functions. Like T (translate) seems to take a single tuple now instead of a number of arguments. May I open some issues @scrgiorgio? If you manage to coach me a bit I might be able to contribute updating the examples.

scrgiorgio commented 3 years ago

Absolutely feel free to open issues. I know not all examples are right.

On Thu, Sep 17, 2020 at 4:16 PM Alexandre B A Villares < notifications@github.com> wrote:

I'm having some trouble with the examples, I think the interface might have changed for some functions. Like T (translate) seems to take a single tuple now instead of a number of arguments. May I open some issues @scrgiorgio https://github.com/scrgiorgio? If you manage to coach me a bit I might be able to contribute updating the examples.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/plasm-language/pyplasm/issues/28#issuecomment-694266850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTZP3IY6EG6D26QHX6VQDSGIK5JANCNFSM4RPVZICQ .

-- Giorgio Scorzelli Director of Software Development, Center for Extreme Data Management, Analysis and Visualization (CEDMAV) Principal Software Design Engineer, Scientific Computing and Imaging (SCI) Institute, University of Utah

apaoluzzi commented 3 years ago

VIEW( T([1,2])([1.,0.5])(cube) ) VIEW( T([1,2])([1.,0.5])(cube) ) work perfectly.

Note that T, according to classic PLaSM is a function of 3rd order, and must be applied (curried -- see https://en.wikipedia.org/wiki/Currying) three times: (1) to the list of indices the function must be applied to; (2) to the corresponding translation parameters; (3) to the geometric object (the HPC value).

Note also that T applied to a 3D object might change either 1, 2, or 3 coordinates. The indices and value parameters arrays, specifying the transformation, must be changed accordingly ...

I suggest you check on file pyplasm/src/pyplasm/fenvs.py how to use each PLaSM function translated to Python.

villares commented 3 years ago

I guess I was trying to run old examples I accidentally downloaded from a fork while I was trying to build pyplasm like mad... I will look more carefully at fenvs.py! Thank you again for the patience!

villares commented 3 years ago

Hi @scrgiorgio, sorry to bother you.

Have the dependencies changed? I was able to run many examples, now I'm getting a ModuleNotFoundError: No module named 'PyQt5.QtOpenGL'.

I tried sudo apt-get python3-pyqt5.qtopengl now I have this other error in pisa.py for instance:

AttributeError: module 'time' has no attribute 'clock'

cheers!

scrgiorgio commented 3 years ago

I fixed some bugs in resources/examples. Here is the git diff:

https://github.com/plasm-language/pyplasm/commit/88eb6caeec126ef7545c0d1f4e1649763f9bcf46

As you see in the README.md ( https://github.com/plasm-language/pyplasm/blob/master/README.md) all tests work now (apart from the manipulator test, which is not important):

[OK] resources\examples\arm2d.py [OK] resources\examples\ashtray.py [OK] resources\examples\ballorganizer.py [OK] resources\examples\basic.py [OK] resources\examples\batch.py [OK] resources\examples\bsp.py [OK] resources\examples\colors.py [OK] resources\examples\graph.py [OK] resources\examples\lathering.py [OK] resources\examples\load_obj.py [OK] resources\examples\pisa.py [OK] resources\examples\plasm.py [OK] resources\examples\rotational_solid.py [OK] resources\examples\temple.py [OK] resources\examples\threecubes.py

About your second question. Please forget about the pyplasm directory (now moved to experimental/pyplasm to avoid confusion). It is a very old experiment with the aim to create a pyplasm python-pure version(i.e. no C++ layer). But it has never been completed; nor is fully functional. We have no official dependency on PyQt5.

Please try yourself and let me know. Just be careful to wait for pip wheel productions ( https://github.com/plasm-language/pyplasm/actions/runs/267317599). Tag is 2.0.9. Giorgio.

On Mon, Sep 21, 2020 at 6:59 PM Alexandre B A Villares < notifications@github.com> wrote:

Hi @scrgiorgio https://github.com/scrgiorgio, sorry to bother you.

Have the dependencies changed? I was able to run many examples, now I'm gettinlg a ModuleNotFoundError: No module named 'PyQt5.QtOpenGL'.

Also, wouldnt it be better to use PySide2? ( https://www.learnpyqt.com/blog/pyqt5-vs-pyside2/)

cheers!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/plasm-language/pyplasm/issues/28#issuecomment-696242505, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTZP3JDYWIMGUNHPPI5J3SG6A6JANCNFSM4RPVZICQ .

-- Giorgio Scorzelli Director of Software Development, Center for Extreme Data Management, Analysis and Visualization (CEDMAV) Principal Software Design Engineer, Scientific Computing and Imaging (SCI) Institute, University of Utah

villares commented 3 years ago

Sucess! Thank you! image