pcb-rnd knowledge pool


routing style fixes

routing_styles by Tibor 'Igor2' Palinkas on 2016-08-16

Tags: insight, routing, styles, menufile

node source



Abstract: n/a


Number of styles

In the original code there is a compile-time fixed number (4) of routing styles. This is often not enough for more complex designs. While in theory this limit can be raised, the resulting .pcb files will be incompatible with pcb compilations using a different number of styles.

Pcb-rnd uses a dynamic vector for storing styles and allows any number of styles from 0 up to a very large value (2^31-1). There is no compile-time configurable limit. The number of default styles (and the actual style configuration) is coming from the template pcb file.

Creating a new style in the Route Styles dialog is not "for this session only" anymore - styles are saved with the design.

Pcb-rnd switched to the lihata board format for native file format, saving and loading arbitrary number of routing styles works.

Explicit custom style

PCB had 4 explicit styles and a hidden, implicit style. All drawing action uses the hidden style. When the user selects one of the explicit styles, its properties are copied into the implicit style. Any drawing action uses the implicit style, this it's sort of the "pen style".

In mainline PCB the implicit (or pen) style is hidden. As long as it always matches one of the existing styles, the user doesn't even know about it. However, if there are objects that do not conform to any of the existing styles, it is possible to bump into this. For example:

In contrast, pcb-rnd offers an explicit routing style called <custom> . If SetSame() is invoked on an object that doesn't match any of the existing styles, the <custom> style is selected:

In other words, it is now possible to use the implicit pen style as temporal style, to explicitly set a line width, via diameter before placing a few unusual lines or vias, without having to create a new style. It is also possible to pick up the style of such an unusual object later, without the GUI confusing it with any of the existing styles.

SetSame() bugs fixed

A line does not have drill parameters. When mainline tries to pick up object properties for a line, it will pick thickness and clearance but will leave hole and ring diameters unchanged. This very often results in a mixed style: e.g. "signal" line properties picked up from a line while "power" hole/ring properties left over from the current style selection. Such a mixed pickup will result in the GUI get confused and not selecting any of the styles. The expected behaviour is to select the "signal" style if the line width/clearance matches the parameters of that style, and ignore the drill/ring parameters.

The same mixup happens for picking up arc parameters, and a similar mixup for via parameters (a via doesn't have a line width).

Pcb-rnd fixes this by searching for the matching style using only the parameters that the given object really had. This results in valid style selection the way the user may expect.

save/load and compatibility

Saving a design to the old .pcb format with number of styles not equal to 4 may cause problems when loading with geda/PCB. The rest of these features do not affect compatibility.