ProcessCut e FacesBySaw.MakeOne - Modifica non ancora funzionante
This commit is contained in:
+10
-4
@@ -237,14 +237,14 @@ local function GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation, bForceClimbCut)
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation, bForceClimbCut, bTiltedFaceAddVerticalDiceing)
|
||||
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
|
||||
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
|
||||
Par5 == MCH_MILL_FU.PARAL_TOP or
|
||||
Par5 == MCH_MILL_FU.PARAL_FRONT or
|
||||
Par5 == MCH_MILL_FU.PARAL_BACK or
|
||||
Par5 == MCH_MILL_FU.PARAL_LEFT or
|
||||
Par5 == MCH_MILL_FU.PARAL_RIGHT) then
|
||||
Par5 == MCH_MILL_FU.PARAL_RIGHT) and not bTiltedFaceAddVerticalDiceing then
|
||||
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, sLeadInOutType, dActualElevation)
|
||||
end
|
||||
-- la lama ha asse perpendicolare alla faccia
|
||||
@@ -383,7 +383,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
end
|
||||
local nFaceUse = nOrthoOpposite
|
||||
if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end
|
||||
local bWsRight = ( bInvert ~= bDownUp)
|
||||
local bWsRight = ( bInvert ~= bDownUp) or bTiltedFaceAddVerticalDiceing
|
||||
local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
-- Versore di riferimento
|
||||
local vtRef = Vector3d( vtTg)
|
||||
@@ -457,7 +457,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo entrata opportunamente
|
||||
if dDistPointToCenter > 0.5 * dSawDiam then
|
||||
dLiTang = -dAllStart * dCosAlpha
|
||||
dLiPerp = dDist1 * dSinAlpha
|
||||
dLiPerp = dDist1 * dSinAlpha
|
||||
end
|
||||
end
|
||||
-- se ho accorciato uscita, setto componente tangente e perpendicolare sul percorso di uscita
|
||||
@@ -542,6 +542,12 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
-- per ora aggregato usato in verticale solo in split e headcut; Fast non influenzata
|
||||
if BD.C_SIMM and bMaximizeVerticalDepth then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif BD.C_SIMM and bTiltedFaceAddVerticalDiceing and abs( vtAux:getY()) > abs( vtAux:getX()) - GEO.EPS_SMALL and AreSameOrOppositeVectorApprox( vtTg, Z_AX()) then
|
||||
if vtN:getX() > 10 * GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
elseif abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
|
||||
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
|
||||
+31
-1
@@ -479,12 +479,16 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
-- determino il modo di tagliare
|
||||
local vtOrthoO
|
||||
local bNoPerpCuts = false
|
||||
local vtO
|
||||
-- Se tagli ortogonali (indice dispari)
|
||||
if i % 2 == 1 then
|
||||
vtOrthoO = Vector3d( vtN)
|
||||
-- Se tagli perpendicolari (indice pari)
|
||||
else
|
||||
local vtO
|
||||
-- Se elemento precedente contiene tagli ortogonali
|
||||
if #vCuts[i-1] > 0 then
|
||||
vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT)
|
||||
-- Se elemento successivo contiene tagli ortogonali
|
||||
elseif vCuts[i+1] and #vCuts[i+1] > 0 then
|
||||
-- lunghezza faccia nell'eventuale direzione ortogonale
|
||||
local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT)
|
||||
@@ -552,8 +556,34 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
|
||||
if not bOk2 then return false, sErr2 end
|
||||
|
||||
-- caso standard
|
||||
else
|
||||
if ( i % 2) == 0 and Proc.Fct == 1 and ( AreSameVectorApprox( vtO, Z_AX()) or AreSameVectorApprox( vtO, -Z_AX())) then
|
||||
local vtOrthoVert = vtN ^ vtO
|
||||
local Frame = Frame3d( ptC, vtN, vtO)
|
||||
local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame)
|
||||
if abs( b3Fac:getDimY() - BD.MAX_DIM_DICE) > 10 * GEO.EPS_SMALL then
|
||||
local bTiltedFaceAddVerticalDiceing = EgtGetInfo( Proc.Id, 'Q19', 'i') == 1
|
||||
local nVerticalCuts = ceil( b3Fac:getDimY() / ( BD.MAX_LEN_DICE)) - 1
|
||||
local dVerticalSliceHeight = b3Fac:getDimY() / ( nVerticalCuts + 1)
|
||||
local dSawDiam = 400
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
end
|
||||
end
|
||||
-- tagli orizzontali
|
||||
for k = nVerticalCuts, 1, -1 do
|
||||
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
||||
local dVerticalCutOffset = dVerticalSliceHeight * -k
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][1], 0, sCutting, dSawDiam, nFaceUse, nil, -0.1, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, 0, nil, bTiltedFaceAddVerticalDiceing)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
-- se taglio dal basso
|
||||
|
||||
Reference in New Issue
Block a user