You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add default metadata map
* Add show for CoordinateSystem
* Add dark theme and theme preference
* Add CS graphics test
* Add workflow tip for graphical display
* Make render functions return CS, explain VS Code display more
@@ -97,8 +98,6 @@ Unlike `Cell`s, a `CoordinateSystem` is not tied to a database unit (a GDSII con
97
98
98
99
Since `CoordinateSystem`s are intended to be backend-agnostic, a useful pattern is to give
99
100
coordinate objects "semantic" metadata, consisting of a layer name `Symbol` as well as `level` and `index` attributes.
100
-
This metadata can then be processed with designer-provided methods when rendering to an
101
-
output format.
102
101
103
102
```@docs
104
103
SemanticMeta
@@ -108,12 +107,13 @@ output format.
108
107
level
109
108
```
110
109
111
-
This means that a `CoordinateSystem` can be rendered to a `Cell` for output to a GDS format.
112
-
During rendering, an `entity::GeometryEntity` with metadata `SemanticMeta(:ground_plane)` would be mapped to `to_polygons(entity)` with GDS layer number and datatype (for example, `GDSMeta(1,0)`) corresponding to the ground plane according to a mapping function `map_meta` provided to `render!`.
110
+
A `CoordinateSystem` (or any `GeometryStructure`) can be rendered to a `Cell` for output to a GDS format by mapping its metadata to GDSMeta. Specifically, during rendering, an `entity::GeometryEntity` with metadata `SemanticMeta(:my_layer)` will be rendered as one or more polygons (`to_polygons(entity)`). These polygons will have GDSMeta (layer number and datatype) determined by `map_meta(SemanticMeta(:my_layer))`, where `map_meta` is a function supplied as a keyword argument to `render!`. A default hash-based map is supplied to allow quick visualizations when the specific output GDS layers don't matter.
113
111
114
112
```@docs
115
113
Cell(::CoordinateSystem{S}) where {S}
116
114
render!(::Cell, ::DeviceLayout.GeometryStructure)
115
+
DeviceLayout.default_meta_map
116
+
gdslayers(::DeviceLayout.GeometryStructure)
117
117
```
118
118
119
119
Note that `Cell`s inherit the names of rendered `CoordinateSystem`s, so the original coordinate systems ought to have unique names (for example using [`uniquename`](@ref)).
The SVG backend only draws the top-level `Cell`, so it's necessary to [`flatten`](./geometry.md#Flattening) the cell before saving. `flatten` traverses references to place all entities in a single `Cell`, applying transformations as necessary. For further examples, we'll hide the line that flattens and saves to SVG just to display a cell.
99
+
For further examples, we'll hide the line that saves to SVG just to display a cell.
102
100
103
101
We can also add `Cell` references directly to a `Cell`, for example to apply a global rotation:
@@ -167,3 +167,5 @@ main() # execute main() at end of script.
167
167
In a typical workflow, you'll have a text editor open alongside a Julia REPL. You'll save the above code in a file (e.g., `mycad.jl`) and then run `include("mycad.jl")` from the Julia REPL to generate your pattern.
168
168
You'll iteratively revise `mycad.jl` and save your changes.
169
169
Subsequent runs should be several times faster than the first, if you `include` the file again from the same Julia session.
170
+
171
+
If you use a REPL started by the Julia for VS Code extension (`Alt+J Alt+O`), then objects that can be displayed graphically (`Cells` and `CoordinateSystems`) will be shown in a separate tab when returned by REPL execution. This display is not updated interactively with every command, but running `julia> my_cs` will show the latest version. You can zoom in and out to inspect details by holding `Command` (Mac) or `Alt` and scrolling.
0 commit comments