1
0
Fork 0

fix(workbench): Rotate parts in both directions to align grainline in cutting layout

This commit is contained in:
Benjamin F 2023-03-19 05:51:41 -07:00
parent 2efc3d7f20
commit ae0a311328

View file

@ -167,9 +167,10 @@ export const cutLayoutPlugin = function (material, grainAngle) {
if (partGrain === undefined) return
// the amount to rotate is the difference between this part's grain angle (as drafted) and the fabric's grain angle
let toRotate = Math.abs(grainAngle - partGrain)
let toRotate = grainAngle - partGrain
// don't over rotate
if (toRotate >= 180) toRotate -= 180
else if (toRotate <= -180) toRotate += 180
// if there's no difference, don't rotate
if (toRotate === 0) return