Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scale issue in session #27

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,7 @@ dist
*.diff.svg
dsn-session.json
.yalc
yalc.lock
yalc.lock

#ignore the md files inside the dsn-files-stages folder
dsn-files-stages/*.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function convertCircuitJsonToDsnSession(
const source_ports = su(circuitJson as any).source_port.list()
const nets = su(circuitJson as any).source_net.list()

const transformMmToDsnUnit = scale(1000)
// Only applies to the traces (components are not getting affected)
const transformMmToSesUnit = scale(10000)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the change needed

const session: DsnSession = {
is_dsn_session: true,
filename: dsnPcb.filename || "session",
Expand Down Expand Up @@ -63,7 +64,8 @@ export function convertCircuitJsonToDsnSession(
rp.route_type === "wire",
)
.map((rp) =>
applyToPoint(transformMmToDsnUnit, {
// Circuit JSON space to the SES space
applyToPoint(transformMmToSesUnit, {
x: rp.x,
y: rp.y,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function convertDsnSessionToCircuitJson(
dsnInput: DsnPcb,
dsnSession: DsnSession,
): AnyCircuitElement[] {
// 1mm is 10000um in Ses file
const transformUmToMm = scale(1 / 10000)

if (debug.enabled) {
Expand Down
Loading
Loading