V8 is so close for making wiring diagrams. And yet so far

Ok so DPI does not mean what you think it means. DPI of 72 is the legacy way of saying that no DPI value has been set (since systems that talk about DPI have to have some translation value). The only thing that matters is number of pixels. DPI is just a scaling factor you can re scale all you want.

Ok so if your screen isn’t big enough for the render then maybe you can render it in a virtual space that has a bigger screen

1 Like

Thanks, I’m open to suggestions. I just need a productive workflow.

I’ve got several new products getting ready for production and lots to document. I got excited for V8 and the possibility of streamlining the process.

The resulting default Image Size is a function of the DPI and Size Settings in most Image software.

Example (on mac):
PNG from Kicad = 72dpi
In Mac’s default Image-Viewer, I reset it to 144dpi
In LibreOffice, I set it to 288dpi


1 Like

So your image is 15,4686 cm wide if you just scale it down so its 300 dpi which should be sufficient. You can ise kicad-CLI to make the images. And just scale the image down to 24% in Corel and it fills about the short edge width of an A4 with 5 cm margins. Which ought to be big enough.

Even so 300 PPI isnt really set in stone its one of those stop annoying me values. 250 PPI is almost imperceptibly the same quality. Especially if your not printing in a environment where output plates resolution 1200 DPI in which case the LPI value is about 120 so 2.1 times that is 252 which is close to the optimal for the printer. So unless your printing with a 2400 DPI system, or some fancy giclee inkjet with more than 4 color primaries then your resolution is enough.

note: resolution for a pixel image means its pixel dimensions, and output resolution is the conversion factor to going to physical units, also called resolution for the simple reason that in early editors that was the only intended output

1 Like

Thanks, I’ll read this a couple times and try to comprehend. Graphics are my weakest skill, by far.

I’m on Windows, which may be a limitation. I just can’t export anything that maintains details and scale to integrate with my CAD exports. Maybe when the boards arrive I’ll take a high res pic and crop that and import to Corel. There must be a workable solution.

You can export raytracing 3D renders in KiCad nightly versions (8.99) using kicad-cli command-line tool at any specified resolution (pixel count), with transparent background.

3 Likes

Note, once you save a project in V8.99, you can not open it anymore in KiCad V8.0.4. If you did this accidentally, then restore the last backup from KiCad’s backup directory.

If you want to do this intentionally, then you can.

  1. Make a copy of your project. (Or have a decent backup strategy such as git)
  2. Open the copy in V8.99.
  3. Use KiCad-cli etc.
  4. After your exports, delete this whole copy.
  5. Continue working in the stable version of KiCad.

Maybe KiCad-cli of V8.99 also works on files from KiCad V8.0.4. I have not tried it, but it seems worth it to try this out on a copy.

I had never tried a nightly before. I DL and installed. Saved my project to another directory and renamed.
Open in 8.99
My exports are actually lower res now. I’m not sure where I’m going wrong. But, I’m over it. Hours and hours wasted today.

Forgive me, I don’t know what CLI is.

When I switch to raytracing, the entire image is washed out. I turned off shadows, reflections and refractions. Still washed out.

I’ll email PCBway and see what gerber software they use. Maybe I can generate usable graphics files that way.

CLI = Command Line Interface.

kicad-cli is a small command line program that you can use to automate tasks by controlling KiCad from the command line. It has “context sensitive” help built in. That is, if you tell it to do something with a PCB such as an export, and you do not enter more info, then it shows you the options it has available for exporting a pcb.

paul@cezanne:~$ kicad-cli pcb export
Usage: export [--help] {drill,dxf,gerber,gerbers,glb,ipc2581,pdf,pos,step,svg,vrml}

Export utilities (Gerbers, drill, position files, etc)

Optional arguments:
  -h, --help  Shows help message and exits 

Subcommands:
  drill      Generate Drill Files
  dxf        Generate a DXF from a list of layers
  gerber     Plot given layers to a single Gerber file
  gerbers    Plot multiple Gerbers for a PCB, including the ability to use stored board plot settings
  glb        Export GLB (binary GLTF)
  ipc2581    Export the PCB in IPC2581 format
  pdf        Generate PDF from a list of layers
  pos        Generate Position File
  step       Export STEP
  svg        Generate SVG outputs of a given layer list
  vrml       Export VRML

kicad-cli is already a part of KiCad V8 (Maybe even V7) but you apparently need the version from V8.99 to to do the raytrace renderings.

1 Like

Did some experiments.

With the line:

paul@cezanne:~/projects/kicad/display_8x8_595$ kicad-cli-nightly pcb render --width 11000 --height 2000 --zoom 5 display_8x8_595.kicad_pcb -o asdf.jpg

It created a picture from a KiCad V8 project. Picture size is not exactly the 11000 by 2000 pixels I specified, but the 10976 by 1992 resolution is pretty close.

Zoomed in to scale 1:1, some SOT-23 transistors look like:
image

Making a bigger picture also works:

paul@cezanne:~/projects/kicad/display_8x8_595$ kicad-cli-nightly pcb render --width 22000 --height 5000 --zoom 5 display_8x8_595.kicad_pcb -o asdf.jpg

With these settings it generates a picture with a size of:

Rendering time 33,712 s
Actual image size: 21984x4984
Successfully created 3D render image

And a SOT-23 scaled 1:1 looks like:
(Note, this forum software also scales pictures).

I guess that should be enough pixels for you. :slight_smile:

It’s different to Realtime rendering, but you should be able to get better results by tweaking the light configuration in settings.

Try setting “Ambient”, “Top”, “Bottom” lights values to 0, but increase values of other lights to 73 (or even 140) and set Elevation to 45 and -45 degrees.
(based on Proof of concept 3d model screenshot (!529))

Also turn On Refractions to see the tracks under the soldermask.

1 Like

I really appreciate the effort and examples. I agree that those results would be plenty good. I just can’t recreate it on my end.

Here’s a zoomed in export from 3D view. And the exported file in Corel.

It you’ve installed KiCad in C:\Program Files\KiCad\8.99 you should invoke kicad-cli from the command line (cmd.exe) or a Batch file like this:

"C:\Program Files\KiCad\8.99\bin\kicad-cli.exe" pcb render --width 22000 --height 5000 --zoom 5 your_pcb.kicad_pcb -o render.png

or from PowerShell:

& 'C:\Program Files\KiCad\8.99\bin\kicad-cli.exe' pcb render --width 22000 --height 5000 --zoom 5 your_pcb.kicad_pcb -o render.png

Tweak parameters to fit your PCB. To see all parameters, call kicad-cli with only pcb render part.
If the output file format is png, it will have transparent background by default.

Note that I used:kicad-cli-nightly on my linux box.

paul@cezanne:~/projects/kicad/display_8x8_595$ kicad-cli-nightly --version
8.99.0

(And I used it directly on a KiCad V8.0.4 project).

What is the purpose of your “wiring diagram”?

You start with a schematic diagram for your PCB?

I think the OP is referring to an assembly diagram for wiring harnesses.

That is my interpretation too. A picture of the PCB which shows wires connecting to external things such as switches, potentiometers, light bulbs and such. I understand wanting to do this fully in KiCad. Doing this all in the same program eases the workflow for generating documentation. And his opening sentence also says it all:

One thing unclear to me is whether he does this inside the main KiCad project, or in a separate project that is used only for documentation and assembly drawings.

That wouldn’t strictly be within the scope of a PCB design program.
The 3D rendering could be exported via a STEP file into a mechanical CAD program.
I use schematics for making BLOCK diagrams with my custom fake objects.
I also use schematic for illustration of wiring harnesses, and physical box layout. Not pretty, but my people can read them.
However, KiCAD schematic doesn’t have many layers available for different colors, so I use another program for this, with hundreds of layers, of which I use maybe max ten .

How ‘Perfect’ does it really need to be?

This morning I needed to order some more ESP32’s and was checking the one’s I have with the new order (different Brand). I opened my FreeCAD model (my model) and Exported a PNG using FreeCAD’s Part-Design workbench>Tools>Save Image.

click Extended> I selected the largest size (6400x4800). 72dpi

I loaded the PNG into the Schematic and dragged the Handles to resize it. I just can’t imagine needing any graphic with finer quality for documentation or assembly work.

Here’s two screenshots and the Zipped PNG file…

ADDED: I haven’t seen info re OP’s hardware… What’s being used for a monitor? An old Television? :rofl:

ESP32-Mine.png.zip (50.6 KB)