It's easier for the LLM to rewrite an idiomatic computational geometry algorithm from scratch in a language it understands well like Python. Entire computational geometry textbooks and research papers are in its knowledge base. It doesn't have to copy some proprietary implementation.
(I find the example of the computational geometry algorithm being a clear case of direct memorization not very compelling, in any case.)