Skip to content

Commit 0aa9131

Browse files
committed
Fix IDF import when units are THOU by actually using the scale specified in the file.
1 parent 925a527 commit 0aa9131

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/importidf.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ bool LinkIDF(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
411411
std::vector <std::string> values = splitString(line);
412412
if(values.size() != 4) continue;
413413
int c = stoi(values[0]);
414-
double x = stof(values[1]);
415-
double y = stof(values[2]);
414+
double x = stof(values[1]) * scale;
415+
double y = stof(values[2]) * scale;
416416
double ang = stof(values[3]);
417417
Vector point = Vector::From(x,y,0.0);
418418
Vector pTop = Vector::From(x,y,board_thickness);
@@ -471,9 +471,9 @@ bool LinkIDF(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
471471
case drilled_holes: {
472472
std::vector <std::string> values = splitString(line);
473473
if(values.size() < 6) continue;
474-
double d = stof(values[0]);
475-
double x = stof(values[1]);
476-
double y = stof(values[2]);
474+
double d = stof(values[0]) * scale;
475+
double x = stof(values[1]) * scale;
476+
double y = stof(values[2]) * scale;
477477
bool duplicate = isHoleDuplicate(el, x, y, d / 2);
478478
// Only show holes likely to be useful in MCAD to reduce complexity.
479479
if(((d > 1.7) || (values[5].compare(0,3,"PIN") == 0)

0 commit comments

Comments
 (0)