add bounds_check optional flag (default false)

This commit is contained in:
Pim Nelissen
2026-05-03 15:58:38 +02:00
parent 2dd6ab6beb
commit 372082f19b

View File

@ -107,7 +107,8 @@ class LandscapeBuilder:
def set_point_sources(
self,
*sources: AbsolutePointSourceSpec | RelativePointSourceSpec
*sources: AbsolutePointSourceSpec | RelativePointSourceSpec,
bounds_check: bool = False
):
"""Add one or more point sources to the world.
@ -148,7 +149,7 @@ class LandscapeBuilder:
# we dont support -x values, but negative y values are possible as
# the path is centered in the y direction.
if not (
if bounds_check and not (
(0 <= pos[0] <= self._size[0]) and
(-0.5 * self._size[1] <= pos[1] <= 0.5 * self._size[1])
):