remove templateScale

This commit is contained in:
Tony Garnock-Jones 2023-02-14 12:16:40 +01:00
parent e37c7e5998
commit f5f677291d
2 changed files with 4 additions and 10 deletions

View File

@ -142,10 +142,8 @@
SetPen
Home
[ 1.414 1 1 PenScale ] to big
[ 1 1 1 PenScale ] to normal
[ 1 to k k / [dup F] k times drop ] to ff
[ 2 / dup R big 0 F R normal 0 F ] to rr
[ 2 / dup R 0 F R 0 F ] to rr
PenDown
1 ff 90 rr 1 ff 90 rr 1 ff 90 rr 1 ff 90 rr

View File

@ -13,7 +13,6 @@ import { VM as BaseVM, Input, Primitives, Environment } from './cat.js';
export class PenState {
templatePath: Vector3[] = [new Vector3()];
paths: Vector3[][] | null = null;
templateScale = new Vector3(1, 1, 1);
get isDown(): boolean {
return this.paths !== null;
@ -37,8 +36,9 @@ export class PenState {
push(pos: Vector3, q: Quaternion) {
this.templatePath.forEach((p, i) => {
const r = new Vector3();
p.multiplyToRef(this.templateScale, r);
r.rotateByQuaternionToRef(q, r);
// p.multiplyToRef(this.templateScale, r);
// r.rotateByQuaternionToRef(q, r);
p.rotateByQuaternionToRef(q, r);
r.addInPlace(pos);
this.paths![i].push(r);
});
@ -162,10 +162,6 @@ export const TurtlePrimitives: Environment<TurtleVM> = Object.assign({}, Primiti
'ClearPen'() { this.pen.clear(); return []; },
'SetPen'() { this.pen.set(); return []; },
'PenScale'(sx, sy, sz) {
this.pen.templateScale = new Vector3(sx as number, sy as number, sz as number);
return [];
},
'PenDown'() { this.penDown(); return []; },
'PenUp'() { this.penUp(false); return []; },
'Close'() { this.penUp(true); return []; },