diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index c28d59f..8b0e56f 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -870,15 +870,19 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dV local dDist1 = dist( ptP1, ptPm) local dDist2 = dist( ptP2, ptPm) local dCosMax = 0.951 -- cos( 18°) - local dLenMin = 2 - local dLenMax = 0.5 * dSawDiam * 0.17365 + 1 + local dLenMin = 30 + local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin) if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then if abs( vtTg1 * vtOrthO) < abs( vtTg2 * vtOrthO) then - ptP2 = Point3d( ptPm) - dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL + if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then + ptP2 = Point3d( ptPm) + dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL + end else - ptP1 = Point3d( ptPm) - dAllStart = - dDist1 - 10 * GEO.EPS_SMALL + if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then + ptP1 = Point3d( ptPm) + dAllStart = - dDist1 - 10 * GEO.EPS_SMALL + end end vtTg = ptP2 - ptP1 ; vtTg:normalize() end