Run an install/uninstall script in the background, logging to SENSING_INSTALL_LOG.
(script_path, arg=None)
| 1622 | def cross(o, a, b): |
| 1623 | return (a['x']-o['x'])*(b['y']-o['y']) - (a['y']-o['y'])*(b['x']-o['x']) |
| 1624 | lower = [] |
| 1625 | for q in p: |
| 1626 | while len(lower) >= 2 and cross(lower[-2], lower[-1], q) <= 0: |
| 1627 | lower.pop() |
| 1628 | lower.append(q) |
| 1629 | upper = [] |
| 1630 | for q in reversed(p): |
| 1631 | while len(upper) >= 2 and cross(upper[-2], upper[-1], q) <= 0: |
| 1632 | upper.pop() |
| 1633 | upper.append(q) |
| 1634 | return lower[:-1] + upper[:-1] |
| 1635 | |
| 1636 | |
| 1637 | def _gf_point_in_polygon(pt, poly): |
| 1638 | if not poly or len(poly) < 3: |
| 1639 | return False |
| 1640 | inside = False |
| 1641 | j = len(poly) - 1 |
| 1642 | for i in range(len(poly)): |
| 1643 | xi, yi = poly[i]['x'], poly[i]['y'] |
| 1644 | xj, yj = poly[j]['x'], poly[j]['y'] |