-
Notifications
You must be signed in to change notification settings - Fork 32
Allow specifying a ratsNestColor on net or a pin with pinAttributes #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sahil-ansari01
wants to merge
1
commit into
tscircuit:main
Choose a base branch
from
sahil-ansari01:fixes#796
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+56
−17
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ export const pcb_trace_route_point_wire = z.object({ | |
| start_pcb_port_id: z.string().optional(), | ||
| end_pcb_port_id: z.string().optional(), | ||
| layer: layer_ref, | ||
| color: z.string().optional(), | ||
| }) | ||
|
|
||
| export const pcb_trace_route_point_via = z.object({ | ||
|
|
@@ -22,6 +23,8 @@ export const pcb_trace_route_point_via = z.object({ | |
| outer_diameter: distance.optional(), | ||
| from_layer: z.string(), | ||
| to_layer: z.string(), | ||
| // Allow color to be specified on vias for type uniformity, though it may be ignored downstream | ||
| color: z.string().optional(), | ||
| }) | ||
|
|
||
| export const pcb_trace_route_point = z.union([ | ||
|
|
@@ -46,7 +49,10 @@ export const pcb_trace = z | |
| should_round_corners: z.boolean().optional(), | ||
| trace_length: z.number().optional(), | ||
| rats_nest_color: z.string().optional(), | ||
| route: z.array(pcb_trace_route_point), | ||
| // Non-empty route to avoid undefined at index 0 in consumers/tests | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here as well. |
||
| route: z.tuple([pcb_trace_route_point]).rest(pcb_trace_route_point), | ||
| // Optional explicit color for entire trace; per-point colors take precedence downstream | ||
| color: z.string().optional(), | ||
| }) | ||
| .describe("Defines a trace on the PCB") | ||
|
|
||
|
|
@@ -61,6 +67,7 @@ export interface PcbTraceRoutePointWire { | |
| start_pcb_port_id?: string | ||
| end_pcb_port_id?: string | ||
| layer: LayerRef | ||
| color?: string | ||
| } | ||
|
|
||
| export interface PcbTraceRoutePointVia { | ||
|
|
@@ -71,6 +78,7 @@ export interface PcbTraceRoutePointVia { | |
| outer_diameter?: Distance | ||
| from_layer: string | ||
| to_layer: string | ||
| color?: string | ||
| } | ||
|
|
||
| export type PcbTraceRoutePoint = PcbTraceRoutePointWire | PcbTraceRoutePointVia | ||
|
|
@@ -96,7 +104,10 @@ export interface PcbTrace { | |
| should_round_corners?: boolean | ||
| trace_length?: number | ||
| rats_nest_color?: string | ||
| route: Array<PcbTraceRoutePoint> | ||
| // At least one route point is required | ||
| route: [PcbTraceRoutePoint, ...PcbTraceRoutePoint[]] | ||
| // Optional explicit color at trace-level | ||
| color?: string | ||
| } | ||
|
|
||
| /** | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ export interface SchematicTraceEdge { | |
| is_crossing?: boolean | ||
| from_schematic_port_id?: string | ||
| to_schematic_port_id?: string | ||
| color?: string | ||
| } | ||
|
|
||
| export interface SchematicTrace { | ||
|
|
@@ -28,36 +29,63 @@ export interface SchematicTrace { | |
| subcircuit_id?: string | ||
| /** Optional for now, but will be required in a future release */ | ||
| subcircuit_connectivity_map_key?: string | ||
| color?: string | ||
| } | ||
|
|
||
| export const schematic_trace = z.object({ | ||
| type: z.literal("schematic_trace"), | ||
| schematic_trace_id: z.string(), | ||
| source_trace_id: z.string().optional(), | ||
| junctions: z.array( | ||
| z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| ), | ||
| edges: z.array( | ||
| z.object({ | ||
| from: z.object({ | ||
| junctions: z | ||
| .tuple([ | ||
| z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| to: z.object({ | ||
| ]) | ||
| .rest( | ||
| z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| is_crossing: z.boolean().optional(), | ||
| from_schematic_port_id: z.string().optional(), | ||
| to_schematic_port_id: z.string().optional(), | ||
| }), | ||
| ), | ||
| ), | ||
| edges: z | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this change, as it is only related to adding color property only. |
||
| .tuple([ | ||
| z.object({ | ||
| from: z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| to: z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| is_crossing: z.boolean().optional(), | ||
| from_schematic_port_id: z.string().optional(), | ||
| to_schematic_port_id: z.string().optional(), | ||
| color: z.string().optional(), | ||
| }), | ||
| ]) | ||
| .rest( | ||
| z.object({ | ||
| from: z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| to: z.object({ | ||
| x: z.number(), | ||
| y: z.number(), | ||
| }), | ||
| is_crossing: z.boolean().optional(), | ||
| from_schematic_port_id: z.string().optional(), | ||
| to_schematic_port_id: z.string().optional(), | ||
| color: z.string().optional(), | ||
| }), | ||
| ), | ||
| subcircuit_id: z.string().optional(), | ||
| // TODO: make required in a future release | ||
| subcircuit_connectivity_map_key: z.string().optional(), | ||
| color: z.string().optional(), | ||
| }) | ||
|
|
||
| export type SchematicTraceInput = z.input<typeof schematic_trace> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary comments.