pyroll-project / pyroll-core

PyRoll rolling simulation framework - core library.
https://pyroll.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Issue with "rotation" #42

Closed ToFFmashines closed 1 year ago

ToFFmashines commented 1 year ago

Summary

Simply test based on square initial profile and box gooves ending with raise AttributeError(f"Hook call for '{self.name}' on '{instance}' could not provide a value.") AttributeError: Hook call for 'rotation' on 'Rotator 'Auto-Rotator for RollPass 'BOX B0''' could not provide a value.

PyRolL Version and Platform

Last version of PyRoll from github

Steps to Reproduce

For reproduction I prepared this test maximal sipmle file https://github.com/ToFFmashines/pyroll-core/blob/main/tests/test-square-to-box.py

axtimhaus commented 1 year ago

Hey,

feeding a square into a box was originally not intended, since a square stands on its tip and a box on its side. The intended way for this was to create a profile with Profile.box, which is also the workaround for your problem, or you may give rotation=45 as keyword argument on the roll pass.

Nevertheless, I added the respective hook function for rotation of square into box with dbcfb40.

ToFFmashines commented 1 year ago

Thank you for the explanation. It did not occur to me that there is a limitation in the possible combinations of input profile and grooves. I should also have read the info on square profile properly.

axtimhaus commented 1 year ago

Generally there is no limitation. There is just a set of predefined default rotations, but this set is naturally not universal. Look into the rotator hook functions. Now, there is also documentation on it If you do other combinations, you just have to provide the rotation value yourself.