mirror of https://github.com/KLayout/klayout.git
* Fixed bug #568 (CIF writer issue with small rotation angles) * Fixed the reader bug too which created the rounding issue.
This commit is contained in:
parent
499f47577c
commit
a046457cc5
|
|
@ -581,7 +581,7 @@ CIFReader::read_cell (db::Layout &layout, db::Cell &cell, double sf, int level)
|
|||
|
||||
if (rx >= 0 && ry == 0) {
|
||||
|
||||
cell.shapes ((unsigned int) layer).insert (db::Box (sf * (x - 0.5 * w), sf * (y - 0.5 * h), sf * (x + 0.5 * w), sf * (y + 0.5 * h)));
|
||||
cell.shapes ((unsigned int) layer).insert (db::Box (db::Point (sf * (x - 0.5 * w), sf * (y - 0.5 * h)), db::Point (sf * (x + 0.5 * w), sf * (y + 0.5 * h))));
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ CIFWriter::write (db::Layout &layout, tl::OutputStream &stream, const db::SaveLa
|
|||
}
|
||||
|
||||
// TODO: that can be done smarter ...
|
||||
while (fabs (xa - floor (0.5 + xa)) > 1e-3 || fabs (ya - floor (0.5 + ya)) > 1e-3) {
|
||||
for (int n = 0; n < 20 && (fabs (xa - floor (0.5 + xa)) > 1e-3 || fabs (ya - floor (0.5 + ya)) > 1e-3); ++n) {
|
||||
xa *= 2.0;
|
||||
ya *= 2.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,3 +194,9 @@ TEST(rot_boxes)
|
|||
{
|
||||
run_test (_this, tl::testsrc (), "issue_305.cif", "issue_305_au.gds");
|
||||
}
|
||||
|
||||
// Issue #568
|
||||
TEST(rot_instances)
|
||||
{
|
||||
run_test (_this, tl::testsrc (), "issue_568.cif", "issue_568_au.gds");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
(CIF generated by the cifwrite library);
|
||||
DS2 1 10;
|
||||
9 test_cell2;
|
||||
L L1D0;
|
||||
B 1000 1000 500,500;
|
||||
DF;
|
||||
DS3 1 10;
|
||||
9 test_encore;
|
||||
L L1D0;
|
||||
DF;
|
||||
DS1 1 10;
|
||||
9 test_top_cell;
|
||||
L L1D0;
|
||||
C3 R100000,0 T0,0;
|
||||
C2 R1048576,105207 T0,0;
|
||||
DF;
|
||||
E
|
||||
Binary file not shown.
Loading…
Reference in New Issue