|
|
|
@ -61,6 +61,8 @@ export class RoomWallParse
|
|
|
|
|
*/
|
|
|
|
|
Do(walls: RoomWallBase[], changeWalls: RoomWallBase[] = undefined)
|
|
|
|
|
{
|
|
|
|
|
if (this._IsCacheWallNodePoints) RoomWallParse._CacheWallNodePoints = [];
|
|
|
|
|
|
|
|
|
|
let regionPrase = new RoomRegionParse(this._UpdateDb);
|
|
|
|
|
|
|
|
|
|
const GroupWalls = (walls: RoomWallBase[], fn: (wall: RoomWallBase) => number) =>
|
|
|
|
@ -85,66 +87,8 @@ export class RoomWallParse
|
|
|
|
|
|
|
|
|
|
for (let [, walls] of zgroupMap)
|
|
|
|
|
{
|
|
|
|
|
// 不需要了
|
|
|
|
|
// let tmap = GroupWalls(walls, w => Math.round(w.Thickness * 100));
|
|
|
|
|
// if (tmap.size > 1 && false)//有不同厚度的墙
|
|
|
|
|
// {
|
|
|
|
|
// let orgWalls = walls.concat();
|
|
|
|
|
|
|
|
|
|
// let map = new Map<RoomWallBase, RoomWallBase[]>();
|
|
|
|
|
|
|
|
|
|
// let minThickness = Infinity;
|
|
|
|
|
// for (let [t] of tmap) minThickness = Math.min(t, minThickness);
|
|
|
|
|
// for (let [t, ws] of tmap)
|
|
|
|
|
// {
|
|
|
|
|
// if (t === minThickness) continue;
|
|
|
|
|
// for (let w of ws)
|
|
|
|
|
// {
|
|
|
|
|
// let o = (t - minThickness) / 200;
|
|
|
|
|
// let left = w.GetOffsetCurves(o)[0] as unknown as RoomWallBase;
|
|
|
|
|
// let right = w.GetOffsetCurves(-o)[0] as unknown as RoomWallBase;
|
|
|
|
|
// left.Thickness = minThickness / 100;
|
|
|
|
|
// right.Thickness = minThickness / 100;
|
|
|
|
|
|
|
|
|
|
// walls.push(left, right);
|
|
|
|
|
|
|
|
|
|
// map.set(w, [left, right]);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// this.PraseWallsFromSameFloor(walls, changeWalls);
|
|
|
|
|
|
|
|
|
|
// //天下大一统
|
|
|
|
|
// for (let [w, ws] of map)
|
|
|
|
|
// {
|
|
|
|
|
// for (let ww of ws)
|
|
|
|
|
// {
|
|
|
|
|
// arrayPushArray(w.LeftCurves, ww.LeftCurves);
|
|
|
|
|
// arrayPushArray(w.RightCurves, ww.RightCurves);
|
|
|
|
|
// arrayPushArray(w.LidCurves, ww.LidCurves);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// const RemoveDup = (curves: Curve[]) =>
|
|
|
|
|
// {
|
|
|
|
|
// curves.sort((c1, c2) =>
|
|
|
|
|
// {
|
|
|
|
|
// return ComparePoint("xyz")(c1.StartPoint, c2.StartPoint);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// arrayRemoveDuplicateBySort(curves, (c1, c2) => { return c1.Join(c2) === Status.True; });
|
|
|
|
|
// };
|
|
|
|
|
// RemoveDup(w.LeftCurves);
|
|
|
|
|
// RemoveDup(w.RightCurves);
|
|
|
|
|
// RemoveDup(w.LidCurves);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// regionPrase.Do(orgWalls);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
this.PraseWallsFromSameFloor(walls, changeWalls);
|
|
|
|
|
regionPrase.Do(walls);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
regionPrase.End();
|
|
|
|
@ -152,7 +96,6 @@ export class RoomWallParse
|
|
|
|
|
|
|
|
|
|
PraseWallsFromSameFloor(walls: RoomWallBase[], changeWalls: RoomWallBase[] = undefined)
|
|
|
|
|
{
|
|
|
|
|
if (this._IsCacheWallNodePoints) RoomWallParse._CacheWallNodePoints = [];
|
|
|
|
|
|
|
|
|
|
SHOW_PERF && console.time("wall parse1");
|
|
|
|
|
//{墙}->{轴线} {轴线}->{墙}
|
|
|
|
|