!1243 修复:异型见光面错误

pull/1243/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 008ba02813
commit 8ff2f04442

@ -7,6 +7,7 @@ import { Box3Ext } from "../Box";
import { equaln, XAxis } from "../GeUtils";
import { BoardFaceType } from "./BoardGetFace";
import { Polyline } from "../../DatabaseServices/Entity/Polyline";
import { Contour } from "../../DatabaseServices/Contour";
export interface BoardFaceParams
{
@ -161,7 +162,7 @@ export class Face
//如果不是矩形,用布尔运算,如果
if (!noSideFace.IsRect || !canUseBoxCalc)
{
let c1 = new Polyline().Rectangle(this.Length, this.Width);
let c1 = new Polyline().Rectangle(sideFace.Length, sideFace.Width);
let c2 = noSideFace.LocalBoard.ContourCurve.Clone().ApplyMatrix(diffMtx);
let box = c1.BoundingBox.intersect(c2.BoundingBox);
@ -170,12 +171,17 @@ export class Face
if (equaln(size.x * size.y, 0))
return false;
let pts = c1.IntersectWith(c2, 0);
if (pts.length <= 1) return true;
let con1 = Contour.CreateContour(c1);
let con2 = Contour.CreateContour(c2);
let cs = con1.IntersectionBoolOperation(con2);
new Box3Ext().setFromPoints(pts).getSize(size);
return size.x / sideFace.Length > fuzz;
for (let c of cs)
{
c.BoundingBox.getSize(size);
if (size.x / sideFace.Length > fuzz)
return true;
}
return false;
}
else
{

Loading…
Cancel
Save