mirror of https://github.com/KLayout/klayout.git
Fixed issue #305 (CIF reader issue with rotated boxes)
This commit is contained in:
parent
630f7e56d8
commit
8f21cdf449
|
|
@ -592,11 +592,13 @@ CIFReader::read_cell (db::Layout &layout, db::Cell &cell, double sf, int level)
|
||||||
double xw = sf * w * 0.5 * rx * n, yw = sf * w * 0.5 * ry * n;
|
double xw = sf * w * 0.5 * rx * n, yw = sf * w * 0.5 * ry * n;
|
||||||
double xh = -sf * h * 0.5 * ry * n, yh = sf * h * 0.5 * rx * n;
|
double xh = -sf * h * 0.5 * ry * n, yh = sf * h * 0.5 * rx * n;
|
||||||
|
|
||||||
|
db::Point c (sf * x, sf * y);
|
||||||
|
|
||||||
db::Point points [4];
|
db::Point points [4];
|
||||||
points [0] = db::Point (x - xw - xh, y - yw - yh);
|
points [0] = c + db::Vector (-xw - xh, -yw - yh);
|
||||||
points [1] = db::Point (x - xw + xh, y - yw + yh);
|
points [1] = c + db::Vector (-xw + xh, -yw + yh);
|
||||||
points [2] = db::Point (x + xw + xh, y + yw + yh);
|
points [2] = c + db::Vector (xw + xh, yw + yh);
|
||||||
points [3] = db::Point (x + xw - xh, y + yw - yh);
|
points [3] = c + db::Vector (xw - xh, yw - yh);
|
||||||
|
|
||||||
db::Polygon p;
|
db::Polygon p;
|
||||||
p.assign_hull (points, points + 4);
|
p.assign_hull (points, points + 4);
|
||||||
|
|
|
||||||
|
|
@ -189,3 +189,8 @@ TEST(lasi)
|
||||||
run_test (_this, tl::testsrc (), "lasi.cif.gz", "lasi_au.gds.gz");
|
run_test (_this, tl::testsrc (), "lasi.cif.gz", "lasi_au.gds.gz");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #305
|
||||||
|
TEST(rot_boxes)
|
||||||
|
{
|
||||||
|
run_test (_this, tl::testsrc (), "issue_305.cif", "issue_305_au.gds");
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
DS 1 10 1;
|
||||||
|
9 test;
|
||||||
|
L TEST;
|
||||||
|
|
||||||
|
(Origin marker)
|
||||||
|
B 1 1 0,0;
|
||||||
|
|
||||||
|
(Draw two offset boxes without rotation)
|
||||||
|
B 10 1 20,-10;
|
||||||
|
B 10 1 20,10;
|
||||||
|
|
||||||
|
(Try drawing the same boxes with rotation)
|
||||||
|
(They appear nearly centered on the origin in Klayout, the offset is wrong?)
|
||||||
|
B 10 1 20,-10 5,-2;
|
||||||
|
B 10 1 20,10 5,2;
|
||||||
|
|
||||||
|
DF;
|
||||||
|
E
|
||||||
Binary file not shown.
Loading…
Reference in New Issue