mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-07 11:31:08 +02:00
* 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:
@@ -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");
|
||||
}
|
||||
|
||||
Vendored
+17
@@ -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
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user