Hi @AndreasRef,
Sorry if that doesn’t answer your question but have you tried with a simple line-line intersection algorithm ?
You could iterate over the edges of your polygon and check if the line intersects at least one of them.
edit: Not sure about this other suggestion either but you could also use the cast()
function from this Ray-Casting coding challenge.