Compare commits
No commits in common. "30cfa0da313540a301bc8e415aef1a981b4b46ef" and "6567394fbf1209eb1a96a2f62c53c87e7374248c" have entirely different histories.
30cfa0da31
...
6567394fbf
@ -83,12 +83,10 @@ from .builder import (
|
|||||||
from .utils import (
|
from .utils import (
|
||||||
ports2data as ports2data,
|
ports2data as ports2data,
|
||||||
oneshot as oneshot,
|
oneshot as oneshot,
|
||||||
R90 as R90,
|
|
||||||
R180 as R180,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
__author__ = 'Jan Petykiewicz'
|
__author__ = 'Jan Petykiewicz'
|
||||||
|
|
||||||
__version__ = '3.3'
|
__version__ = '3.2'
|
||||||
version = __version__ # legacy
|
version = __version__ # legacy
|
||||||
|
@ -25,8 +25,6 @@ from .transform import (
|
|||||||
normalize_mirror as normalize_mirror,
|
normalize_mirror as normalize_mirror,
|
||||||
rotate_offsets_around as rotate_offsets_around,
|
rotate_offsets_around as rotate_offsets_around,
|
||||||
apply_transforms as apply_transforms,
|
apply_transforms as apply_transforms,
|
||||||
R90 as R90,
|
|
||||||
R180 as R180,
|
|
||||||
)
|
)
|
||||||
from .comparisons import (
|
from .comparisons import (
|
||||||
annotation2key as annotation2key,
|
annotation2key as annotation2key,
|
||||||
|
@ -2,11 +2,6 @@ import numpy
|
|||||||
from numpy.typing import ArrayLike, NDArray
|
from numpy.typing import ArrayLike, NDArray
|
||||||
from numpy import pi
|
from numpy import pi
|
||||||
|
|
||||||
try:
|
|
||||||
from numpy import trapezoid
|
|
||||||
except ImportError:
|
|
||||||
from numpy import trapz as trapezoid
|
|
||||||
|
|
||||||
|
|
||||||
def bezier(
|
def bezier(
|
||||||
nodes: ArrayLike,
|
nodes: ArrayLike,
|
||||||
@ -68,13 +63,13 @@ def euler_bend(
|
|||||||
num_points_spiral = numpy.floor(ll_max / ll_tot * num_points).astype(int)
|
num_points_spiral = numpy.floor(ll_max / ll_tot * num_points).astype(int)
|
||||||
num_points_arc = num_points - 2 * num_points_spiral
|
num_points_arc = num_points - 2 * num_points_spiral
|
||||||
|
|
||||||
def gen_spiral(ll_max: float) -> NDArray[numpy.float64]:
|
def gen_spiral(ll_max: float):
|
||||||
xx = []
|
xx = []
|
||||||
yy = []
|
yy = []
|
||||||
for ll in numpy.linspace(0, ll_max, num_points_spiral):
|
for ll in numpy.linspace(0, ll_max, num_points_spiral):
|
||||||
qq = numpy.linspace(0, ll, 1000) # integrate to current arclength
|
qq = numpy.linspace(0, ll, 1000) # integrate to current arclength
|
||||||
xx.append(trapezoid( numpy.cos(qq * qq / 2), qq))
|
xx.append(numpy.trapz( numpy.cos(qq * qq / 2), qq))
|
||||||
yy.append(trapezoid(-numpy.sin(qq * qq / 2), qq))
|
yy.append(numpy.trapz(-numpy.sin(qq * qq / 2), qq))
|
||||||
xy_part = numpy.stack((xx, yy), axis=1)
|
xy_part = numpy.stack((xx, yy), axis=1)
|
||||||
return xy_part
|
return xy_part
|
||||||
|
|
||||||
|
@ -9,11 +9,6 @@ from numpy.typing import NDArray, ArrayLike
|
|||||||
from numpy import pi
|
from numpy import pi
|
||||||
|
|
||||||
|
|
||||||
# Constants for shorthand rotations
|
|
||||||
R90 = pi / 2
|
|
||||||
R180 = pi
|
|
||||||
|
|
||||||
|
|
||||||
@lru_cache
|
@lru_cache
|
||||||
def rotation_matrix_2d(theta: float) -> NDArray[numpy.float64]:
|
def rotation_matrix_2d(theta: float) -> NDArray[numpy.float64]:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user