Changeset 449:a99e5e724545
- Timestamp:
- 09/07/13 13:08:59 (9 years ago)
- Branch:
- default
- Phase:
- public
- Rebase:
- 37616239396534316566353638373139323031336264633738353035613635343332666538313364
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/area_editor.py
r441 r449 380 380 try: 381 381 l = eval(text) 382 args.append(' - - %s' % l[0])383 for coord in l[1:]:384 args.append(' - %s' % coord)385 382 except Exception: 386 383 alert("Invalid polygon %s" % text) … … 388 385 return None 389 386 # Check for convexity 390 hull = pymunk.util.convex_hull(l) 391 if hull != l: 387 if not pymunk.util.is_convex(l): 392 388 alert("Invalid polygon %s - not convex" % text) 393 389 return None 390 if not pymunk.util.is_clockwise(l): 391 l.reverse() 392 if not pymunk.util.is_clockwise(l): 393 alert("Invalid polygon %s - unable to make clockwise" 394 % text) 395 return None 396 args.append(' - - %s' % l[0]) 397 for coord in l[1:]: 398 args.append(' - %s' % coord) 394 399 else: 395 400 args.append(' - ' + text)
Note:
See TracChangeset
for help on using the changeset viewer.