← Back to team overview

kicad-developers team mailing list archive

Re: Wiring logic/algorithm

 

Hi,

On 03.08.2017 07:09, Arun Kumar wrote:

> Could you please let me know the wiring logic used in kicad. Like how
> the wire is drawn uisng mouse movement and clicks.

The first click starts a wire, which already has two segments, one
horizontal, one vertical, with the first segment being the longer one
initially.

Moving the mouse then adjusts the length of both at once. If the first
segment disappears, they switch places (so if you start horizontal and
pass through the point over the beginning, the vertical segment becomes
first).

Clicking fixes the point between the two segments currently being
edited, and adds another segment at the end, which then has to be at a
90 degree angle.

Clicking on a connection point (end of another wire or end of a
component pin) ends the wire. If you want to end the current wire
without connecting anywhere, double-click.

> Also the wiring is rerouted when the components are move around. Could
> you please explain the under lying logic and algorithm. If possible
> please guide me to the relevant code of kicad.

When you move a component ('m' key), nothing else moves. When you grab a
component ('g' key), all wires that are already connected remain
connected, and the last segment that connects to the component is adjusted.

   Simon

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References