Skip to content

Commit e53643f

Browse files
authored
Update building.js
1 parent 0d2615b commit e53643f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/building.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,5 +408,22 @@ class Building {
408408
}
409409
}
410410
}
411+
412+
/**
413+
* Check if any point in a part is within this building's outline.
414+
* It only checknof points are inside, not if crossing events occur, or
415+
* if the part completly surrounds the building.
416+
* @param {BuildingPart} part - the part to be tested
417+
* @returns {bool} is it?
418+
*/
419+
partIsInside(part) {
420+
const shape = part.shape;
421+
for(point of shape.extractPoints().shape) {
422+
if (BuildingPartUtils.surrounds(this.outerShape(point))) {
423+
return true;
424+
}
425+
}
426+
return false;
427+
}
411428
}
412429
export {Building};

0 commit comments

Comments
 (0)