Compare commits
2 Commits
7f927c46b3
...
1f6d78386c
Author | SHA1 | Date | |
---|---|---|---|
1f6d78386c | |||
41d670eef3 |
@ -508,10 +508,13 @@ class Pather(Builder):
|
|||||||
if 'bound_type' in kwargs:
|
if 'bound_type' in kwargs:
|
||||||
bound_types.add(kwargs['bound_type'])
|
bound_types.add(kwargs['bound_type'])
|
||||||
bound = kwargs['bound']
|
bound = kwargs['bound']
|
||||||
|
del kwargs['bound_type']
|
||||||
|
del kwargs['bound']
|
||||||
for bt in ('emin', 'emax', 'pmin', 'pmax', 'xmin', 'xmax', 'ymin', 'ymax', 'min_past_furthest'):
|
for bt in ('emin', 'emax', 'pmin', 'pmax', 'xmin', 'xmax', 'ymin', 'ymax', 'min_past_furthest'):
|
||||||
if bt in kwargs:
|
if bt in kwargs:
|
||||||
bound_types.add(bt)
|
bound_types.add(bt)
|
||||||
bound = kwargs[bt]
|
bound = kwargs[bt]
|
||||||
|
del kwargs[bt]
|
||||||
|
|
||||||
if not bound_types:
|
if not bound_types:
|
||||||
raise BuildError('No bound type specified for mpath')
|
raise BuildError('No bound type specified for mpath')
|
||||||
@ -528,11 +531,11 @@ class Pather(Builder):
|
|||||||
if len(ports) == 1 and not force_container:
|
if len(ports) == 1 and not force_container:
|
||||||
# Not a bus, so having a container just adds noise to the layout
|
# Not a bus, so having a container just adds noise to the layout
|
||||||
port_name = tuple(portspec)[0]
|
port_name = tuple(portspec)[0]
|
||||||
return self.path(port_name, ccw, extensions[port_name], tool_port_names=tool_port_names)
|
return self.path(port_name, ccw, extensions[port_name], tool_port_names=tool_port_names, **kwargs)
|
||||||
else:
|
else:
|
||||||
bld = Pather.interface(source=ports, library=self.library, tools=self.tools)
|
bld = Pather.interface(source=ports, library=self.library, tools=self.tools)
|
||||||
for port_name, length in extensions.items():
|
for port_name, length in extensions.items():
|
||||||
bld.path(port_name, ccw, length, tool_port_names=tool_port_names)
|
bld.path(port_name, ccw, length, tool_port_names=tool_port_names, **kwargs)
|
||||||
name = self.library.get_name(base_name)
|
name = self.library.get_name(base_name)
|
||||||
self.library[name] = bld.pattern
|
self.library[name] = bld.pattern
|
||||||
return self.plug(Abstract(name, bld.pattern.ports), {sp: 'in_' + sp for sp in ports.keys()}) # TODO safe to use 'in_'?
|
return self.plug(Abstract(name, bld.pattern.ports), {sp: 'in_' + sp for sp in ports.keys()}) # TODO safe to use 'in_'?
|
||||||
|
@ -111,9 +111,9 @@ def ell(
|
|||||||
|
|
||||||
is_horizontal = numpy.isclose(rotations[0] % pi, 0)
|
is_horizontal = numpy.isclose(rotations[0] % pi, 0)
|
||||||
if bound_type in ('ymin', 'ymax') and is_horizontal:
|
if bound_type in ('ymin', 'ymax') and is_horizontal:
|
||||||
raise BuildError('Asked for {bound_type} position but ports are pointing along the x-axis!')
|
raise BuildError(f'Asked for {bound_type} position but ports are pointing along the x-axis!')
|
||||||
elif bound_type in ('xmin', 'xmax') and not is_horizontal:
|
elif bound_type in ('xmin', 'xmax') and not is_horizontal:
|
||||||
raise BuildError('Asked for {bound_type} position but ports are pointing along the y-axis!')
|
raise BuildError(f'Asked for {bound_type} position but ports are pointing along the y-axis!')
|
||||||
|
|
||||||
direction = rotations[0] + pi # direction we want to travel in (+pi relative to port)
|
direction = rotations[0] + pi # direction we want to travel in (+pi relative to port)
|
||||||
rot_matrix = rotation_matrix_2d(-direction)
|
rot_matrix = rotation_matrix_2d(-direction)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user