Skip to content

Conversation

@kavitasaini1999
Copy link

PR Summary

  • Offset schematic library drawing primitives by each symbol’s reported center so the rendered graphics line up with the schematic component placement grid.
  • Calculate KiCad pin coordinates from center-relative offsets, ensuring generated wires now terminate exactly on the associated symbol pins

fixes #12
/claim #12

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the snapshots, the text is now intersecting the symbol

const cx = center?.x ?? 0
const cy = center?.y ?? 0
const xyPoints = points.map(
(p) => new Xy((p.x - cx) * scale, (p.y - cy) * scale),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use transformation-matrix to perform any operations on points, e.g. the applyToPoint method. Never do point math with multiplication without a transformation-matrix

points: Array<{ x: number; y: number }>,
scale: number,
center: { x: number; y: number } | undefined,
fillType: "none" | "background" = "none",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a 2 parameter rule, if there's more than 2 parameters you must switch to named parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix schematic traces not connected to schematic symbols

2 participants