DataWall :

- nel nesting aggiunto controllo sul diametro dei fori
- in FlipAndRot corretto controllo sulle rotazioni.
This commit is contained in:
SaraP
2022-12-02 17:58:39 +01:00
parent b2f1645322
commit ade9d3ffe9
2 changed files with 74 additions and 69 deletions
+68 -64
View File
@@ -509,80 +509,84 @@ local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
local vPartProc = WE.CollectFeatures( nPartId)
for nInd = 1, #vPartProc do repeat
if Drill.Identify( vPartProc[nInd]) then
if Drill.Identify( vPartProc[nInd]) then
-- identifico su quali facce si trova il foro
local bOpen = ( vPartProc[nInd].Fcs ~= 0 and vPartProc[nInd].Fce ~= 0)
local AuxId = EgtGetInfo( vPartProc[nInd].Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + vPartProc[nInd].Id end
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end
local ptDrill = EgtCP( AuxId, GDB_RT.GLOB)
local dLen = abs( EgtCurveThickness( AuxId))
local bLong = dLen > WD.HOR_DRILL_LEN - 1
local bOnlyOnRef = dLen + dDeltaRaw > WD.HOR_DRILL_LEN - GEO.EPS_SMALL and not bLong
-- faccia Front
local dTol = GEO.EPS_SMALL
if ( abs( ptDrill:getY() - ptPartMin:getY()) < dTol) then
DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
if bOpen then
DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
else
DrillOnFaces.F.closed = true
end
if bLong then
DrillOnFaces.F.long = true
if bOpen then DrillOnFaces.B.long = true end
end
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end
-- verifico se diametro compatibile con la punta
local dDiam = 2 * EgtArcRadius( AuxId)
if abs( dDiam - WD.HOR_DRILL_DIAM) < WD.DRILL_TOL + GEO.EPS_SMALL then
local ptDrill = EgtCP( AuxId, GDB_RT.GLOB)
local dLen = abs( EgtCurveThickness( AuxId))
local bLong = dLen > WD.HOR_DRILL_LEN - 1
local bOnlyOnRef = dLen + dDeltaRaw > WD.HOR_DRILL_LEN - GEO.EPS_SMALL and not bLong
-- faccia Back
elseif ( abs( ptDrill:getY() - ptPartMax:getY()) < dTol) then
DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
if bOpen then
-- faccia Front
local dTol = GEO.EPS_SMALL
if ( abs( ptDrill:getY() - ptPartMin:getY()) < dTol) then
DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
else
DrillOnFaces.B.closed = true
end
if bLong then
DrillOnFaces.B.long = true
if bOpen then DrillOnFaces.F.long = true end
end
-- faccia Left
elseif ( abs( ptDrill:getX() - ptPartMin:getX()) < dTol) then
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end
if bOpen then
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
else
DrillOnFaces.L.closed = true
end
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
if bOpen then
DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
else
DrillOnFaces.F.closed = true
end
if bLong then
DrillOnFaces.F.long = true
if bOpen then DrillOnFaces.B.long = true end
end
-- faccia Back
elseif ( abs( ptDrill:getY() - ptPartMax:getY()) < dTol) then
DrillOnFaces.B.nbr = DrillOnFaces.B.nbr + 1
if bOnlyOnRef then DrillOnFaces.B.OnlyOnRef = true end
if bOpen then
DrillOnFaces.F.nbr = DrillOnFaces.F.nbr + 1
if bOnlyOnRef then DrillOnFaces.F.OnlyOnRef = true end
else
DrillOnFaces.B.closed = true
end
if bLong then
DrillOnFaces.L.long = true
if bOpen then DrillOnFaces.R.long = true end
end
-- faccia Right
elseif ( abs( ptDrill:getX() - ptPartMax:getX()) < dTol) then
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
if bOpen then
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
DrillOnFaces.B.long = true
if bOpen then DrillOnFaces.F.long = true end
end
-- faccia Left
elseif ( abs( ptDrill:getX() - ptPartMin:getX()) < dTol) then
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end
else
DrillOnFaces.R.closed = true
end
if bLong then
DrillOnFaces.R.long = true
if bOpen then DrillOnFaces.L.long = true end
if bOpen then
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
else
DrillOnFaces.L.closed = true
end
if bLong then
DrillOnFaces.L.long = true
if bOpen then DrillOnFaces.R.long = true end
end
-- faccia Right
elseif ( abs( ptDrill:getX() - ptPartMax:getX()) < dTol) then
DrillOnFaces.R.nbr = DrillOnFaces.R.nbr + 1
if bOnlyOnRef then DrillOnFaces.R.OnlyOnRef = true end
if bOpen then
DrillOnFaces.L.nbr = DrillOnFaces.L.nbr + 1
if bOnlyOnRef then DrillOnFaces.L.OnlyOnRef = true end
else
DrillOnFaces.R.closed = true
end
if bLong then
DrillOnFaces.R.long = true
if bOpen then DrillOnFaces.L.long = true end
end
end
end
end
end
until true