Draft: suppress patharray offset warnings if values are already zero

See forum topic:
https://forum.freecad.org/viewtopic.php?t=91517
This commit is contained in:
Roy-043
2024-10-21 18:59:12 +02:00
committed by Yorik van Havre
parent 4badd2519e
commit 1fcd316a8b

View File

@@ -463,13 +463,25 @@ def placements_on_path(shapeRotation, pathwire, count, xlate, align,
ends.append(cdist)
if startOffset > (cdist - 1e-6):
_wrn(translate("draft", "Start Offset too large for path length. Using zero instead."))
if startOffset != 0:
_wrn(
translate(
"draft",
"Start Offset too large for path length. Using zero instead."
)
)
start = 0
else:
start = startOffset
if endOffset > (cdist - start - 1e-6):
_wrn(translate("draft", "End Offset too large for path length minus Start Offset. Using zero instead."))
if endOffset != 0:
_wrn(
translate(
"draft",
"End Offset too large for path length minus Start Offset. Using zero instead."
)
)
end = 0
else:
end = endOffset