修复层间通行空间高度

This commit is contained in:
tian 2026-02-24 18:36:15 +08:00
parent dda04250b0
commit 369605e12f

View File

@ -1496,16 +1496,16 @@ namespace NavisworksTransport
else if (visualization.PathRoute.PathType == NavisworksTransport.PathType.Hoisting)
{
// 吊装路径:根据段类型设置偏移
// 起吊/下降段:底面对齐起点/终点,不需要偏移
// 水平段和层间过渡:顶面中心对齐路径点,向下偏移半个高度
if (isVerticalSegment && isFirstOrLastSegment)
if (isVerticalSegment)
{
// 起吊段或下降段:底面对齐地面
// 所有垂直段(起吊、下降、层间过渡):顶面在高点,不需要偏移
// 起吊/下降段:底面在地面(起点/终点)
// 层间过渡:底面在低点以下物体长度(通过延伸实现)
verticalOffset = 0;
}
else
{
// 水平段或层间过渡:顶面中心对齐路径点
// 水平段:顶面中心对齐路径点,向下偏移半个高度
verticalOffset = -height / 2.0;
}
}
@ -1910,16 +1910,47 @@ namespace NavisworksTransport
adjustedEndPoint = endPoint.Position;
}
// 🔥 通行空间包裹调整:水平段起点和终点延伸以完全包裹物体(仅通行空间)
if (_showObjectSpace && !isVerticalSegment)
// 🔥 通行空间包裹调整:水平段和层间垂直过渡延伸以完全包裹物体(仅通行空间)
if (_showObjectSpace)
{
// 沿路径方向的物体尺寸吊装路径根据是否转折90度选择
double alongPathSize = _passageAlongPath;
if (visualization.PathRoute.PathType == NavisworksTransport.PathType.Hoisting)
if (!isVerticalSegment)
{
alongPathSize = isTurn90Horizontal ? _passageAcrossPath : _objectLength;
// 水平段:沿路径方向延伸
double alongPathSize = _passageAlongPath;
if (visualization.PathRoute.PathType == NavisworksTransport.PathType.Hoisting)
{
alongPathSize = isTurn90Horizontal ? _passageAcrossPath : _objectLength;
}
ExtendLineSegmentForObjectSpace(ref adjustedStartPoint, ref adjustedEndPoint, alongPathSize);
}
ExtendLineSegmentForObjectSpace(ref adjustedStartPoint, ref adjustedEndPoint, alongPathSize);
else if (isVerticalSegment && !isFirstOrLastSegment)
{
// 层间垂直过渡:通行空间总高度 = 层间路径高度 + 物体高度
// 顶面中心 = 路径高点,底面中心 = 路径低点向下物体高度
bool isStartHigher = adjustedStartPoint.Z > adjustedEndPoint.Z;
if (isStartHigher)
{
// 起点是高点,终点是低点
// 顶面在起点,底面在终点向下延伸物体高度
adjustedEndPoint = new Point3D(
adjustedEndPoint.X,
adjustedEndPoint.Y,
adjustedEndPoint.Z - _objectHeight
);
}
else
{
// 终点是高点,起点是低点
// 顶面在终点,底面在起点向下延伸物体高度
adjustedStartPoint = new Point3D(
adjustedStartPoint.X,
adjustedStartPoint.Y,
adjustedStartPoint.Z - _objectHeight
);
}
}
// 起吊/下降段不需要延伸,因为底面对齐地面
}
var lineMarker = new LineMarker