You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/__test__/Geometry/simplify.test.ts

19 lines
547 B

import { Vector2 } from "three";
import { simplify } from "../../src/Geometry/Simplify";
test('路径简化', () =>
{
let path: Vector2[] = [];
path.push(new Vector2(0, 0));
path.push(new Vector2(3, 1));
path.push(new Vector2(5, 0));
path.push(new Vector2(10, 0));
path.push(new Vector2(15, 5));
path.push(new Vector2(14.5, 6));
path.push(new Vector2(18, 6));
path.push(new Vector2(28, 6));
path.push(new Vector2(28.3, 6));
let sp = simplify(path, 1.5, false);//?
expect(sp).toMatchSnapshot();
});