fix pocket
This commit is contained in:
parent
e13c1e7430
commit
83a4bdebfd
7 changed files with 128 additions and 122 deletions
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
import { base } from '../geo/base.js';
|
||||
import { Layers } from './layers.js';
|
||||
import { Polygon } from '../geo/polygon.js';
|
||||
import { newPoint } from '../geo/point.js';
|
||||
import { Polygon, newPolygon } from '../geo/polygon.js';
|
||||
import { Slice, newSlice, Top, newTop } from './slice.js';
|
||||
import { Widget, newWidget } from './widget.js';
|
||||
|
||||
|
|
@ -192,7 +193,7 @@ function decodePointArray(array) {
|
|||
const points = new Array(length / 3);
|
||||
|
||||
for (let vid=0, pid=0; vid < length; ) {
|
||||
points[pid++] = base.newPoint(array[vid++], array[vid++], array[vid++]);
|
||||
points[pid++] = newPoint(array[vid++], array[vid++], array[vid++]);
|
||||
}
|
||||
|
||||
return points;
|
||||
|
|
@ -207,7 +208,7 @@ function decodePointArray2D(array, z, fn) {
|
|||
for (let vid=0, pid=0; vid < length; ) {
|
||||
points[pid++] = fn ?
|
||||
fn(array[vid++], array[vid++]) :
|
||||
base.newPoint(array[vid++], array[vid++], z);
|
||||
newPoint(array[vid++], array[vid++], z);
|
||||
}
|
||||
|
||||
return points;
|
||||
|
|
@ -334,10 +335,10 @@ registerDecoder(TYPE.POLY, function(v, state) {
|
|||
|
||||
const array = v.array;
|
||||
const length = array.length;
|
||||
const poly = base.newPolygon();
|
||||
const poly = newPolygon();
|
||||
|
||||
for (let vid = 0; vid < length; ) {
|
||||
poly.push(base.newPoint(array[vid++], array[vid++], array[vid++]));
|
||||
poly.push(newPoint(array[vid++], array[vid++], array[vid++]));
|
||||
}
|
||||
|
||||
state.poly[v.id] = poly;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { base } from '../geo/base.js';
|
|||
import { load } from '../load/file.js';
|
||||
import { space } from '../moto/space.js';
|
||||
import { Widget } from './widget.js';
|
||||
import { Packer } from './pack.js';
|
||||
|
||||
import { COLOR, MODES } from './consts.js';
|
||||
import { THREE } from '../ext/three.js';
|
||||
|
|
@ -708,12 +709,12 @@ function platformLayout() {
|
|||
mp = [sz.x, sz.y],
|
||||
ms = [mp[0] / 2, mp[1] / 2],
|
||||
c = Widget.Groups.blocks().sort(),
|
||||
p = new kiri.Pack(ms[0], ms[1], gap).fit(c);
|
||||
p = new Packer(ms[0], ms[1], gap).fit(c);
|
||||
|
||||
while (!p.packed) {
|
||||
ms[0] *= 1.1;
|
||||
ms[1] *= 1.1;
|
||||
p = new kiri.Pack(ms[0], ms[1], gap).fit(c);
|
||||
p = new Packer(ms[0], ms[1], gap).fit(c);
|
||||
}
|
||||
|
||||
for (i = 0; i < c.length; i++) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import { base } from '../geo/base.js';
|
||||
import { verticesToPoints } from '../geo/points.js';
|
||||
import { util as mesh_util } from '../mesh/util.js';
|
||||
|
||||
const { inRange, time } = base.util;
|
||||
const solid_opacity = 1.0;
|
||||
|
|
@ -333,7 +334,7 @@ class Widget {
|
|||
}
|
||||
|
||||
selectFaces(faces) {
|
||||
let groups = mesh.util.facesToGroups(faces || []);
|
||||
let groups = mesh_util.facesToGroups(faces || []);
|
||||
let geo = this.mesh.geometry;
|
||||
geo.clearGroups();
|
||||
for (let group of groups) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue