From 55bf0ebd54ad068b4a19079c17fd56dff7c06d8f Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 28 Jul 2021 09:40:36 -0400 Subject: [PATCH] Corrected the "bridge" operator, which failed to check for "false" tile corners in the check area to find areas needing bridges. This prevents generation of unnecessary bridging geometry; and since the error made the check rotation-dependent, this may resolve some "parent and child disagree on CIF" errors. --- VERSION | 2 +- cif/CIFgen.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 20428cf9..c8233dac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.191 +8.3.192 diff --git a/cif/CIFgen.c b/cif/CIFgen.c index 302651d5..4a9c1780 100644 --- a/cif/CIFgen.c +++ b/cif/CIFgen.c @@ -1840,12 +1840,15 @@ cifBridgeCheckFunc(tile, brcs) switch (dir) { case BRIDGE_NW: /* Ignore tile if NW corner is not in the search area */ + for (tp1 = RT(tile); LEFT(tp1) > LEFT(tile); tp1 = BL(tp1)); if (LEFT(tile) <= brcs->area->r_xbot || TOP(tile) >= brcs->area->r_ytop) break; + /* Check that this is not a false corner */ + else if (TiGetBottomType(tp1) == TiGetTopType(tile)) + break; /* Ignore tile if split, and SE corner is clipped */ if (TiGetRightType(tile) == checktype || TiGetBottomType(tile) == checktype) break; - for (tp1 = RT(tile); LEFT(tp1) > LEFT(tile); tp1 = BL(tp1)); for (tp2 = BL(tile); TOP(tp2) < TOP(tile); tp2 = RT(tp2)); if ((TiGetBottomType(tp1) == checktype) && (TiGetRightType(tp2) == checktype)) @@ -1856,12 +1859,15 @@ cifBridgeCheckFunc(tile, brcs) break; case BRIDGE_SW: /* Ignore tile if SW corner is not in the search area */ + tp1 = LB(tile); if (LEFT(tile) <= brcs->area->r_xbot || BOTTOM(tile) <= brcs->area->r_ybot) break; + /* Check that this is not a false corner */ + else if (TiGetTopType(tp1) == TiGetBottomType(tile)) + break; /* Ignore tile if split, and NE corner is clipped */ if (TiGetRightType(tile) == checktype || TiGetTopType(tile) == checktype) break; - tp1 = LB(tile); tp2 = BL(tile); if ((TiGetTopType(tp1) == checktype) || (TiGetRightType(tp2) == checktype))