[instancer.solver] Add a special case

This commit is contained in:
Behdad Esfahbod 2022-08-08 11:55:10 -06:00
parent 245c3e9575
commit 52c791ad1d
2 changed files with 16 additions and 0 deletions

View File

@ -87,6 +87,10 @@ def _solve(tent, axisLimit):
# we clamp +2.0 to the max F2Dot14 (~1.99994) for convenience
upper = axisDef + (axisMax - axisDef) * MAX_F2DOT14
# Special-case if peak is at axisMax.
if axisMax == peak:
upper = peak
loc = (max(axisDef, lower), peak, upper)
# Don't add a dirac delta!

View File

@ -181,6 +181,18 @@ class RebaseTentTest(object):
(1, (1, 1, 1)),
]
),
pytest.param(
(.5, .5, .5), (.25, .35, .5),
[
(1, (1, 1, 1)),
]
),
pytest.param(
(.5, .5, .55), (.25, .35, .5),
[
(1, (1, 1, 1)),
]
),
],
)
def test_rebaseTent(self, tent, axisRange, expected):