Compare commits

..

65 Commits

Author SHA1 Message Date
jan
8f9d9d40ab [gdsii_arrow] add gdsii_arrow 2026-01-19 22:13:54 -08:00
ff148c477e [remove_duplicate_vertices] remove the last vertex rather than the first
to better match docs
2026-01-19 22:13:54 -08:00
c93882e8b2 [Polygon.rect] raise a PatternError when given the wrong number of args
instead of assert
2026-01-19 22:13:54 -08:00
jan
fd11df382c [dxf] make sure layer tuple contents are ints 2026-01-19 22:13:54 -08:00
jan
59b871a577 [dxf] don't need to add polygon offset since it's zero 2026-01-19 22:13:54 -08:00
jan
0e109e2a89 update TODO in readme 2026-01-19 22:13:54 -08:00
jan
c22fc723a7 [PortPather] generalize to multi-port functions where possible 2026-01-19 22:13:54 -08:00
jan
cb99505cab [Pattern] use 1-axis instead of axis-1 2026-01-19 22:13:54 -08:00
jan
91aad3b8a3 [AutoTool] S-bend to L-bend fallback does not work yet, should throw an error 2026-01-19 22:13:54 -08:00
jan
3aa0254a47 [Pather / RenderPather] Fix handling of jog polarity 2026-01-19 22:13:54 -08:00
jan
9e1a26e293 [Port] mirror() should not mirror port position, only orientation 2026-01-19 22:13:54 -08:00
jan
2632e333c9 minor readme cleanup 2026-01-19 22:13:54 -08:00
jan
5c8bb642f5 [RenderPather.plug] fix ok_connections param 2026-01-19 22:13:54 -08:00
jan
bb8a182791 cleanup 2026-01-19 22:13:54 -08:00
jan
3dac060246 [PortPather] add some more port-related convenience functions 2026-01-19 22:13:54 -08:00
jan
9384ecd211 [AutoTool / SimpleTool] allow choice between rotating or mirroring bends 2026-01-19 22:13:54 -08:00
jan
5d13269573 [Library.flatten] add dangling_ok param 2026-01-19 22:13:54 -08:00
jan
692198f7b3 [PatherMixin] add thru arg to path_into and rework portlist inheritance 2026-01-19 22:13:54 -08:00
jan
d5679d60a3 [PortPather] add rename_to and rename_from 2026-01-19 22:13:54 -08:00
jan
bcf2441077 [PatherMixin] add at() for generating PortPather 2026-01-19 22:13:54 -08:00
jan
623bd3781d add missing float_raster dep for manhattanize_slow 2026-01-19 22:13:54 -08:00
jan
0cb44e7ac2 [PortPather] add PortPather 2026-01-19 22:13:54 -08:00
jan
209d0cee4e [RenderPather] whitespace 2026-01-19 22:13:54 -08:00
jan
c3bee9608a [plug()] rename inherit_name arg to thru and allow passing a string
Breaking change

Affects Pattern, Builder, Pather, RenderPather
2026-01-19 22:13:54 -08:00
jan
286c7fd2e8 add some whitespace 2026-01-19 22:13:54 -08:00
3f3469006b [Tool / AutoTool / Pather / RenderPather / PatherMixin] add support for S-bends 2026-01-19 22:13:54 -08:00
3533a284fb [Port] add Port.measure_travel() 2026-01-19 22:13:54 -08:00
332f5c3f56 [Tool / Pather] fix some doc typos 2026-01-19 22:13:54 -08:00
0d5fe19353 [Tool / AutoTool] clarify some docstings 2026-01-19 22:13:54 -08:00
f1f760af27 [Pather] clarify a variable name 2026-01-19 22:13:54 -08:00
e229bb4804 [AutoTool] enable S-bends 2026-01-19 22:13:54 -08:00
abd2d18bca [AutoTool / SimpleTool] remove append arg 2026-01-19 22:13:54 -08:00
1cf8f769fc [SimpleTool/AutoTool] clarify some error messages 2026-01-19 22:13:54 -08:00
1d1a4a0e32 [AutoTool/SimpleTool/BasicTool] Rename BasicTool->SimpleTool and remove transition handling. Export AutoTool and SimpleTool at top level. 2026-01-19 22:13:54 -08:00
eff538f348 [AutoTool] pass in kwargs to straight fn call 2026-01-19 22:13:54 -08:00
c65bc3bfd5 [AutoTool] consolidate duplicate code for path() and render() 2026-01-19 22:13:54 -08:00
1ebd4d5b3b [AutoTool] add add_complementary_transitions() 2026-01-19 22:13:54 -08:00
9cb51e86e5 [AutoTool] Use more dataclasses to clarify internal code 2026-01-19 22:13:54 -08:00
51651d0538 [PolyCollection] rename setter arg to placate linter 2026-01-19 22:13:54 -08:00
a7fd07ebec [format_stacktrace] suppress linter 2026-01-19 22:13:54 -08:00
15b3599b3e [AutoTool] support min/max length for straight segments 2026-01-19 22:13:54 -08:00
bb75c7addb [BasicTool/AutoTool] fix port orientation for straight segments when using RenderPather 2026-01-19 22:13:54 -08:00
b7c20c74a8 [AutoTool] Add first pass for AutoTool 2026-01-19 22:13:54 -08:00
4f6c91ebdb [RenderPather] add wrapped label/ref/polygon/rect functions 2026-01-19 22:13:54 -08:00
667885b195 [Pather/RenderPather/PatherMixin] clean up imports 2026-01-19 22:13:54 -08:00
b02ba3ef01 [Pather / RenderPather] move common functionality into PatherMixin; redo hierarchy
- (BREAKING change) Pather.mpath no longer wraps the whole bus into a
container, since this has no equivalent in RenderPather. Possible this
functionality will return in the future
- Removed `tool_port_names` arg from Pather functions
- In general RenderPather should be much closer to Pather now
2026-01-19 22:13:54 -08:00
890ba03340 [pather] code style changes 2026-01-19 22:13:54 -08:00
c753b19d69 [error] also exclude concurrent.futures.process from traces 2026-01-19 22:13:54 -08:00
7042461244 [error] also exclude frames starting with '<frozen' 2026-01-19 22:13:54 -08:00
9b95d37c8f [file.svg] use logger.warning over warnings.warn (for flexibility) 2026-01-19 22:13:54 -08:00
41c34a6e12 [ports] make port mismatch deltas more obvious 2026-01-19 22:13:54 -08:00
abac12b991 [error, ports] Make stack traces more directly reflect teh location of the issue 2026-01-19 22:13:54 -08:00
612c757bd4 misc cleanup: variable naming, typing, comments 2026-01-19 22:13:54 -08:00
f19806e280 [Path / PolyCollection / Polygon] fix order of rotation/offset 2026-01-19 22:13:54 -08:00
8b53f816df [Polygon / Path / PolyCollection] Force polygon/path offset to (0, 0)
And disallow setting it.

This offset was basically just a footgun.
2026-01-19 22:13:54 -08:00
d4035ec8af [Polygon.rect] use floats more explicitly 2026-01-19 22:13:54 -08:00
9484cf7423 Various type-checking improvements 2026-01-19 22:13:54 -08:00
97734297ab [file.gdsii] enable wider annotation key range (to 126 inclusive) 2026-01-19 22:13:54 -08:00
e20bcdc79f [BasicTool] enable straight to handle trees (not just flat patterns) 2026-01-19 22:13:54 -08:00
a16deaf0cf [builder.tools] Handle in_ptype=None 2026-01-19 22:13:54 -08:00
ade8544aca [traits.annotatable] Don't break when setting annotations to None 2026-01-19 22:13:54 -08:00
b226d0421f [shapes] Don't create empty dicts for annotations 2026-01-19 22:13:54 -08:00
jan
e41e91f6e0 [PolyCollection] add PolyCollection shape
based on ndarrays of vertices and offsets
2026-01-19 22:13:09 -08:00
dea3eca178 [utils.curves] ignore re-import of trapeziod 2026-01-19 21:25:30 -08:00
9869f12475 allow annotations to be None
breaking change, but properties are seldom used by anyone afaik
2026-01-19 21:25:30 -08:00
2 changed files with 7 additions and 2 deletions

View File

@ -256,6 +256,11 @@ class Polygon(Shape):
Returns:
A Polygon object containing the requested rectangle
"""
if sum(int(pp is None) for pp in (xmin, xmax, xctr, lx)) != 2:
raise PatternError('Exactly two of xmin, xctr, xmax, lx must be provided!')
if sum(int(pp is None) for pp in (ymin, ymax, yctr, ly)) != 2:
raise PatternError('Exactly two of ymin, yctr, ymax, ly must be provided!')
if lx is None:
if xctr is None:
assert xmin is not None

View File

@ -18,9 +18,9 @@ def remove_duplicate_vertices(vertices: ArrayLike, closed_path: bool = True) ->
`vertices` with no consecutive duplicates. This may be a view into the original array.
"""
vertices = numpy.asarray(vertices)
duplicates = (vertices == numpy.roll(vertices, 1, axis=0)).all(axis=1)
duplicates = (vertices == numpy.roll(vertices, -1, axis=0)).all(axis=1)
if not closed_path:
duplicates[0] = False
duplicates[-1] = False
return vertices[~duplicates]