Skip to content

Commit e5a29c3

Browse files
authored
Add alternate names to Inskcape selectors, update help page with Inkscape support (#15)
* Add Inkscape label selectors for non-dot versions * Update help page for Inkscape support
1 parent 60de56f commit e5a29c3

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

web/help.html

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,64 @@ <h1>About Gingerbread</h1>
1717
acknowledgements are <a href="#copyright">at the bottom of this page</a>.</p>
1818

1919
<h1>Using Gingerbread</h1>
20-
<p>At the moment, Gingerbread is intended to work with SVGs created in Affinity Designer. You'll need to make sure your design matches what Gingerbread expects.</p>
20+
<p>At the moment, Gingerbread is intended to work with SVGs created in Affinity Designer or Inkscape. You'll need to make sure your design matches what Gingerbread expects.
21+
If using Inkscape, saving your file as an <strong>Inkscape SVG</strong> is necessary to preserve the layer names.</p>
2122

2223
<h2>Page settings</h2>
2324
<p>First, it's <strong>highly recommended</strong> to change your page settings to use millimeters and <code>2540</code> DPI, as shown here:</p>
2425
<img src="./images/affinity-page-settings.png">
2526
<p>You might be wondering why that specific DPI? Well, <code>2540</code> DPI happens to be <code>1000</code> dots per mm, which helpfully avoids rounding issues when
26-
exporting the design from Affinity and when converting the outline and drills. You can use other DPIs by changing the DPI setting in Gingerbread once your design is loaded.
27+
exporting the design from your vector editor and when converting the outline and drills. You can use other DPIs by changing the DPI setting in Gingerbread once your design is loaded.
2728
</p>
2829
<p>On very slim designs, you might be experiencing issues where the drill holes on either the <code>Drills</code> or <code>Edge.Cuts</code> layers become off-centered from their
2930
intended placement. In that case it'll help to extend the canvas size inside Affinity to be square. Make sure to select "Anchor on page" to preserve your designs aspect ratio.
3031
</p>
3132

3233
<h2>Creating an outline</h2>
33-
<p>The outline should be drawn on a layer named <code>Edge.Cuts</code> in Affinity. Gingerbread handles this layer in a specific way to make sure that there is a 1-to-1 match
34-
between the size and units in Affinity and KiCAD. This approach can't handle as many complex edge cases as the rasterization approach used by the graphic layers, but as
34+
<p>The outline should be drawn on a layer named <code>Edge.Cuts</code> in your vector editor. Gingerbread handles this layer in a specific way to make sure that there is a 1-to-1 match
35+
between the size and units in the SVG and KiCAD. This approach can't handle as many complex edge cases as the rasterization approach used by the graphic layers, but as
3536
long as your paths have been converted to curves it should handle them well. The outline layer can contain multiple curves, with inside curves getting converted to
3637
"cut-outs".</p>
3738

3839
<h2>Graphics layers</h2>
39-
<p>Non-transparent areas on layers named <code>F.SilkS</code>, <code>B.SilkS</code>, <code>F.Cu</code>, and <code>B.Cu</code> in Affinity are converted to their respective
40+
<p>Non-transparent areas on layers named <code>F.SilkS</code>, <code>B.SilkS</code>, <code>F.Cu</code>, and <code>B.Cu</code> in the SVG are converted to their respective
4041
layers in KiCAD. Note that <code>F.Mask</code> and <code>B.Mask</code> are "inverted" like they are in KiCAD, meaning that non-transparent areas indicate where to
41-
<strong>remove<strong> the soldermask- the preview in Gingerbread will shows the mask layers as they would appear on the printed board.
42+
<strong>remove</strong> the soldermask- the preview in Gingerbread will shows the mask layers as they would appear on the printed board.
4243
</p>
4344
<p>Gingerbread converts these layers by rasterizing all the items on each layer to black and white, re-tracing the raster image to polygons, and placing the resulting
4445
polygons into KiCAD. While this might seem odd, it works extremely well for a variety of SVGs.</p>
4546

4647
<h2>Drills</h2>
47-
<p>Items on the layer named <code>Drills</code> in Affinity are also handled in a specific way. Gingerbread walks through all of the shapes in that layer and converts
48+
<p>Items on the layer named <code>Drills</code> in the SVG are also handled in a specific way. Gingerbread walks through all of the shapes in that layer and converts
4849
<strong>only circles</strong> into corresponding non-plated through hole drills in KiCAD. Just as with the board outline, this is done to preserve position and size between
49-
Affinity and KiCAD.
50+
the SVG and KiCAD.
5051
</p>
5152

5253
<h2>Exporting your design</h2>
54+
<h3>Affinity Designer</h3>
5355
<p>When exporting you design to an SVG for Gingerbread, click the <strong>More</strong> button and setup the export parameters as shown below so that "Rasterize" is set to
5456
"Nothing", "Export text as curves" is checked, and "Flatten transforms" is checked.</p>
5557
<img src="./images/affinity-export-settings.png">
5658
<p>You can save this as a preset to avoid having to change these every time you export.</p>
59+
<h3>Inkscape</h3>
60+
<p><em>Note: Inkscape support is new and relatively untested. Please do try it out, and if you run into problems,
61+
<a href="https://github.com/wntrblm/Gingerbread/issues">open an issue on Github</a> with info on what went wrong!</em></p>
62+
<p>Select <strong>File-&gt;Save As</strong> (or <strong>Save a Copy</strong>) and select <strong>Inkscape SVG (*.svg)</strong>
63+
from the filetype dropdown in the lower right. To ensure fonts and text are preserved as-is, we recommend converting text to paths before saving:
64+
<ol>
65+
<li>Select a single text item (doesn't matter which, as long as it's text)</li>
66+
<li>Click <strong>Edit-&gt;Select Same-&gt;Object Type</strong> or press <strong>Shift+Alt+A</strong> to select all text objects</li>
67+
<li>Convert them all to paths by clicking <strong>Path-&gt;Object to Path</strong> or pressing <strong>Shift+Ctrl+C</strong>.</li>
68+
</ol>
69+
</p>
5770

5871
<h2>Converting your design</h2>
5972
<p>Once the SVG is exported, drag and drop it onto the Gingerbread web page. Once loaded, you should see a preview of your design. Use the options in the right pane to
6073
configure the KiCAD output and validate the preview. Once you're ready, click the "Convert" button and your design will be copied to your clipboard, ready to paste directly
6174
into KiCAD's PCBNew.</p>
6275

6376
<h2>Copyright and acknowledgements</h2>
64-
<p>Gingerbread is (c) 2022 by Winterbloom LLC & Alethea Katherine Flowers</p>
77+
<p>Gingerbread is (c) 2022 by Winterbloom LLC &amp; Alethea Katherine Flowers</p>
6578

6679
<p>Gingerbread is available under the MIT License:</p>
6780

web/scripts/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,57 +23,57 @@ class Design {
2323
{
2424
name: "Drill",
2525
type: "drill",
26-
selector: "#Drill, #Drills, [*|label=\"Drills\"]",
26+
selector: "#Drill, #Drills, [*|label=\"Drill\"], [*|label=\"Drills\"]",
2727
color: "Fuchsia",
2828
},
2929
{
3030
name: "FSilkS",
3131
type: "raster",
32-
selector: "#FSilkS, #F\\.SilkS, [*|label=\"F\\.SilkS\"]",
32+
selector: "#FSilkS, #F\\.SilkS, [*|label=\"FSilkS\"], [*|label=\"F\\.SilkS\"]",
3333
color: "white",
3434
number: 3,
3535
},
3636
{
3737
name: "FMask",
3838
type: "raster",
39-
selector: "#FMask, #F\\.Mask, [*|label=\"F\\.Mask\"]",
39+
selector: "#FMask, #F\\.Mask, [*|label=\"FMask\"], [*|label=\"F\\.Mask\"]",
4040
color: "black",
4141
is_mask: true,
4242
number: 5,
4343
},
4444
{
4545
name: "FCu",
4646
type: "raster",
47-
selector: "#FCu, #F\\.Cu, [*|label=\"F\\.Cu\"]",
47+
selector: "#FCu, #F\\.Cu, [*|label=\"FCu\"], [*|label=\"F\\.Cu\"]",
4848
color: "gold",
4949
number: 1,
5050
},
5151
{
5252
name: "BCu",
5353
type: "raster",
54-
selector: "#BCu, #B\\.Cu, [*|label=\"B\\.Cu\"]",
54+
selector: "#BCu, #B\\.Cu, [*|label=\"BCu\"], [*|label=\"B\\.Cu\"]",
5555
color: "gold",
5656
number: 2,
5757
},
5858
{
5959
name: "BMask",
6060
type: "raster",
61-
selector: "#BMask, #B\\.Mask, [*|label=\"B\\.Mask\"]",
61+
selector: "#BMask, #B\\.Mask, [*|label=\"BMask\"], [*|label=\"B\\.Mask\"]",
6262
color: "black",
6363
is_mask: true,
6464
number: 6,
6565
},
6666
{
6767
name: "BSilkS",
6868
type: "raster",
69-
selector: "#BSilkS, #B\\.SilkS, [*|label=\"B\\.SilkS\"]",
69+
selector: "#BSilkS, #B\\.SilkS, [*|label=\"BSilkS\"], [*|label=\"B\\.SilkS\"]",
7070
color: "white",
7171
number: 4,
7272
},
7373
{
7474
name: "EdgeCuts",
7575
type: "vector",
76-
selector: "#EdgeCuts, #Edge\\.Cuts, [*|label=\"Edge\\.Cuts\"]",
76+
selector: "#EdgeCuts, #Edge\\.Cuts, [*|label=\"EdgeCuts\"], [*|label=\"Edge\\.Cuts\"]",
7777
color: "PeachPuff",
7878
force_color: true,
7979
number: 7,

web/styles/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ body {
163163
margin: 1rem auto;
164164
}
165165

166-
.content h1, .content h2 {
166+
.content h1, .content h2, .content h3 {
167167
color: var(--color-Neptune);
168168
}
169169

0 commit comments

Comments
 (0)