Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convexe polygon around a shape
#5
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 ?

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))
Reply


Messages In This Thread
RE: convexe polygon around a shape - by Ofnuts - 05-13-2023, 05:36 AM
RE: convexe polygon around a shape - by Ofnuts - 05-14-2023, 07:54 AM
RE: convexe polygon around a shape - by jacques_duflos - 05-16-2023, 05:38 PM
RE: convexe polygon around a shape - by Ofnuts - 05-16-2023, 08:36 PM

Forum Jump: