Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convexe polygon around a shape
#4
Code:
listOfPointsTupple=[]
   while len(listOfPoints)>1:
       listOfPointsTupple.append((listOfPoints.pop(0),listOfPoints.pop(0)))

Much more pythonic (and likeky faster):

Code:
listOfPointsTupple=zip((listOfPoints[0::2],listOfPoints[1::2])
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 Ofnuts - 05-16-2023, 08:36 PM

Forum Jump: