From a4a8c7f8d50f03d29ddd65d73815aee0faebd55b Mon Sep 17 00:00:00 2001 From: GrouchyPenguin Date: Thu, 8 Jul 2021 17:14:37 -0700 Subject: [PATCH] Fix quantization error in path widths (#7) --- R/main.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/main.R b/R/main.R index 939fd03..bd71ef4 100644 --- a/R/main.R +++ b/R/main.R @@ -96,6 +96,8 @@ litchi.plan = function(roi, output, # based on angle and width/height offsets # width offsets (between flightlines) nLines = ceiling(width / flightLineDistance) + 1 + # Then need to update flightLineDistance to avoid offset/quantization errors + flightLineDistance = width / (nLines - 1) xWidths = (-nLines/2):(nLines/2) * flightLineDistance xWidths = rep(xWidths, each=2)