|
|
@ -352,7 +352,16 @@ export function GetHoleLengthOfIndex(hole: RoomHolePolyline, index: number): num
|
|
|
|
return hole.Points[index].distanceTo(hole.Points[index + 1]);
|
|
|
|
return hole.Points[index].distanceTo(hole.Points[index + 1]);
|
|
|
|
else if (wall instanceof RoomWallArc)
|
|
|
|
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;
|
|
|
|
if (b < 1e-4) return 0;
|
|
|
|
let r = wall.Radius;
|
|
|
|
let r = wall.Radius;
|
|
|
|
let l = 2 * Math.asin(b / (2 * r)) * r;//http://zhidao.baidu.com/question/553357442/answer/1393358387
|
|
|
|
let l = 2 * Math.asin(b / (2 * r)) * r;//http://zhidao.baidu.com/question/553357442/answer/1393358387
|
|
|
|