-- ProcessSplit.lua by Egaltech s.r.l. 2022/11/30 -- Gestione calcolo tagli di separazione per Travi -- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make. -- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita. -- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata. -- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut -- 2022/11/02 Corretti accorciamenti per DoubleCut -- 2022/11/10 Corrette finiture lama per BigSection con trave alta -- 2022/11/16 Correzioni per travi larghe -- 2022/11/30 Correzione per tagli su grandi sezioni (dopo taglio con sega a catena senza finitura aggiungeva uno split con lama). -- Tabella per definizione modulo local ProcessSplit = {} -- Include require( 'EgtBase') local BL = require( 'BeamLib') local Fbs = require( 'FacesBySaw') local Cut = require( 'ProcessCut') local Pocket = require( 'FaceByPocket') EgtOutLog( ' ProcessSplit started', 1) -- Dati local BD = require( 'BeamData') local ML = require( 'MachiningLib') --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessSplit.Identify( Proc) return ( Proc.Grp == 2 and Proc.Prc == 350) end --------------------------------------------------------------------- -- verifica curva per smusso (-1=errore curva, 0=estrusione non va bene, 1=ok) local function VerifyCurveForChamfer( AuxId) if not AuxId then return -2 end if ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then return -1 end local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- va bene solo se direzione estrusione orizzontale if abs( vtExtr:getZ()) > 0.1 then return 0 end return 1 end --------------------------------------------------------------------- -- lavorazione smussi local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead) -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( nOriId, 'Q06', 'd') or 0 if dDepth < 0.1 then return true end -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) -- recupero e verifico le entità curva associate (max 2) local sVal = EgtGetInfo( nOriId, 'AUXID') local vsAuxId = EgtSplitString( sVal) local AuxId, Aux2Id if vsAuxId and #vsAuxId >=1 then AuxId = tonumber( vsAuxId[1]) end if vsAuxId and #vsAuxId >=2 then Aux2Id = tonumber( vsAuxId[2]) end if AuxId then AuxId = AuxId + nOriId end if Aux2Id then Aux2Id = Aux2Id + nOriId end local nRes = VerifyCurveForChamfer( AuxId) if nRes == 0 and Aux2Id then AuxId = Aux2Id nRes = VerifyCurveForChamfer( AuxId) end if nRes == -2 then return true end if nRes == -1 then local sErr = 'Error : missing profile geometry' EgtOutLog( sErr) return false, sErr end if nRes == 0 then local sWarn = 'Warning : skipped not horizontal chamfer' EgtOutLog( sWarn) return true end -- recupero i dati della curva e del profilo local dWidth = abs( EgtCurveThickness( AuxId)) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- eseguo lo smusso solo se feature larga come la trave if dWidth < b3Raw:getDimY() - 1 then local sWarn = 'Warning : skipped chamfer (feature smaller than beam)' EgtOutLog( sWarn) return true, sWarn end local dExtra = 2 -- recupero la lavorazione local sMilling = ML.FindMilling( 'Mark') if not sMilling then local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end -- Inserisco la lavorazione del lato standard local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMch1Id = EgtAddMachining( sName1, sMilling) if not nMch1Id then local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling EgtOutLog( sErr) return false, sErr end -- aggiungo geometria EgtSetMachiningGeometry( {{ AuxId, -1}}) -- assegno affondamento e offset radiale EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra) EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) -- assegno lato di lavoro EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchId, false) return false, sErr end -- Inserisco la lavorazione del lato opposto local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMch2Id = EgtAddMachining( sName2, sMilling) if not nMch2Id then local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling EgtOutLog( sErr) return false, sErr end -- aggiungo geometria EgtSetMachiningGeometry( {{ AuxId, -1}}) -- inverto direzione utensile EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) -- assegno affondamento e offset radiale EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra) EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) -- assegno lato di lavoro EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchId, false) return false, sErr end return true, nil end --------------------------------------------------------------------- -- lavorazione con sega a catena per sezioni alte e larghe local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs) -- Recupero i dati dell'utensile local sSawing = ML.FindSawing( 'Sawing') local dMaxMat = 0 local dSawCornerRad = 0 local dSawThick = 0 -- se non trova una lavorazione di sawing esco if not sSawing then local sErr = 'Error : Sawing not found in library' EgtOutLog( sErr) return false, sErr, 'MNF' else -- recupero i dati dell'utensile if EgtMdbSetCurrMachining( sSawing) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick dSawCornerRad = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or dSawCornerRad end end end -- inserisco la lavorazione di sawing local sName = 'Csaw_' .. ( EgtGetName( nSurfId) or tostring( nSurfId)) .. '_1' local nMchFId = EgtAddMachining( sName, sSawing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) return false, sErr end sName = EgtGetOperationName( nMchFId) -- aggiungo geometria EgtSetMachiningGeometry( {{ nSurfId, 0}}) -- imposto uso del lato faccia EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) -- imposto angolo 3° asse rot EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1)) local _, vtN = EgtSurfTmFacetCenter( nSurfId, 0, GDB_ID.ROOT) local vtOrtho = BL.GetVersRef( nFaceUse) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1)) -- imposto offset radiale per mantenere il materiale in coda per la finitura EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) -- imposto allungamento percorso iniziale e finale a zero EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0) EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- faccio in modo che l'attacco della lama sia dal lato opposto rispetto al corpo macchina EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) if dMaxMat >= dDepth then EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning else EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat) sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- eventuali note if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end -- eseguo if not ML.ApplyMachining( true, false) then if EgtGetOutstrokeInfo() then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) return false, sErr end -- impostazione alternativa angolo 3° asse rot EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2)) if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) return false, sErr end end if EgtIsMachiningEmpty() then _, sWarn = EgtGetMachMgrWarning( 0) EgtSetOperationMode( nMchFId, false) return false, sWarn end --end return true, sName, nMchFId end --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dOvmTail) -- impostazione default a variabili aggiunte if not BD.OVM_CHAIN_HBEAM then BD.OVM_CHAIN_HBEAM = 8 end if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = 180 end -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) -- inserimento smussi local nOriId = EgtGetInfo( Proc.Id, 'ORI', 'i') if nOriId then local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead) if not bOkc then return bOkc, sErrC end end -- recupero la lavorazione local sCutting = ML.FindCutting( 'TailSide') if not sCutting then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' EgtOutLog( sErr) return false, sErr end -- recupero i dati dell'utensile local dSawDiam = 400 local dMaxDepth = 50 local dSawThick = 2 if EgtMdbSetCurrMachining( sCutting) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick end end local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) -- recupero la eventuale lavorazione con lama da sotto local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true) -- recupero i dati della eventuale seconda lama local dSawDiam2 = 0 local dMaxDepth2 = 0 local dSawThick2 = 0 if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2 end end -- caratteristiche taglio local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM)) local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and ( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)) local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) -- dati geometrici del taglio local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) -- flag di lavorazione faccia local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_BACK) -- separazione solo se esiste grezzo successivo con pezzi o scaricabile local nNextRawId = EgtGetNextRawPart( nRawId) local bSplit = ( nNextRawId and ( EgtGetPartInRawPartCount( nNextRawId) > 0 or EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw)) -- determino se più tagli con offset local nCuts = 1 local dOffsL = 0 if not bSplit then -- cerco grezzo successivo che sia nella fase if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then local b3NextRaw = EgtGetRawPartBBox( nNextRawId) local dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX() nCuts = ceil( dLenEndRaw / BD.MAX_LEN_SCRAP) dOffsL = dLenEndRaw / nCuts -- aggiorno ingombro del grezzo corrente con quello del successivo b3Raw:Add( b3NextRaw) end end -- se taglio per pezzi alti e larghi local nNewPhase = 0 if bBigSectionCut then local bFinishingNeeded = false if bSplit then -- recupero lunghezza massima di lavoro della sega a catena local sSawing = ML.FindSawing( 'Sawing') local dMaxMat = 0 local dTlen = 0 if EgtMdbSetCurrMachining( sSawing or '') then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat dTLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dTLen end end -- assegno offset in lunghezza local dOffs = 0 if dOvmTail > BD.OVM_CHAIN_HBEAM then dOffs = dOvmTail - BD.OVM_CHAIN_HBEAM bFinishingNeeded = true end -- se pezzo non troppo alto, taglio singolo da sopra if b3Raw:getDimZ() < dMaxMat - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL then local cutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN sNotesSplit = 'Split;' bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_TOP, cutDepth, sNotesSplit, dOffs) if not bOk then return bOk, sErr, nNewPhase end -- se pezzo non troppo largo, taglio singolo da davanti elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then local cutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN sNotesSplit = 'Split;' bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs) if not bOk then return bOk, sErr, nNewPhase end -- altrimenti tagli dai due fianchi (dietro e davanti) else local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN -- se la sega a catena non può completare lo split esco if cutDepth >= min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then sErr = 'Error : section too big for splitting' EgtOutLog( sErr) return false, sErr, -1 end local sNotesSplit = 'Presplit;' local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs) if not bOk then return bOk, sErr, nNewPhase end sNotesSplit = 'Split;' bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs) if not bOk then return bOk, sErr, nNewPhase end end -- se necessaria finitura, creo nuova fase if bFinishingNeeded then BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) nNewPhase = EgtGetCurrPhase() nDispId = EgtGetPhaseDisposition( nNewPhase) if sDownOrSideOrStd == 'down' then EgtRotateRawPart( nRawId, X_AX(), 180) EgtSetInfo( nDispId, 'TYPE', 'MID2') EgtSetInfo( nDispId, 'ROT', -2) elseif sDownOrSideOrStd == 'side' then if bPreMove then EgtMoveRawPart( nRawId, vtMove) end EgtRotateRawPart( nRawId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90)) if not bPreMove then EgtMoveRawPart( nRawId, vtMove) end EgtSetInfo( nDispId, 'TYPE', 'MID2') EgtSetInfo( nDispId, 'ROT', -1) else EgtSetInfo( nDispId, 'TYPE', 'END') end EgtSetInfo( nDispId, 'ORD', nOrd) -- se grezzo successivo senza pezzi e finale, va tolto local nNextRawId = EgtGetNextRawPart( nRawId) if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then EgtRemoveRawPartFromCurrPhase( nNextRawId) end end end -- se è necessaria la finitura if bFinishingNeeded or not bSplit then local sNotes, sNotesFinal -- se non c'è separazione va aggiunta la nota Cut per l'ultimo taglio e Precut per i tagli precedenti if not bSplit then sNotes = 'Precut;' sNotesFinal = 'Cut;' end local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0 -- se finitura con lama if nQ05 == 1 or nQ05 == 0 or not bSplit then local dSawThickCheck = dSawThick if dSawThick2 > 0 and bDoubleHorizCut then dSawThickCheck = min( dSawThick, dSawThick2) end local dMaxElev = 0 if vtN:getX() > 0 then dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX() else dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX() end -- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard if bSplit or dMaxElev > dSawThickCheck then local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dLenEndRaw, nil, false, true, b3Raw, sNotes, dCurrOvmT) if sNotesFinal then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal) end return bOk, sErr, nNewPhase end -- se finitura con truciolatore elseif nQ05 == 2 then local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end local sPocketing = ML.FindPocketing( 'OpenPocket', nil, 0) if not sPocketing then local sErr = 'Error : pocketing not found in library' EgtOutLog( sErr) return false, sErr end local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid) if sNotesFinal then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal) end return bOk, sErr, nNewPhase end else return true, nil, nNewPhase end end -- se tagli standard if not bDoubleHorizCut then -- calcolo extra taglio ed accorciamento local dCutExtra = 0 local dAccStart = 0 local dAccEnd = 0 if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA) else dCutExtra = - ( b3Raw:getDimY() - dMaxDepth) local dSawRad = dSawDiam / 2 local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN if BD.C_SIMM then dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL) else dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL) end end -- se necessari tagli in doppio, eseguo gli opposti if bDoubleCut then -- gli accorciamenti vanno invertiti per il taglio opposto local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart for i = nCuts, 1, -1 do local dCutOffset = ( i - 1) * dOffsL local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;') local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true) if not bOk then return false, sErr end end end -- eseguo i tagli necessari for i = nCuts, 1, -1 do local dCutOffset = ( i - 1) * dOffsL local sNotes if bSplit then sNotes = EgtIf( i == 1, 'Split;', 'Presplit;') else sNotes = EgtIf( i == 1, 'Cut;', 'Precut;') end local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw) if not bOk then return false, sErr end end -- altrimenti necessari tagli da sopra e sotto con testa opportuna else -- verifico esistenza della lavorazione con lama da sotto if not sCutting2 then local sErr = 'Error : cutting H2 not found in library' EgtOutLog( sErr) return false, sErr end -- verifico che le due lame riescano a lavorare la sezione local dDimZ = b3Raw:getDimZ() local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then local sErr = 'Error : section too big for tail cut' EgtOutLog( sErr) return false, sErr end -- calcolo extra taglio ed accorciamento local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN local dAccStart = 0 -- limiti da sotto local dVzLimDwnUp if BD.TURN then dVzLimDwnUp = -2 end -- eseguo i tagli da sotto necessari for i = nCuts, 1, -1 do local dCutOffset = ( i - 1) * dOffsL local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;') local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw) if not bOk then return false, sErr end end -- eseguo i tagli da sopra necessari for i = nCuts, 1, -1 do local dCutOffset = ( i - 1) * dOffsL local sNotes if bSplit then sNotes = EgtIf( i == 1, 'Split;', 'Presplit;') else sNotes = EgtIf( i == 1, 'Cut;', 'Precut;') end local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw) if not bOk then return false, sErr end end end return true, nil, nNewPhase end --------------------------------------------------------------------- return ProcessSplit