|
|
|
@ -16,6 +16,14 @@ import { INailRule, IShinkOption, LayerNailOption } from "../../UI/Store/BoardIn
|
|
|
|
|
class ActivityLayerBoardTool
|
|
|
|
|
{
|
|
|
|
|
NailRules: INailRule[];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 求面与板的交点 得到板和交点
|
|
|
|
|
* @param face 层板的侧面
|
|
|
|
|
* @param objects 其他板
|
|
|
|
|
* @param br 层板
|
|
|
|
|
* @returns 交点信息(点 实体)
|
|
|
|
|
*/
|
|
|
|
|
private GetBoardIntersection(face: Face, objects: Object3D[], br: Board)
|
|
|
|
|
{
|
|
|
|
|
for (let s of [0.5, 0.1, 0.9])
|
|
|
|
@ -205,19 +213,18 @@ class ActivityLayerBoardTool
|
|
|
|
|
if (face.type === BoardFaceType.Side)
|
|
|
|
|
{
|
|
|
|
|
let shrink = 0;
|
|
|
|
|
if (option)
|
|
|
|
|
if (option)//求内缩值
|
|
|
|
|
{
|
|
|
|
|
shrink = this.GetShrinkDist(face, br, option);
|
|
|
|
|
this.GetShrinkBoardIndexesMap(face, br, shrink, vecIndexMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#region 画层板钉
|
|
|
|
|
if (!nailOption.isDraw) continue;
|
|
|
|
|
if (!nailOption.isInBack && isParallelTo(face.Normal, xVec)) continue;
|
|
|
|
|
|
|
|
|
|
let intersection = this.GetBoardIntersection(face, objects, br);
|
|
|
|
|
if (intersection)
|
|
|
|
|
{
|
|
|
|
|
//防止板件悬空 #I1DPHR
|
|
|
|
|
if (intersection.distance - 1 + shrink >= refDist)
|
|
|
|
|
let intersection = this.GetBoardIntersection(face, objects, br);//射线求交 得到板和交点
|
|
|
|
|
if (!intersection || (intersection.distance - 1 + shrink >= refDist)) //防止板件悬空 #I1DPHR
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
let otherBoard = GetEntity(intersection.object) as Board;
|
|
|
|
@ -266,7 +273,8 @@ class ActivityLayerBoardTool
|
|
|
|
|
for (let nail of nails)
|
|
|
|
|
nailBoardMap.set(nail, otherBoard);
|
|
|
|
|
allNails.push(...nails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.AppendBoard(br, nailBoardMap, allNails);
|
|
|
|
|