Shared-Wall Normalisation
Shared wall-face detection and normalisation.
Architectural room polygons commonly follow opposite faces of the same physical wall. This module identifies compatible parallel overlaps and moves accepted pairs to one common midline. Rejected candidates are retained as diagnostic metadata so uncertain geometry can be reviewed without silently changing room boundaries.
SharedWallCandidate
dataclass
A candidate pair of wall faces that may represent one physical wall.
Source code in src/floorplan_extractor/shared_walls.py
95 96 97 98 99 100 101 102 103 104 105 106 107 | |
SharedWallConfig
dataclass
Configuration for optional shared-wall normalisation.
Attributes:
| Name | Type | Description |
|---|---|---|
enabled |
bool
|
Whether shared-wall normalisation should run. |
min_gap |
float
|
Minimum distance between paired wall faces. |
max_gap |
float
|
Maximum distance between paired wall faces. |
angle_tolerance_degrees |
float
|
Maximum angle difference for wall faces to be considered parallel. |
min_overlap_ratio |
float
|
Minimum projected overlap ratio required for pairing. |
min_overlap_length |
float
|
Minimum projected overlap length required for pairing. |
canonical_line |
str
|
Strategy for choosing the replacement shared wall line. |
Source code in src/floorplan_extractor/shared_walls.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
SharedWallDetectionResult
dataclass
Accepted and rejected shared-wall records for downstream diagnostics.
Source code in src/floorplan_extractor/shared_walls.py
133 134 135 136 137 138 | |
SharedWallPairMetrics
dataclass
Geometric measurements for a paired wall-face comparison.
Source code in src/floorplan_extractor/shared_walls.py
123 124 125 126 127 128 129 130 | |
SharedWallRejection
dataclass
A rejected wall-face pair with diagnostic context.
Source code in src/floorplan_extractor/shared_walls.py
110 111 112 113 114 115 116 117 118 119 120 | |
WallSegment
dataclass
A straight exterior segment from one room polygon.
Source code in src/floorplan_extractor/shared_walls.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
key
property
Return a stable key for matching and ambiguity checks.
candidate_midline(candidate)
Return the canonical midline for an accepted shared-wall candidate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candidate
|
SharedWallCandidate
|
Candidate whose paired wall-face overlap should be represented. |
required |
Returns:
| Type | Description |
|---|---|
LineString
|
Line segment halfway between the paired overlapping wall faces. |
Source code in src/floorplan_extractor/shared_walls.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | |
detect_shared_wall_candidates(rooms, config)
Detect possible shared wall-face pairs without mutating room geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rooms
|
GeoDataFrame
|
Room polygons to inspect. The GeoDataFrame index is used as the room identifier in returned records. |
required |
config
|
SharedWallConfig
|
Geometric thresholds controlling candidate detection. |
required |
Returns:
| Type | Description |
|---|---|
SharedWallDetectionResult
|
Accepted candidates and rejected pair records. |
Source code in src/floorplan_extractor/shared_walls.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
normalise_shared_walls(rooms, config, detection=None)
Move accepted shared wall-face overlaps to a common midline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rooms
|
GeoDataFrame
|
Labelled room polygons to normalise. |
required |
config
|
SharedWallConfig
|
Shared-wall configuration. If disabled, geometries are not changed. |
required |
detection
|
SharedWallDetectionResult or None
|
Candidate detection output. If omitted and config is enabled, detection
is run using |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A copy of |
Source code in src/floorplan_extractor/shared_walls.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
rejection_overlap_lines(rejection)
Return source-wall lines clipped to a rejected pair's projected overlap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rejection
|
SharedWallRejection
|
Rejected wall-face pair to represent. |
required |
Returns:
| Type | Description |
|---|---|
tuple[LineString, LineString]
|
Corresponding overlap portions on the first and second wall faces. |
Source code in src/floorplan_extractor/shared_walls.py
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |