diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index ba75ec5..2fb3a67 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -367,13 +367,15 @@ local function GetStrategies_Essetre( Proc) --------------------------------------------------------------------- -- Feature : Front Profile (0-100) elseif ID.IsFrontProfile( Proc) then + Strategies = { { sStrategyId = 'STR0015'}} --------------------------------------------------------------------- -- Feature : Head Concave Profile (0-101) elseif ID.IsHeadConcaveProfile( Proc) then + Strategies = { { sStrategyId = 'STR0015'}} --------------------------------------------------------------------- -- Feature : Head Convex Profile (0-102) elseif ID.IsHeadConvexProfile( Proc) then - Strategies = { { sStrategyId = 'STR0009'}} + Strategies = { { sStrategyId = 'STR0015'}} --------------------------------------------------------------------- -- Feature : Head Cambered Profile (0-103) elseif ID.IsHeadCamberedProfile( Proc) then @@ -381,10 +383,11 @@ local function GetStrategies_Essetre( Proc) --------------------------------------------------------------------- -- Feature : Round Arch (0-104) elseif ID.IsRoundArch( Proc) then - Strategies = { { sStrategyId = 'STR0009'}} + Strategies = { { sStrategyId = 'STR0015'}} --------------------------------------------------------------------- -- Feature : Head Profile (0-106) elseif ID.IsHeadProfile( Proc) then + Strategies = { { sStrategyId = 'STR0015'}} --------------------------------------------------------------------- -- Feature : Sphere (0-107) elseif ID.IsSphere( Proc) then @@ -479,6 +482,15 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) local sDrillingMode = EgtIf( bDrillFromOneSide, 'PREFER_ONE', 'AUTO') table.insert( Parameters, { sName = 'sDrillingMode', sValue = sDrillingMode, sType = 's'}) --###---###---###---###---###---###---###---###---###---###---###---###---###-- + -- Feature : Front Profile (0-100) + elseif ID.IsFrontProfile( Proc) then + local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0 + local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0 + local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0) == 1 + table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'}) + table.insert( Parameters, { sName = 'bOnlyChamfer' , sValue = bOnlyChamfer, sType = 'b'}) + table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'}) + --###---###---###---###---###---###---###---###---###---###---###---###---###-- -- Feature : Head Concave Profile (0-101) elseif ID.IsHeadConcaveProfile( Proc) then local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0 @@ -502,12 +514,7 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) local sUpperFaceStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 's') or '' -- Q01 = forza fresa sUpperFaceStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 's') or sUpperFaceStrategy or 'AUTO' -- Q02 = forza lama (se entrambi attivi comanda la lama) table.insert( Parameters, { sName = 'sUpperFaceStrategy' , sValue = sUpperFaceStrategy, sType = 's'}) - local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0 - - --TODO RIMUOVERE!!!! - dDepthChamfer = 3 - local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q04', 'd') or 0 local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q05', 'd') or 0) == 1 table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'}) @@ -518,10 +525,19 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) elseif ID.IsRoundArch( Proc) then local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0 local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0 - local dStripWidth = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0) == 1 + local dStripWidth = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0) table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'}) table.insert( Parameters, { sName = 'dStripWidth' , sValue = dStripWidth, sType = 'b'}) table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'}) + --###---###---###---###---###---###---###---###---###---###---###---###---###-- + -- Feature : Head Profile (0-106) + elseif ID.IsHeadProfile( Proc) then + local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0 + local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0 + local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0) == 1 + table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'}) + table.insert( Parameters, { sName = 'bOnlyChamfer' , sValue = bOnlyChamfer, sType = 'b'}) + table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'}) end ------------------------------------------------------------------------------- @@ -614,7 +630,8 @@ local function GetTools_Essetre( Proc, sMachiningCategory) end elseif ID.IsDovetailMortise( Proc) then TagList = { 'DtMortise'} - elseif ID.IsHeadConcaveProfile( Proc) or ID.IsHeadConvexProfile( Proc) or ID.IsHeadCamberedProfile( Proc) or ID.IsRoundArch( Proc) or ID.IsHeadProfile( Proc) then + elseif ID.IsFrontProfile( Proc) or ID.IsHeadConcaveProfile( Proc) or ID.IsHeadConvexProfile( Proc) or + ID.IsHeadCamberedProfile( Proc) or ID.IsRoundArch( Proc) or ID.IsHeadProfile( Proc) then if sMachiningCategory == 'MillingFinish' then TagList = { 'Prof_end'} end diff --git a/LuaLibs/FeatureLib.lua b/LuaLibs/FeatureLib.lua index 3768975..440f8d1 100644 --- a/LuaLibs/FeatureLib.lua +++ b/LuaLibs/FeatureLib.lua @@ -564,6 +564,9 @@ function FeatureLib.GetFeatureCompletionIndex( dCompletionPercentage) -- Medium elseif dCompletionPercentage < 80 then nCompletionIndex = 2 + -- High + elseif dCompletionPercentage < 95 then + nCompletionIndex = 4 -- High / Complete else nCompletionIndex = 5 diff --git a/Strategies/Standard/STR0015/STR0015.lua b/Strategies/Standard/STR0015/STR0015.lua index ea49ccf..b028a37 100644 --- a/Strategies/Standard/STR0015/STR0015.lua +++ b/Strategies/Standard/STR0015/STR0015.lua @@ -34,42 +34,64 @@ local function GetEdgeToMachine( Proc, idFace, vtEdge) return Edge end + +-- TODO funzione recuperata da beam vecchio, verificare se possibile migliorare --------------------------------------------------------------------- -local function GetSawCutData( AuxId, vtNF) - -- comincio con la normale a 45deg - local vtNP = Vector3d( vtNF) - for i = 1, 3 do - if vtNP[i] > GEO.EPS_SMALL then - vtNP[i] = 1 - elseif vtNP[i] < -GEO.EPS_SMALL then - vtNP[i] = -1 +local function GetSawCutData( Proc, AuxId, vtNF, vtN) + local ptStart, vtNP + + if ID.IsHeadConcaveProfile( Proc) or ID.IsHeadConvexProfile( Proc) or ID.IsHeadProfile( Proc) or ID.IsFrontProfile( Proc) then + vtNP = Vector3d( vtN) + -- comincio con la normale a 45deg + for i = 1, 3 do + if vtNP[i] > GEO.EPS_SMALL then + vtNP[i] = 1 + elseif vtNP[i] < -GEO.EPS_SMALL then + vtNP[i] = -1 + end end - end - vtNP:normalize() - -- assegno un punto di passaggio - local ptStart = EgtSP( AuxId, GDB_ID.ROOT) + vtNP * 5.0 - -- determino asse di rotazione - local vtRot = - Y_AX() - if vtNF:getX() < 0 then vtRot = - vtRot end - if vtNF:getZ() < -0.1 then - vtRot = - vtRot - elseif vtNF:getY() < -0.1 then - vtRot:rotate( X_AX(), 90) - elseif vtNF:getY() > 0.1 then - vtRot:rotate( X_AX(), -90) - end - -- miglioro l'inclinazione (ripartendo da faccia perpendicolare asse trave) - vtNP[2] = 0 vtNP[3] = 0 - local dRot = 45 - for i = 1, 4 do - local vtNP2 = Vector3d( vtNP) - vtNP2:rotate( vtRot, dRot) - local frRef = Frame3d( ptStart, vtNP2) - local b3Box = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frRef) - if b3Box:getMax():getZ() < -3 then - vtNP = Vector3d( vtNP2) + vtNP:normalize() + -- assegno un punto di passaggio + ptStart = EgtMP( AuxId, GDB_ID.ROOT) + local frOCS = Frame3d( ptStart, vtNP) ; + local b3Box = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frOCS) + ptStart = ptStart + vtNP * ( b3Box:getMax():getZ() + 10.0) + elseif ID.IsHeadCamberedProfile( Proc) then + vtNP = Vector3d( vtNF) + -- comincio con la normale a 45deg + for i = 1, 3 do + if vtNP[i] > GEO.EPS_SMALL then + vtNP[i] = 1 + elseif vtNP[i] < -GEO.EPS_SMALL then + vtNP[i] = -1 + end + end + vtNP:normalize() + -- assegno un punto di passaggio + ptStart = EgtSP( AuxId, GDB_ID.ROOT) + vtNP * 5.0 + -- determino asse di rotazione + local vtRot = - Y_AX() + if vtNF:getX() < 0 then vtRot = - vtRot end + if vtNF:getZ() < -0.1 then + vtRot = - vtRot + elseif vtNF:getY() < -0.1 then + vtRot:rotate( X_AX(), 90) + elseif vtNF:getY() > 0.1 then + vtRot:rotate( X_AX(), -90) + end + -- miglioro l'inclinazione (ripartendo da faccia perpendicolare asse trave) + vtNP[2] = 0 vtNP[3] = 0 + local dRot = 45 + for i = 1, 4 do + local vtNP2 = Vector3d( vtNP) + vtNP2:rotate( vtRot, dRot) + local frRef = Frame3d( ptStart, vtNP2) + local b3Box = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frRef) + if b3Box:getMax():getZ() < -3 then + vtNP = Vector3d( vtNP2) + end + dRot = dRot / 2 end - dRot = dRot / 2 end -- restituisco i dati del piano return ptStart, vtNP @@ -82,60 +104,66 @@ local function GetRoughStrategy( Proc, Part, bSaveAddedGeometries) -- ====== Taglio di sgrossatura generale su tutto il profilo ====== local vtNF = EgtSurfTmFacetNormVersor( Proc.id, Proc.nFct-1, GDB_ID.ROOT) + local nMidFacet = Proc.nFct // 2 -- faccia a metà circa + local vtN = EgtSurfTmFacetNormVersor( Proc.id, nMidFacet, GDB_ID.ROOT) + local nAddGroupId = BeamLib.GetAddGroup( Part.id) -- aggiungo piano di sgrossatura e lo lavoro - local ptStart, vtNP = GetSawCutData( Proc.idAddAuxGeom, vtNF) + local ptStart, vtNP = GetSawCutData( Proc, Proc.idAddAuxGeom, vtNF, vtN) local AddId = EgtSurfTmPlaneInBBox( nAddGroupId, ptStart, vtNP, Part.b3Part, GDB_RT.GLOB) - if not bSaveAddedGeometries then - EgtSetLevel( AddId, GDB_LV.TEMP) - end + -- se la faccia è stata creata + if AddId then + if not bSaveAddedGeometries then + EgtSetLevel( AddId, GDB_LV.TEMP) + end - -- creo piano di taglio sulla testa del tenone - local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, - dMaxWasteLength = Strategy.Parameters.dMaxWasteLength, - bReduceBladePath = Strategy.Parameters.bReduceBladePath - } - Machining, Result = BladeToWaste.Make( AddId, Part, OptionalParameters) + -- creo piano di taglio sulla testa del tenone + local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, + dMaxWasteLength = Strategy.Parameters.dMaxWasteLength, + bReduceBladePath = Strategy.Parameters.bReduceBladePath + } + Machining, Result = BladeToWaste.Make( AddId, Part, OptionalParameters) - -- se non ci sono lavorazioni, provo con fresa - if not Machining or #Machining == 0 then - Machining.bCuttingWithMill = true - -- === ricerca utensile per svuotare taglio iniziale, se taglio non possibile === - if not( Proc.AffectedFaces.bLeft) or Strategy.bCanMoveAfterSplit then - ToolSearchParameters = {} + -- se non ci sono lavorazioni, provo con fresa + if not Machining or #Machining == 0 then + Machining.bCuttingWithMill = true + -- === ricerca utensile per svuotare taglio iniziale, se taglio non possibile === + if not( Proc.AffectedFaces.bLeft) or Strategy.bCanMoveAfterSplit then + ToolSearchParameters = {} - -- TODO SISTEMARE!!! qui la svuotatura non deve limitare l'elevazione se aperta da tutti i lati. In futuro si deve passare 0 come elevazione - ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( AddId, 0, Part.b3Part, true, GDB_ID.ROOT) + -- TODO SISTEMARE!!! qui la svuotatura non deve limitare l'elevazione se aperta da tutti i lati. In futuro si deve passare 0 come elevazione + ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( AddId, 0, Part.b3Part, true, GDB_ID.ROOT) - ToolSearchParameters.vtToolDirection = vtNF - ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing') - Machining.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters) + ToolSearchParameters.vtToolDirection = vtNP + ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing') + Machining.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters) - -- TODO anche il test sul ResidualDepth va tolto - if Machining.ToolInfo.nToolIndex and ( Machining.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL) then - Machining.bIsApplicable = true - local ParametersMRR = {} - ParametersMRR.nToolIndex = Machining.ToolInfo.nToolIndex - Result.dMRR = MachiningLib.GetToolMRR( ParametersMRR) - Result.sStatus = 'Completed' - Machining.Steps = {} - Machining.LeadIn = {} - Machining.nType = MCH_MY.POCKETING - Machining.nSubType = MCH_POCK_SUB.SPIRALIN - Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG - Machining.Steps.dStep = TOOLS[Machining.ToolInfo.nToolIndex].dStep - Machining.Steps.dSideStep = TOOLS[Machining.ToolInfo.nToolIndex].dSideStep - Machining.nToolIndex = Machining.ToolInfo.nToolIndex - Machining.LeadIn.dTangentDistance = TOOLS[Machining.ToolInfo.nToolIndex].dDiameter/2 - Machining.LeadIn.dElevation = TOOLS[Machining.ToolInfo.nToolIndex].dDiameter/2 - Machining.sDepth = 0 - Machining.Geometry = {{ AddId, 0}} - Machining.vtToolDirection = vtNF - if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then - Machining.sStage = 'AfterTail' + -- TODO anche il test sul ResidualDepth va tolto + if Machining.ToolInfo.nToolIndex and ( Machining.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL) then + Machining.bIsApplicable = true + local ParametersMRR = {} + ParametersMRR.nToolIndex = Machining.ToolInfo.nToolIndex + Result.dMRR = MachiningLib.GetToolMRR( ParametersMRR) + Result.sStatus = 'Completed' + Machining.Steps = {} + Machining.LeadIn = {} + Machining.nType = MCH_MY.POCKETING + Machining.nSubType = MCH_POCK_SUB.SPIRALIN + Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG + Machining.Steps.dStep = TOOLS[Machining.ToolInfo.nToolIndex].dStep + Machining.Steps.dSideStep = TOOLS[Machining.ToolInfo.nToolIndex].dSideStep + Machining.nToolIndex = Machining.ToolInfo.nToolIndex + Machining.LeadIn.dTangentDistance = TOOLS[Machining.ToolInfo.nToolIndex].dDiameter/2 + Machining.LeadIn.dElevation = TOOLS[Machining.ToolInfo.nToolIndex].dDiameter/2 + Machining.sDepth = 0 + Machining.Geometry = {{ AddId, 0}} + Machining.vtToolDirection = vtNF + if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then + Machining.sStage = 'AfterTail' + end + -- tempo di svuotatura + Result.dTimeToMachine = MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part) end - -- tempo di svuotatura - Result.dTimeToMachine = MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part) end end end @@ -182,14 +210,20 @@ local function GetEdgeWithCornerStrategy( Proc, Part) -- MILL_FORCED = solo fresa, altriemnti non applica nulla (potrebbe essere necessario un ribaltamento) if Strategy.Parameters.sConcaveFaceStrategy == 'AUTO' or Strategy.Parameters.sConcaveFaceStrategy == 'BLADE_FORCED' then local vtCutDir1 - if vtN:getZ() > 0.707 then - vtCutDir1 = Z_AX() - elseif vtN:getZ() < -0.707 then - vtCutDir1 = -Z_AX() - elseif vtN:getY() > 0.707 then - vtCutDir1 = Y_AX() - elseif vtN:getY() < -0.707 then - vtCutDir1 = -Y_AX() + -- se è diretta verso alto o basso + if vtN:getZ() > vtN:getY() then + if vtN:getZ() > 0 then + vtCutDir1 = Z_AX() + else + vtCutDir1 = -Z_AX() + end + -- altrimenti è di fianco + else + if vtN:getY() > 0 then + vtCutDir1 = Y_AX() + else + vtCutDir1 = -Y_AX() + end end local vtCutDir2 @@ -204,6 +238,9 @@ local function GetEdgeWithCornerStrategy( Proc, Part) if bLastTrim then local EdgeToMachine = GetEdgeToMachine( Proc, nLastFacet+1, vtCutDir1) local Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[nLastFacet+1], EdgeToMachine) + if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then + Cutting.sStage = 'AfterTail' + end if Cutting then table.insert( Machining, Cutting) end @@ -211,8 +248,11 @@ local function GetEdgeWithCornerStrategy( Proc, Part) -- lavorazione faccia 1 spigolo iniziale if bFirstTrim then - local EdgeToMachine = GetEdgeToMachine( Proc, nFirstFacet+1, vtCutDir1) - local Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[nFirstFacet+1], EdgeToMachine) + local EdgeToMachine = GetEdgeToMachine( Proc, nFirstFacet+2, vtCutDir1) + local Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[nFirstFacet+2], EdgeToMachine) + if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then + Cutting.sStage = 'AfterTail' + end if Cutting then table.insert( Machining, Cutting) end @@ -229,8 +269,8 @@ local function GetEdgeWithCornerStrategy( Proc, Part) -- lavorazione faccia 2 spigolo iniziale if bFirstTrim then - local EdgeToMachine = GetEdgeToMachine( Proc, nFirstFacet, vtCutDir2) - local Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[nFirstFacet], EdgeToMachine) + local EdgeToMachine = GetEdgeToMachine( Proc, nFirstFacet+1, vtCutDir2) + local Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[nFirstFacet+1], EdgeToMachine) if Cutting then table.insert( Machining, Cutting) end @@ -460,17 +500,19 @@ local function GetArcStrategy( Proc, Part) Milling.dRadialOffset = Strategy.Parameters.dOverMaterial end Milling.vtToolDirection = ToolSearchParameters.vtToolDirection + Milling.bOtherDirection = bToolInvert + -- si cerca utensile 2 local Milling2 = MachiningLib.InitMachiningParameters( MCH_MY.MILLING) ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, vtExtr, -vtExtr) Milling2.ToolInfo = {} Milling2.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters) - Milling2.bOtherDirection = true if nCycle == 2 then Milling2.dRadialOffset = Strategy.Parameters.dOverMaterial end Milling2.vtToolDirection = ToolSearchParameters.vtToolDirection + Milling2.bOtherDirection = bToolInvert -- se serve codolo if bExecStrip then @@ -600,6 +642,8 @@ local function GetFeatureResult( Proc) Result.sStatus = "Not-Applicable" else Result.sStatus = "Not-Completed" + local dPercentageLeft = ceil( 100 - Result.dCompletionPercentage) + Result.sInfo = Result.sInfo .. '- Not Complete : left ' .. tostring( dPercentageLeft) .. '%\n' end Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( Result.dCompletionPercentage) Result.dMRR = 1 @@ -727,8 +771,10 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters) Strategy.Profile.Machinings[i].nToolIndex = Strategy.Profile.Machinings[i].ToolInfo.nToolIndex Strategy.Profile.Machinings[i].nType = MCH_MY.MILLING Strategy.Profile.Machinings[i].Steps = {} + Strategy.Profile.Machinings[i].Steps.dStep = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dStep Strategy.Profile.Machinings[i].Steps = MachiningLib.GetMachiningSteps( tonumber( Strategy.Profile.Machinings[i].sDepth), TOOLS[Strategy.Profile.Machinings[i].nToolIndex].dStep) + Strategy.Profile.Machinings[i].Steps.nStepType = MCH_MILL_ST.ONEWAY -- LeadIn / LeadOut Strategy.Profile.Machinings[i].LeadIn.nType = MCH_MILL_LI.TANGENT