|
|
@ -1,5 +1,5 @@
|
|
|
|
import { Box3, Vector3 } from "three";
|
|
|
|
import { Box3, Vector3 } from "three";
|
|
|
|
import { IsBoxAndEntitysIntersect, RecordHingeTrSizeX, SetHingeType, SetNoPareTypeHigneName } from "../../../Add-on/DrawBoard/DrawDoorDrawer/DrawDoorTool";
|
|
|
|
import { BoxIntersectFuzz, IsBoxAndEntitysIntersect, RecordHingeTrSizeX, SetHingeType, SetNoPareTypeHigneName } from "../../../Add-on/DrawBoard/DrawDoorDrawer/DrawDoorTool";
|
|
|
|
import { IsDoor, IsHandle, IsHinge } from "../../../Add-on/HideSelect/HideSelectUtils";
|
|
|
|
import { IsDoor, IsHandle, IsHinge } from "../../../Add-on/HideSelect/HideSelectUtils";
|
|
|
|
import { app } from "../../../ApplicationServices/Application";
|
|
|
|
import { app } from "../../../ApplicationServices/Application";
|
|
|
|
import { EBoardKeyList } from "../../../Common/BoardKeyList";
|
|
|
|
import { EBoardKeyList } from "../../../Common/BoardKeyList";
|
|
|
@ -402,7 +402,8 @@ export class TemplateDrawHingeTool
|
|
|
|
outlinesCache.set(br, grooveOutlines);
|
|
|
|
outlinesCache.set(br, grooveOutlines);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (otherEntBox.clone().intersect(inventedBox).isSolid())
|
|
|
|
//门板不增加误差,防止隔壁门板误关联
|
|
|
|
|
|
|
|
if (otherEntBox.clone().intersect(inventedBox).isSolid() || !IsDoor(br) && otherEntBox.intersectsBox(inventedBox, BoxIntersectFuzz))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const center = inventedBox.getCenter(new Vector3).applyMatrix4(br.OCSInv).setZ(0);
|
|
|
|
const center = inventedBox.getCenter(new Vector3).applyMatrix4(br.OCSInv).setZ(0);
|
|
|
|
if (grooveOutlines.some(c => c.PtInCurve(center)))
|
|
|
|
if (grooveOutlines.some(c => c.PtInCurve(center)))
|
|
|
@ -447,7 +448,8 @@ export class TemplateDrawHingeTool
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!IsHinge(ironware)) continue;
|
|
|
|
if (!IsHinge(ironware)) continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (!IsBoxAndEntitysIntersect(realityBox, [otherEnt])) continue;
|
|
|
|
let isDoor = IsDoor(otherEnt);
|
|
|
|
|
|
|
|
if (!IsBoxAndEntitysIntersect(realityBox, [otherEnt], BoxIntersectFuzz, undefined, isDoor)) continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (IsDoor(otherEnt))
|
|
|
|
if (IsDoor(otherEnt))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -511,7 +513,7 @@ export class TemplateDrawHingeTool
|
|
|
|
realityBox1.translate(new Vector3(0, 0, distance * number));
|
|
|
|
realityBox1.translate(new Vector3(0, 0, distance * number));
|
|
|
|
|
|
|
|
|
|
|
|
let box1Z = inventedBox1.getCenter(new Vector3).z;
|
|
|
|
let box1Z = inventedBox1.getCenter(new Vector3).z;
|
|
|
|
if (box1Z + 100 < doorHight && !IsBoxAndEntitysIntersect(realityBox1, layers))
|
|
|
|
if (box1Z + 100 < doorHight && !IsBoxAndEntitysIntersect(realityBox1, layers, BoxIntersectFuzz))
|
|
|
|
return number * distance;
|
|
|
|
return number * distance;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -522,7 +524,7 @@ export class TemplateDrawHingeTool
|
|
|
|
let realityBox2 = realityBox.clone();
|
|
|
|
let realityBox2 = realityBox.clone();
|
|
|
|
realityBox2.translate(new Vector3(0, 0, distance * -number));
|
|
|
|
realityBox2.translate(new Vector3(0, 0, distance * -number));
|
|
|
|
|
|
|
|
|
|
|
|
if (box2Z - 100 > 0 && !IsBoxAndEntitysIntersect(realityBox2, layers))
|
|
|
|
if (box2Z - 100 > 0 && !IsBoxAndEntitysIntersect(realityBox2, layers, BoxIntersectFuzz))
|
|
|
|
return -number * distance;
|
|
|
|
return -number * distance;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -544,7 +546,7 @@ export class TemplateDrawHingeTool
|
|
|
|
|
|
|
|
|
|
|
|
realityBox1.translate(new Vector3(distance * number, 0, 0));
|
|
|
|
realityBox1.translate(new Vector3(distance * number, 0, 0));
|
|
|
|
|
|
|
|
|
|
|
|
if (box1Z + 100 < doorHight && !IsBoxAndEntitysIntersect(realityBox1, verticals))
|
|
|
|
if (box1Z + 100 < doorHight && !IsBoxAndEntitysIntersect(realityBox1, verticals, BoxIntersectFuzz))
|
|
|
|
return number * distance;
|
|
|
|
return number * distance;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -555,7 +557,7 @@ export class TemplateDrawHingeTool
|
|
|
|
let realityBox2 = realityBox.clone();
|
|
|
|
let realityBox2 = realityBox.clone();
|
|
|
|
realityBox2.translate(new Vector3(distance * -number, 0, 0));
|
|
|
|
realityBox2.translate(new Vector3(distance * -number, 0, 0));
|
|
|
|
|
|
|
|
|
|
|
|
if (box2Z - 100 > 0 && !IsBoxAndEntitysIntersect(realityBox2, verticals))
|
|
|
|
if (box2Z - 100 > 0 && !IsBoxAndEntitysIntersect(realityBox2, verticals, BoxIntersectFuzz))
|
|
|
|
return -number * distance;
|
|
|
|
return -number * distance;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|