修复:圆弧洞在优弧墙上更新错误

pull/1946/head
ChenX 2 years ago
parent 7a1fa072d2
commit d179f3cdd7

@ -352,7 +352,16 @@ export function GetHoleLengthOfIndex(hole: RoomHolePolyline, index: number): num
return hole.Points[index].distanceTo(hole.Points[index + 1]);
else if (wall instanceof RoomWallArc)
{
let b = hole.Points[index].distanceTo(hole.Points[index + 1]);
let p1 = hole.Points[index];
let p2 = hole.Points[index + 1];
let param1 = wall.GetParamAtPoint(p1.clone().setZ(wall.Z));
let param2 = wall.GetParamAtPoint(p2.clone().setZ(wall.Z));
if (!isNaN(param1) && !isNaN(param2))
return Math.abs(wall.GetDistAtParam(param1) - wall.GetDistAtParam(param2));
let b = p1.distanceTo(p2);
if (b < 1e-4) return 0;
let r = wall.Radius;
let l = 2 * Math.asin(b / (2 * r)) * r;//http://zhidao.baidu.com/question/553357442/answer/1393358387

Loading…
Cancel
Save