fix centering, poly scaling

This commit is contained in:
Stewart Allen 2024-07-30 16:56:34 -04:00
commit e608091603
4 changed files with 23 additions and 6 deletions

View file

@ -81,6 +81,13 @@ class Point {
return this;
}
scale(x = 1,y = 1,z = 1) {
this.x *= x;
this.y *= y;
this.z *= z;
return this;
}
round(precision) {
return newPoint(
this.x.round(precision),

View file

@ -615,6 +615,7 @@ class Polygon {
* @returns {Polygon|Point} a new polygon centered on x=0, y=0, z=0
*/
center(point) {
throw "does not work";
let ap = newPoint(0, 0, 0, null),
np = newPolygon(),
pa = this.points;