!2327 修复:圆弧地脚线绘制错误问题

pull/2330/head
林三 1 year ago committed by ChenX
parent 11bfb0f0bb
commit b4b9b066e7

@ -15,7 +15,7 @@ import { RoomFlatFloor } from "../DatabaseServices/Room/Entity/Flat/RoomFlatFloo
import { RoomHolePolyline } from "../DatabaseServices/Room/Entity/Wall/Hole/RoomHolePolyline";
import { JigUtils } from "../Editor/JigUtils";
import { PromptStatus } from "../Editor/PromptResult";
import { equaln, equalv3 } from "../Geometry/GeUtils";
import { equalv3 } from "../Geometry/GeUtils";
import { SurroundOutlineParse } from "../Geometry/SpaceParse/SurroundOutlineParse";
/**构建顶线 */
@ -77,10 +77,11 @@ async function drawCeiling(outline: Polyline, roomFlatEnts: RoomFlatBase[])
let ocsInv = ent.OCSInv;
for (let hole of holes)
{
let entBox = ent.BoundingBoxInOCS;
let box = entBox.intersect(hole.GetBoundingBoxInMtx(ocsInv));
let entBox = ent.BoundingBox;
let box = entBox.intersect(hole.BoundingBox);
if (isFinite(box.min.x) && isFinite(box.max.x))
{
box.applyMatrix4(ocsInv);
let params: number[] = [];
let cachePolyline = [];
let needRemoveIf = [];
@ -96,6 +97,7 @@ async function drawCeiling(outline: Polyline, roomFlatEnts: RoomFlatBase[])
}
if (params.length === 0) continue;
polyline.CloseMark = polyline.IsClose;
let cus = polyline.GetSplitCurves(params);
arrayRemoveIf(cus, (cu) => box.containsPoint(cu.Midpoint));
cachePolyline.push(...cus);
@ -110,15 +112,23 @@ async function drawCeiling(outline: Polyline, roomFlatEnts: RoomFlatBase[])
else name = "吊顶";
let group = curveLinkGroup(polylines);
let sweepSolids: HardwareTopline[] = [];
for (let cus of group)
{
let path = Polyline.Combine(cus);
let sweepSolid = new HardwareTopline(outline, path);
JigUtils.Draw(sweepSolid);
if (!equaln(sweepSolid.BoundingBox.min.x, 0))
sweepSolid.Reverse();
sweepSolid.ApplyMatrix(ent.OCSNoClone);
sweepSolids.push(sweepSolid);
sweepSolid.HardwareOption.name = name;
}
//绘制在地板外围就翻转
let isReverse = !sweepSolids.every(s => s.BoundingBox.min.x >= 0);
for (let sweepSolid of sweepSolids)
{
if (isReverse) sweepSolid.Reverse();
sweepSolid.ApplyMatrix(ent.OCSNoClone);
app.Database.ModelSpace.Append(sweepSolid);
}
}

Loading…
Cancel
Save