Compare commits
No commits in common. "55e3066485e422b704abe0b7be5ea3196f45f677" and "aefd79fb5d8cc6e23d549fb19eaad0ff2c228320" have entirely different histories.
55e3066485
...
aefd79fb5d
@ -4,7 +4,6 @@ Simplified Pattern assembly (`Builder`)
|
|||||||
from typing import Self, Sequence, Mapping
|
from typing import Self, Sequence, Mapping
|
||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
from functools import wraps
|
|
||||||
|
|
||||||
from numpy.typing import ArrayLike
|
from numpy.typing import ArrayLike
|
||||||
|
|
||||||
@ -189,26 +188,6 @@ class Builder(PortList):
|
|||||||
new = Builder(library=library, pattern=pat, name=name)
|
new = Builder(library=library, pattern=pat, name=name)
|
||||||
return new
|
return new
|
||||||
|
|
||||||
@wraps(Pattern.label)
|
|
||||||
def label(self, *args, **kwargs) -> Self:
|
|
||||||
self.pattern.label(*args, **kwargs)
|
|
||||||
|
|
||||||
@wraps(Pattern.ref)
|
|
||||||
def ref(self, *args, **kwargs) -> Self:
|
|
||||||
self.pattern.ref(*args, **kwargs)
|
|
||||||
|
|
||||||
@wraps(Pattern.polygon)
|
|
||||||
def polygon(self, *args, **kwargs) -> Self:
|
|
||||||
self.pattern.polygon(*args, **kwargs)
|
|
||||||
|
|
||||||
@wraps(Pattern.rect)
|
|
||||||
def rect(self, *args, **kwargs) -> Self:
|
|
||||||
self.pattern.rect(*args, **kwargs)
|
|
||||||
|
|
||||||
@wraps(Pattern.path)
|
|
||||||
def path(self, *args, **kwargs) -> Self:
|
|
||||||
self.pattern.path(*args, **kwargs)
|
|
||||||
|
|
||||||
def plug(
|
def plug(
|
||||||
self,
|
self,
|
||||||
other: Abstract | str | Pattern | TreeView,
|
other: Abstract | str | Pattern | TreeView,
|
||||||
|
@ -235,16 +235,14 @@ class Arc(Shape):
|
|||||||
n_pts = numpy.ceil(2 * pi * max(self.radii) / max_arclen).astype(int)
|
n_pts = numpy.ceil(2 * pi * max(self.radii) / max_arclen).astype(int)
|
||||||
arc_lengths, thetas = get_arclens(n_pts, *a_ranges[0 if inner else 1])
|
arc_lengths, thetas = get_arclens(n_pts, *a_ranges[0 if inner else 1])
|
||||||
|
|
||||||
keep = [0]
|
keep = []
|
||||||
removable = (numpy.cumsum(arc_lengths) <= max_arclen)
|
removable = (numpy.cumsum(arc_lengths) <= max_arclen)
|
||||||
start = 1
|
start = 0
|
||||||
while start < arc_lengths.size:
|
while start < arc_lengths.size:
|
||||||
next_to_keep = start + numpy.where(removable)[0][-1] # TODO: any chance we haven't sampled finely enough?
|
next_to_keep = start + numpy.where(removable)[0][-1] # TODO: any chance we haven't sampled finely enough?
|
||||||
keep.append(next_to_keep)
|
keep.append(next_to_keep)
|
||||||
removable = (numpy.cumsum(arc_lengths[next_to_keep + 1:]) <= max_arclen)
|
removable = (numpy.cumsum(arc_lengths[next_to_keep + 1:]) <= max_arclen)
|
||||||
start = next_to_keep + 1
|
start = next_to_keep + 1
|
||||||
if keep[-1] != thetas.size - 1:
|
|
||||||
keep.append(thetas.size -1)
|
|
||||||
return thetas[keep]
|
return thetas[keep]
|
||||||
|
|
||||||
wh = self.width / 2.0
|
wh = self.width / 2.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user