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/GeUtils.test.ts

33 lines
843 B

import { Vector3 } from 'three';
import { getLoocAtUpVec } from './../../src/Geometry/GeUtils';
import { rotateLine } from "./../../src/Common/CurveUtils";
test('getLoocAtUpVec', () =>
{
//俯视图 0,1,0
expect(getLoocAtUpVec(new Vector3(0, 0, 1)) /*?*/).toMatchSnapshot();
//仰视图
expect(getLoocAtUpVec(new Vector3(0, 0, -1)) /*?*/).toMatchSnapshot();
//左视图
expect(getLoocAtUpVec(new Vector3(-1, 0, 0)) /*?*/).toMatchSnapshot();
//右视图
expect(getLoocAtUpVec(new Vector3(1, 0, 0)) /*?*/).toMatchSnapshot();
//前视图
expect(getLoocAtUpVec(new Vector3(0, 1, 0)) /*?*/).toMatchSnapshot();
});
test('should behave...', () =>
{
let v = new Vector3(1, 0, 0);
rotateLine(v, 0.5);
expect(v).toMatchSnapshot();
rotateLine(v, -0.5);
expect(v).toMatchSnapshot();
});