fixes #ISB4R

pull/275/head
Zoe 6 years ago
parent a6a85a7374
commit 1f1307221f

@ -79,3 +79,14 @@ test("异型板件,非常规坐标系", () =>
sealingSize = [10, 5, 5, 5, 10, 5];
testBrSealing(br, sealingSize);
})
test("异型板件,非相切圆弧", () =>
{
let data =
[1, "Board", 3, 2, 102, false, 1, 2, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 112.87179487179475, -263.53276353276357, 0, 1], 2, 1200, 600.0000000000001, 18, false, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 5, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [300, 1200], -0.563703247863248, [0, 900], 0, true, 0, 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 112.87179487179475, -263.53276353276357, 0, 1], 1, "右侧板", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[{\"size\":1},{\"size\":2},{\"size\":3},{\"size\":4},{\"size\":5}],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\"}", 0, 0]
//第3段为圆弧
let br = LoadBoardsFromFileData(data)[0];
let sealingSize = [1, 1, 1, 1, 1];
testBrSealing(br, sealingSize);
sealingSize = [3, 5, 3, 3, 3];
testBrSealing(br, sealingSize);
})

@ -18,6 +18,10 @@ exports[`异型板件,常规坐标系 5`] = `2603082.551922608`;
exports[`异型板件,非常规坐标系 1`] = `75939516.39226122`;
exports[`异型板件,非常规坐标系 2`] = `75852693.84266448`;
exports[`异型板件,非常规坐标系 2`] = `75863286.03232267`;
exports[`异型板件,非常规坐标系 3`] = `75675829.72975093`;
exports[`异型板件,非常规坐标系 3`] = `75694680.60847881`;
exports[`异型板件,非相切圆弧 1`] = `635612.2751433643`;
exports[`异型板件,非相切圆弧 2`] = `626242.2196800548`;

@ -4,6 +4,7 @@ import { Polyline } from "../DatabaseServices/Polyline";
import { IntersectOption } from "./IntersectWith";
import { PolyOffsetUtil } from "./OffsetPolyline";
import { Line } from "../DatabaseServices/Line";
import { isParallelTo } from "../Geometry/GeUtils";
/**
*线
@ -17,9 +18,20 @@ export function paragraphCulist(cus: Curve[])
//归类曲线,返回归类是否成功
const paragraph = (cu: Curve, originCu: Curve, cus: Curve[]) =>
{
if (usedCu.has(cu) || (cu instanceof Line && originCu instanceof Line))
const cuIsLine = cu instanceof Line;
const originCuIsLine = originCu instanceof Line;
if (usedCu.has(cu) || (cuIsLine && originCuIsLine))
return false;
if (originCuIsLine !== cuIsLine)
{
if (originCuIsLine && !isParallelTo(originCu.GetFistDeriv(0), cu.GetFistDeriv(0)))
return false;
if (cuIsLine && !isParallelTo(originCu.GetFistDeriv(1), cu.GetFistDeriv(0)))
return false;
}
cus.push(cu);
usedCu.add(cu);
return true;

Loading…
Cancel
Save