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

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)

Thanks for following up. If you look at the diagram I linked in post #8, youā€™ll see the jist of what Iā€™m making. That was used in a DIY guitar amp kit. These days, itā€™s manufacturing diagrams for assemblers.

I do think the image quality that you guys get is sufficient! I just canā€™t get it on my Windows machines. At home, I have a 27" monitor running at 1920 x 1440. At work itā€™s 2560 x 1080.
Iā€™ve tried every method to export except the CLI script.

I did export a STP file from 8.99 and imported into Fusion360. That has been the best image of the pcb so far. I can export it really huge and resample it in Corel. Hereā€™s a clip:

Ultimately, for my purposes, exporting a vector image would by ideal. My CAD images and wiring diagrams exist at 1:1 scale. I often print the diagrams a true to life 1:1 scale. It might sound silly, but youā€™d be amazed how often that answers questions about assembling something. Like which wire does this use? Or, is this resistor 1 watt or 3 watt?
Screenshots are not to scale. I have to crop and resize.

I have the BRD2PDF plugin and love that for the images I give to people populating the boards. They donā€™t need realistic, they need clear, concise part references and values. As PDFā€™s those scale infinitely.

When I deliver a design, compiling a schematic, a board render and wiring diagram into one document is is crucial. Especially when you get into the third or fourth revision of something.

If I can draw wires in Kicad instead of polylines in Corel, Iā€™m doing good. Itā€™s almost there. Some hierarchical layers and preset wire colors and sizes and Iā€™ll never do layouts in Corel again.

Iā€™ve swung back the CAD side of things again and my latest wiring diagram is based on a full 3D assembly. I have the imported STP file of the pc board. I do have STP files of each type of resistor and their value. So I can deliver a diagram with correct color bands on the resistors.

My biggest hurdle remains drawing 3D splines for wires. Especially twisted pairs. Hate, hate, hate it.

There are pros and cons to every approach I guess. At the end of the day, I need a workflow I can use to get things done.
Donā€™t even get me started on G code for the CNCā€¦

What CAD package are you using. Many cads make drawing of a twisted pair really easy. Then just sweep (rail,loft) along one spline with 2 circles (possibly spline on strip) and instruct the software to twist while doing so. Some CAD packages have even wiring functions directly so asking it to wist the pair is just one click

Possibly worth asking how to do it easier in a more suitable forum.

1 Like