05-16-2023, 05:38 PM
thanks for the advice. Lists with python are a nightmare for me.
another surely optimisable part of my script is when I triple the elements of the convex hull to the points and their two tangents. And then I flatten the list with a line of code I copied without understanding it from this page. Is there a more pythonic way of doing so ?
Another curiosity in my script is the line I delete doubles. I use the line found in this page, but is it not over-engineer to use dictionaries for such a common task ?
another surely optimisable part of my script is when I triple the elements of the convex hull to the points and their two tangents. And then I flatten the list with a line of code I copied without understanding it from this page. Is there a more pythonic way of doing so ?
Code:
hull = [[i,i,i] for i in hull]
hull = [item for sublist in hull for item in sublist]
Another curiosity in my script is the line I delete doubles. I use the line found in this page, but is it not over-engineer to use dictionaries for such a common task ?
Code:
listOfPointsTupple = list(dict.fromkeys(listOfPointsTupple))