mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-23 14:06:23 +02:00
Issue #88: backport to Python 3.8.
This commit is contained in:
parent
e9b1b499bf
commit
75128537da
30 changed files with 303 additions and 267 deletions
|
@ -1,6 +1,8 @@
|
|||
"""
|
||||
Vector utility.
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
|
||||
__author__ = "Sergey Vartanov"
|
||||
|
@ -45,12 +47,12 @@ class Polyline:
|
|||
List of connected points.
|
||||
"""
|
||||
|
||||
def __init__(self, points: list[np.ndarray]) -> None:
|
||||
self.points: list[np.ndarray] = points
|
||||
def __init__(self, points: List[np.ndarray]) -> None:
|
||||
self.points: List[np.ndarray] = points
|
||||
|
||||
def get_path(self, parallel_offset: float = 0) -> str:
|
||||
"""Construct SVG path commands."""
|
||||
points: list[np.ndarray]
|
||||
points: List[np.ndarray]
|
||||
try:
|
||||
points = (
|
||||
LineString(self.points).parallel_offset(parallel_offset).coords
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue