MCPcopy Index your code
hub / github.com/cncjs/gcode-toolpath / setPosition

Method setPosition

src/Toolpath.js:679–691  ·  view source on GitHub ↗
(...pos)

Source from the content-addressed store, hash-verified

677 return this.modal.plane === 'G19';
678 }
679 setPosition(...pos) {
680 if (typeof pos[0] === 'object') {
681 const { x, y, z } = { ...pos[0] };
682 this.position.x = (typeof x === 'number') ? x : this.position.x;
683 this.position.y = (typeof y === 'number') ? y : this.position.y;
684 this.position.z = (typeof z === 'number') ? z : this.position.z;
685 } else {
686 const [x, y, z] = pos;
687 this.position.x = (typeof x === 'number') ? x : this.position.x;
688 this.position.y = (typeof y === 'number') ? y : this.position.y;
689 this.position.z = (typeof z === 'number') ? z : this.position.z;
690 }
691 }
692 translateX(x, relative) {
693 if (x !== undefined) {
694 x = this.isImperialUnits() ? in2mm(x) : x;

Callers 3

ToolpathClass · 0.95
constructorMethod · 0.95
index.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected