修正错误.

pull/80/head
ChenX 6 years ago
parent e8b6e85804
commit 47e63c9e02

@ -1,6 +1,7 @@
import { Vector3 } from 'three'; import { Vector3 } from 'three';
import { Arc } from '../../src/DatabaseServices/Arc'; import { Arc } from '../../src/DatabaseServices/Arc';
import { equaln, equalv3 } from '../../src/Geometry/GeUtils'; import { equaln, equalv3 } from '../../src/Geometry/GeUtils';
import { Status } from '../../src/Common/Status';
test("三点共线", () => test("三点共线", () =>
{ {
@ -193,8 +194,7 @@ test('圆弧合并', () =>
let arc2 = new Arc(new Vector3(), 1, 3, 4); let arc2 = new Arc(new Vector3(), 1, 3, 4);
//成了一个圆 //成了一个圆
expect(arc.Join(arc2)).toBeTruthy(); expect(arc.Join(arc2)).toBe(Status.ConverToCircle);
expect(equaln(arc.AllAngle, Math.PI * 2)).toBeTruthy();
arc = new Arc(new Vector3(), 1, 0, 1).Reverse(); arc = new Arc(new Vector3(), 1, 0, 1).Reverse();
arc2 = new Arc(new Vector3(), 1, 0.5, 0.2).Reverse(); arc2 = new Arc(new Vector3(), 1, 0.5, 0.2).Reverse();
@ -287,7 +287,5 @@ test('容差相接', () =>
arc2.StartAngle = 1; arc2.StartAngle = 1;
arc2.EndAngle = 0; arc2.EndAngle = 0;
expect(arc.Join(arc2)).toBeTruthy(); expect(arc.Join(arc2)).toBe(Status.ConverToCircle);
expect(arc.AllAngle).toBe(Math.PI * 2);
}); });

@ -242,7 +242,7 @@ export class Line extends Curve
this.Extend(param1); this.Extend(param1);
if (param2 > 1) if (param2 > 1)
this.Extend(param2); this.Extend(param2);
return Status.False; return Status.True;
} }
} }
return Status.False; return Status.False;

@ -12,6 +12,7 @@ import { equaln, equalv2, equalv3 } from "../Geometry/GeUtils";
import { EBox, SortEntityByBox } from "../Geometry/SortEntityByBox"; import { EBox, SortEntityByBox } from "../Geometry/SortEntityByBox";
import { IsPtsAllOutOrOnReg } from "./BoolOperateUtils"; import { IsPtsAllOutOrOnReg } from "./BoolOperateUtils";
import { IntersectOption } from "./IntersectWith"; import { IntersectOption } from "./IntersectWith";
import { Status } from "../Common/Status";
interface offsetRes interface offsetRes
{ {
@ -125,7 +126,7 @@ export class PolyOffsetUtil
if (c2b.min.y - 1e-6 > c1b.max.y) if (c2b.min.y - 1e-6 > c1b.max.y)
continue; continue;
if (c1.Join(c2)) if (c1.Join(c2) === Status.True)
{ {
this.m_RetCurves.splice(j, 1); this.m_RetCurves.splice(j, 1);
c1b = c1.BoundingBox; c1b = c1.BoundingBox;

Loading…
Cancel
Save