delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2023/10/01/21:24:05

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1696209766; x=1696814566; darn=delorie.com;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=cWfYvRAyTklzda69ZMO6yDXmg3gI+Y+QTqb6kxBDPVA=;
b=dMR+DO4Anmff4mcpYTyC8FthdaQw3jcFiBZgOb1TiZws05DC6tO7ovQSesL2j/JIux
95NVYcTmLHfFOkIziU/1Qxmt8jjAOoviIcThRVFKIFPQ4zSy7JgydqIjRTVEu8FVMX9R
1OmAiEmk7puLEsw9b1EljF/OM3/JfKYc6BEaau0kwfiHOEzAPxbAo29wkxzII17DXLn8
SAVc1lm0oZvzpoMxK5mxDh7EjTEo2T08Cj54C/ALGz7kEZ7bsRSVY5fF/DU9RRaVCVeL
BRQZO+zhvh1dJmaSEe9ozJudt9dvTPwDFbuxqrETRj7hUP3dG8xcUhxa28VAHmxocoDQ
KzAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1696209766; x=1696814566;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=cWfYvRAyTklzda69ZMO6yDXmg3gI+Y+QTqb6kxBDPVA=;
b=BmQxSKvQTa+nThtpmCcJeGt+3G1cxaA2tN9XM47Bjwi2WMhypoJN27tL57NCQvtqJO
qIQ3ji7TQD2Vmz67pEpwZzGt/Oc2q8ssj3HNhRT0pbfIlB5mFRItvShRofvWxxNSHh5Q
RwVxOlsPb4NsKDdjRDkeND3WxlXA0b1TtLyujtBhbReYnUZPZpLJIMfzQmaL8L9vK8Kg
LkWWW/eNJo44DJdMTY2b7W3+5jECHBojlBRB3bFoBVH/H3Hr3h60ROei9127KxixjHSd
Y4YDaGnxlayyuxlda3rLKZjbx98Juc/sTYoEGlO/vNGfgfTTieL24u46R9uy228uyONQ
1rtA==
X-Gm-Message-State: AOJu0YyAzQ+Gc1/iTfTz5pmSXCx4C7Kxph3Uws3N38rPcZclNV3RMeSu
cOC672M6WR/cWLNDEM7+RXqkX6u5ytnlhe//yIqE++aO
X-Google-Smtp-Source: AGHT+IFN5j8OVR4X2Xqr29YsERx2OQk0/yyS0S2b6Ps9DNCCFwRd5oo8Uyyt5e0e+zrY/mxpikGwtgB0gFDJdo+vc4Q=
X-Received: by 2002:a05:6e02:20cb:b0:349:36e1:10fb with SMTP id
11-20020a056e0220cb00b0034936e110fbmr12995607ilq.18.1696209765560; Sun, 01
Oct 2023 18:22:45 -0700 (PDT)
MIME-Version: 1.0
References: <6877754c-dcb7-db34-dd39-419de060ad7a AT linetec DOT nl>
In-Reply-To: <6877754c-dcb7-db34-dd39-419de060ad7a@linetec.nl>
From: "Erich Heinzle (a1039181 AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
Date: Mon, 2 Oct 2023 11:52:34 +1030
Message-ID: <CAHUm0tP6Gwky0CyAFn90Cb-1uc49vy=V0dvwTZcATJFDHrfotQ@mail.gmail.com>
Subject: Re: [geda-user] PCB silk layer image script
To: geda-user <geda-user AT delorie DOT com>
Reply-To: geda-user AT delorie DOT com

--0000000000008a76d10606b19c76
Content-Type: text/plain; charset="UTF-8"

I have three approaches to pcb artwork

The simplest is image2footprint, which works well for bitmap graphics

https://github.com/erichVK5/image2footprint

The catch is, gEDA PCB does not have a distinct soldermask layer that is
editable, limiting the full range of effects possible.

There are better alternatives for pcb-rnd, including the parametric
bitmap() footprint which can be launched from the footprint library window

http://repo.hu/cgi-bin/pool.cgi?project=pcb-rnd&cmd=show&node=bitmap

and for more advanced effects, there is the parametric image2footprint
version for pcb-rnd which does Floyd Steinberg dithering or closest match
to menu selectable silk screen, copper (ENIG vs Pb/Sn) and solder mask
colours

http://repo.hu/projects/edakrill/user/erichvk/footprint/image2footprint.krill.tar.gz

Finally, for vector artwork, there is the inkscape2pcb extension for
Inkscape which can save in gEDA PCB and pcb-rnd file formats. Although
pcb-rnd has native support for gEDA PCB footprints, the inkscape exporter
takes advantage of the polygon in footprint support of pcb-rnd to export
any non self intersecting paths as polygons on a distinct layer as well.
pcb-rnd also allows scaling of any footprint in the buffer.

https://inkscape.org/~erichVK5/%E2%98%85inkscape2pcb

Regards,

Erich




On Sun, 1 Oct 2023 23:50 Richard Rasker (rasker AT linetec DOT nl) [via
geda-user AT delorie DOT com], <geda-user AT delorie DOT com> wrote:

> Hi all,
>
> Every now and then, questions pop up about converting a logo or other
> image into a silk screen element, and many answers involve a more or less
> manual process using Inkscape combined with pstoedit. Also see the thread
> 'PCB jpg to silkscreen' here, starting 7 November 2019.
>
> As I found I had to look up the details again every time, I decided to
> create a script by the name of pcbsilk that automates most of the process
> -- see attached file. It requires imagemagick, potrace and pstoedit to
> work, and accepts several common image formats (JPG, PNM as well as EPS).
>
> How it works:
>
> It first checks whether a width is specified for the resulting silk layer
> element. If no width is specified, it defaults to 40 mm.
>
> Then it checks if the input file is an EPS file already; if not, it uses
> imagemagick's convert to convert the image to PBM format, which is then fed
> to potrace to create an EPS file. The resulting EPS file is then converted
> into a PCB silkscreen element using pstoedit.
>
> But even though it works sort of OK, there are a few annoying things that
> I haven't been able to fix (apart from several smaller refinements):
>
> - When specifying width in millimeters,  things work up to 73 millimeters
> but throw a sort of overflow error above that value:
>
> $ pcbsilk -W 74mm testlogo.jpg
> double free or corruption (!prev)
> /home/richard/scripts/pcbsilk: line 36: 15520 Aborted              (memory
> dumped) pstoedit -q -f "pcbfill" -ssp $silkname.eps $silkname.pcb
>
> The actual size itself does not seem to cause the problem, as inch sizes
> (e.g. -W 74in) work just fine. So it seems that it is the millimeter units
> that somehow have a limited range -- not in potrace (where the width is
> specified), but in pstoedit. I could of course work around the problem by
> converting millimeter sizes into inches before calling pstoedit, so I think
> that's what I'll do.
>
> - Specifying a width of course also does not work for EPS files, as any
> scaling is done before conversion to EPS. Is there a way to specify width
> in pstoedit? Or is there an easy tool to scale an EPS element without
> having to parse the file myself?
>
> - The pstoedit command produces a PCB file with default workspace
> dimensions (6000 x 5000 mil here), with the silk image at the bottom left.
> Is it possible to (temporarily) adjust this default to fit the image size?
>
> Thanks for comments, corrections and of course solutions!
>
> Best regards,
>
> Richard Rasker
>

--0000000000008a76d10606b19c76
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">I have three approaches to pcb artwork<div dir=3D"auto"><=
br></div><div dir=3D"auto">The simplest is image2footprint, which works wel=
l for bitmap graphics</div><div dir=3D"auto"><br></div><div dir=3D"auto"><a=
 href=3D"https://github.com/erichVK5/image2footprint">https://github.com/er=
ichVK5/image2footprint</a><br></div><div dir=3D"auto"><br></div><div dir=3D=
"auto">The catch is, gEDA PCB does not have a distinct soldermask layer tha=
t is editable, limiting the full range of effects possible.</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">There are better alternatives for pcb=
-rnd, including the parametric bitmap() footprint which can be launched fro=
m the footprint library window</div><div dir=3D"auto"><br></div><div dir=3D=
"auto"><a href=3D"http://repo.hu/cgi-bin/pool.cgi?project=3Dpcb-rnd&amp;cmd=
=3Dshow&amp;node=3Dbitmap">http://repo.hu/cgi-bin/pool.cgi?project=3Dpcb-rn=
d&amp;cmd=3Dshow&amp;node=3Dbitmap</a><br></div><div dir=3D"auto"><br></div=
><div dir=3D"auto">and for more advanced effects, there is the parametric i=
mage2footprint version for pcb-rnd which does Floyd Steinberg dithering or =
closest match to menu selectable silk screen, copper (ENIG vs Pb/Sn) and so=
lder mask colours</div><div dir=3D"auto"><br></div><div dir=3D"auto"><a hre=
f=3D"http://repo.hu/projects/edakrill/user/erichvk/footprint/image2footprin=
t.krill.tar.gz">http://repo.hu/projects/edakrill/user/erichvk/footprint/ima=
ge2footprint.krill.tar.gz</a><br></div><div dir=3D"auto"><br></div><div dir=
=3D"auto">Finally, for vector artwork, there is the inkscape2pcb extension =
for Inkscape which can save in gEDA PCB and pcb-rnd file formats. Although =
pcb-rnd has native support for gEDA PCB footprints, the inkscape exporter t=
akes advantage of the polygon in footprint support of pcb-rnd to export any=
 non self intersecting paths as polygons on a distinct layer as well. pcb-r=
nd also allows scaling of any footprint in the buffer.</div><div dir=3D"aut=
o"><br></div><div dir=3D"auto"><a href=3D"https://inkscape.org/~erichVK5/%E=
2%98%85inkscape2pcb">https://inkscape.org/~erichVK5/%E2%98%85inkscape2pcb</=
a><br></div><div dir=3D"auto"><br></div><div dir=3D"auto">Regards,</div><di=
v dir=3D"auto"><br></div><div dir=3D"auto">Erich</div><div dir=3D"auto"><br=
></div><div dir=3D"auto"><br></div><div dir=3D"auto"><br></div></div><br><d=
iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 1 Oc=
t 2023 23:50 Richard Rasker (<a href=3D"mailto:rasker AT linetec DOT nl">rasker AT li=
netec.nl</a>) [via <a href=3D"mailto:geda-user AT delorie DOT com">geda-user AT delor=
ie.com</a>], &lt;<a href=3D"mailto:geda-user AT delorie DOT com">geda-user AT delorie=
.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 =20

   =20
 =20
  <div>
    <p>Hi all,</p>
    <p>Every now and then, questions pop up about converting a logo or
      other image into a silk screen element, and many answers involve a
      more or less manual process using Inkscape combined with pstoedit.
      Also see the thread &#39;PCB jpg to silkscreen&#39; here, starting 7
      November 2019.<br>
    </p>
    <p>As I found I had to look up the details again every time, I
      decided to create a script by the name of pcbsilk that automates
      most of the process -- see attached file. It requires imagemagick,
      potrace and pstoedit to work, and accepts several common image
      formats (JPG, PNM as well as EPS).<br>
    </p>
    <p>How it works:<br>
    </p>
    <p>It first checks whether a width is specified for the resulting
      silk layer element. If no width is specified, it defaults to 40
      mm.</p>
    <p>Then it checks if the input file is an EPS file already; if not,
      it uses imagemagick&#39;s convert to convert the image to PBM format,
      which is then fed to potrace to create an EPS file. The resulting
      EPS file is then converted into a PCB silkscreen element using
      pstoedit.<br>
    </p>
    <p>But even though it works sort of OK, there are a few annoying
      things that I haven&#39;t been able to fix (apart from several smalle=
r
      refinements):</p>
    <p>- When specifying width in millimeters,=C2=A0 things work up to 73
      millimeters but throw a sort of overflow error above that value:</p>
    <blockquote>
      <p><span style=3D"font-family:monospace"><span style=3D"color:#000000=
;background-color:#ffffff">$ pcbsilk -W
            74mm testlogo.jpg =C2=A0</span><br>
          double free or corruption (!prev)
          <br>
          /home/richard/scripts/pcbsilk: line 36: 15520 Aborted
          =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 (memory dumped) pstoedit -q -f &quot;pcbfill&quot; -ssp
          $silkname.eps $silkname.pcb<br>
        </span></p>
    </blockquote>
    <p>The actual size itself does not seem to cause the problem, as
      inch sizes (e.g. -W 74in) work just fine. So it seems that it is
      the millimeter units that somehow have a limited range -- not in
      potrace (where the width is specified), but in pstoedit. I could
      of course work around the problem by converting millimeter sizes
      into inches before calling pstoedit, so I think that&#39;s what I&#39=
;ll
      do.<br>
    </p>
    <p>- Specifying a width of course also does not work for EPS files,
      as any scaling is done before conversion to EPS. Is there a way to
      specify width in pstoedit? Or is there an easy tool to scale an
      EPS element without having to parse the file myself?</p>
    <p>- The pstoedit command produces a PCB file with default workspace
      dimensions (6000 x 5000 mil here), with the silk image at the
      bottom left. Is it possible to (temporarily) adjust this default
      to fit the image size?<br>
    </p>
    <p>Thanks for comments, corrections and of course solutions!</p>
    <p>Best regards,</p>
    <p>Richard Rasker<br>
    </p>
  </div>

</blockquote></div>

--0000000000008a76d10606b19c76--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019