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

reappearing_cross_section with spreading<1 #237

Open RichardPfr opened 1 month ago

RichardPfr commented 1 month ago

If the spreading is smaller than 1 currently the reappearing_cross_section calculation returns an empty array: https://github.com/pyroll-project/pyroll-core/blob/93bfbaf21d057b63e7d5023491470a41ca0b49d6/pyroll/core/roll_pass/hookimpls/roll_pass.py#L190-L192

Though spreading smaller than 1 is a circumstance that can realistically happen (at high rolling velocities for example) so the area difference should still be included somewhere by either:

I would say the first is still the better option, just so that bloat is reduced (and it also dirctly works with existing code). @axtimhaus / @ChRen95 What do you think?

axtimhaus commented 3 weeks ago

Unfortunately, shapely is not able to represent something like negative areas. One possible solution would be to make a new reappearing_cross_section_area hook which is float and negative in this case. But this would be hacky and unsafe.

I vote for the second alternative, as then the semantics are clear. Naming is tough though, also the names of the existing hooks are somewhat cumbersome and hardly expressive. The name reduced is ambiguous with the current displaced.

I have no better idea for now. Will think about it.

ChRen95 commented 3 weeks ago

Well I think displaced and reappearing should stay. Making it a float value would mean losing all neat properties of a shapely polygon so I'm also not a fan.