Offset points are not accurate
Gautam2010 opened this issue · comments
Why my result is not showing accurate
Below Image red is my original border and blue is from Clipper result.
const clipper = await clipperLib.loadNativeClipperLibInstanceAsync(
clipperLib.NativeClipperLibRequestedFormat.AsmJsOnly
);
let path: clipperLib.Path = points;
let offsetInput: clipperLib.OffsetInput = {
data: path,
endType: clipperLib.EndType.ClosedPolygon,
joinType: clipperLib.JoinType.Round
}
let offsetInputs = Array<clipperLib.OffsetInput>();
offsetInputs.push(offsetInput);
let offsetParam: clipperLib.OffsetParams = {
delta: offsetDistance,
offsetInputs: offsetInputs,
}
by the looks of it you might be using integers too close between them. try multiplying your coordinates by 1000 before processing for example to allow them up to 3 decimals