DataBeam :
- aggiunta gestione smussi su tagli coincidenti con testa e coda della trave - correzione nei tagli su pezzi grandi (lato di accesso e dicecut) - correzione in LapJoint per riconoscimento caso 3facce con lavorazione speciale.
This commit is contained in:
+45
-13
@@ -34,6 +34,23 @@ function ProcessCut.Classify( Proc, b3Raw)
|
||||
return true, false
|
||||
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( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -42,24 +59,39 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if dDepth < 0.1 then return true end
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- recupero e verifico l'entità curva associata
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
-- recupero e verifico le entità curva associate (max 2)
|
||||
local sVal = EgtGetInfo( Proc.Id, '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 + Proc.Id end
|
||||
if not AuxId then return true end
|
||||
if ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
if Aux2Id then Aux2Id = Aux2Id + Proc.Id 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
|
||||
-- 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 direzione orizzontale (non propago la segnalazione a TS3)
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
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)'
|
||||
@@ -118,7 +150,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -175,12 +207,12 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
|
||||
end
|
||||
-- determino la direzione di taglio preferenziale
|
||||
local _, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
local bHorizCut = (( dCutV < dMaxDepth - 10 * GEO.EPS_SMALL and dCutH > dMaxDepth - 10 * GEO.EPS_SMALL) and not bDownCut)
|
||||
local bHorizCut = (( dCutV < dMaxDepth - BD.CUT_EXTRA and dCutH > dMaxDepth - BD.CUT_EXTRA) and not bDownCut)
|
||||
-- verifico se necessari tagli supplementari
|
||||
EgtOutLog( string.format( 'MaxDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dCutH, dCutV), 3)
|
||||
local vCuts = {}
|
||||
if dCutH > dMaxDepth - 3 * BD.COLL_SIC or dCutV > dMaxDepth - 3 * BD.COLL_SIC then
|
||||
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC, vtN, true)
|
||||
if dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC then
|
||||
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC, vtN, true, nil, nil, dMaxDepth - BD.CUT_EXTRA)
|
||||
end
|
||||
--DC.PrintOrderCut( vCuts)
|
||||
if #vCuts > 0 then
|
||||
|
||||
Reference in New Issue
Block a user