diff --git a/NestProcess.lua b/NestProcess.lua index d88443d..975215b 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -2177,21 +2177,33 @@ if bNestingOk then end end -- se è lap joint dall'alto - if nFaceInd ~= -1 and nFaceDownInd == -1 then + if nFaceInd ~= -1 and nFaceDownInd == -1 then + local bResetQ = false local ptCen = EgtSurfTmFacetCenter( Proc.Id, nFaceInd, GDB_ID.ROOT) - -- se all'interno rimuovo info Q + -- se all'interno rimuovo info Q if EnclosesPointXY( b3Raw, ptCen) then + bResetQ = true + elseif Proc.Fct == 2 then + -- se non è interno ma ha 2 facce non ortogonali rimuovo info Q + local vtN1 = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, 1, GDB_ID.ROOT) + if abs( vtN1 * vtN2) > GEO.EPS_SMALL then + bResetQ = true + end + end + + if bResetQ then -- resetto parametro Q if Proc.Prc == 30 then EgtRemoveInfo( Proc.Id, "Q08") - EgtRemoveInfo( Proc.Id, "Q08A") + EgtRemoveInfo( Proc.Id, "Q08A") else EgtRemoveInfo( Proc.Id, "Q03") - EgtRemoveInfo( Proc.Id, "Q03A") - end - end + EgtRemoveInfo( Proc.Id, "Q03A") + end + end end - + elseif DoubleCut.Identify( Proc) then -- verifico se due facce e rivolto verso l'alto if Proc.Fct == 2 then