UNPKG

@urpflanze/gcode-exporter

Version:
102 lines 2.89 kB
import type { Scene } from '@urpflanze/core'; import type { IGCODEExporterSettings } from './types'; declare class GCODEExporter { static defaults: Required<IGCODEExporterSettings>; static parse(scene: Scene, settings: IGCODEExporterSettings): string; /** * Set units to inches or millimeters. * When unit is set, all positions, offsets, rates, accelerations, etc., specified in G-code parameters are interpreted in that unit. * * @param unit 'millimeters' | 'inches' * @returns */ static setUnit(unit: 'millimeters' | 'inches'): string; /** * In this mode all coordinates are interpreted as relative to the last position. * * @returns */ static useRelativePosition(): string; /** * All coordinates given in G-code are interpreted as positions in the logical coordinate space * * @returns */ static useAbsolutePosition(): string; /** * Up pen and go home * * @param penUpCommand * @returns */ static goHome(penUpCommand: string): Array<string>; /** * Store the origin position that the machine goes to when the {G28} command is issued * * @param x * @param y * @param decimals * @returns */ static setCurrentMachinePosition(x: number, y: number, decimals: number): string; /** * Set the current position to the values specified. * * @param x * @param y * @param decimals * @returns */ static setCurrentWorkspacePosition(x: number, y: number, decimals: number): string; /** * Linear move. * G0 is a rapid moviment (max speed) * G1 moviment of setted velocity * * @param x * @param y * @param decimals * @param velocity * @returns */ static goTo(x: number, y: number, decimals: number, velocity?: number): string; /** * Up the pen, move and down * * @param penUpCommand * @param penDownCommand * @param x * @param y * @param round * @returns */ static moveTo(penUpCommand: string, penDownCommand: string, x: number, y: number, round: number): string[]; /** * goTo alias * * @param x * @param y * @param velocity * @param round * @returns */ static lineTo(x: number, y: number, velocity: number, round: number): string; /** * Generate gcode frm scene * * @param scene * @param settings * @returns */ static generate(scene: Scene, settings: Required<IGCODEExporterSettings>): string[]; static bufferToPoints(buffer: Array<number> | Float32Array): Array<{ x: number; y: number; }>; static pointsToBuffer(points: Array<{ x: number; y: number; }>): Float32Array; } export { GCODEExporter }; //# sourceMappingURL=GCODEExporter.d.ts.map