@@ -26,7 +26,7 @@ class Toolpath {
2626 return {
2727 x : pos . x + this . g92offset . x ,
2828 y : pos . y + this . g92offset . y ,
29- z : pos . z + this . g92offset . z ,
29+ z : pos . z + this . g92offset . z
3030 } ;
3131 }
3232 offsetAddLine = ( start , end ) => {
@@ -460,17 +460,17 @@ class Toolpath {
460460 } else {
461461 // The calls to translateX/Y/Z() below are necessary for inch/mm conversion
462462 // params.X/Y/Z must be interpreted as absolute positions, hence the "false"
463- if ( params . X != undefined ) {
463+ if ( params . X !== undefined ) {
464464 const xmm = this . translateX ( params . X , false ) ;
465465 this . g92offset . x += this . position . x - xmm ;
466466 this . position . x = xmm ;
467467 }
468- if ( params . Y != undefined ) {
468+ if ( params . Y !== undefined ) {
469469 const ymm = this . translateY ( params . Y , false ) ;
470470 this . g92offset . y += this . position . y - ymm ;
471471 this . position . y = ymm ;
472472 }
473- if ( params . Z != undefined ) {
473+ if ( params . Z !== undefined ) {
474474 const zmm = this . translateX ( params . Z , false ) ;
475475 this . g92offset . z += this . position . z - zmm ;
476476 this . position . z = zmm ;
@@ -614,7 +614,9 @@ class Toolpath {
614614 addLine = noop ,
615615 addArcCurve = noop
616616 } = { ...options } ;
617- this . g92offset . x = this . g92offset . y = this . g92offset . z = 0 ;
617+ this . g92offset . x = 0 ;
618+ this . g92offset . y = 0 ;
619+ this . g92offset . z = 0 ;
618620
619621 // Position
620622 if ( position ) {
0 commit comments