private void movePathToolStripMenuItem_Click(object sender, EventArgs e) { ThreeFloatPicker tfp = new ThreeFloatPicker(); tfp.Text = "Move / translate toolpath"; tfp.ShowDialog(); if (tfp.DialogResult != DialogResult.OK) { return; } Vector3 translation = new Vector3((float)tfp.X.Value, (float)tfp.Y.Value, (float)tfp.Z.Value); foreach (GCodeCommand cmd in Commands) { if (cmd is Movement) { Movement mv = (Movement)cmd; mv.Start += translation; mv.End += translation; } if (cmd is Arc) { Arc a = (Arc)cmd; a.Center += translation; } } GCodeUpdated(); labelMessage.Text = "Translation successful"; }
private void movePathToolStripMenuItem_Click(object sender, EventArgs e) { ThreeFloatPicker tfp = new ThreeFloatPicker(); tfp.Text = "Move / translate toolpath"; tfp.ShowDialog(); if(tfp.DialogResult != DialogResult.OK) return; Vector3 translation = new Vector3((float)tfp.X.Value, (float)tfp.Y.Value, (float)tfp.Z.Value); foreach(GCodeCommand cmd in Commands) { if (cmd is Movement) { Movement mv = (Movement)cmd; mv.Start += translation; mv.End += translation; } if(cmd is Arc) { Arc a = (Arc)cmd; a.Center += translation; } } GCodeUpdated(); labelMessage.Text = "Translation successful"; }