CAMAuto :

- rimossa creazione macchinate solo con pezzi stesse dimensioni
- aggiunto offset in fase 1 per lavorazione in testa e in fase 2 per lavorazione di coda
This commit is contained in:
Annamaria Sassi
2026-07-27 09:15:33 +02:00
parent 96a8ef1603
commit fe3a2cc732
2 changed files with 12 additions and 18 deletions
+10 -16
View File
@@ -188,23 +188,17 @@ local function CalculateSimilarity( Part1, Part2)
local ProfilesWeights = { 3, 3, 1, 1}
local dScore = 0
-- punteggio maggiore di zero se hanno stesse dimensioni
if Part1.b3Raw:getDimZ() - Part2.b3Raw:getDimZ() < 10 * GEO.EPS_SMALL and Part1.b3Raw:getDimZ() - Part2.b3Raw:getDimZ() > - 10 * GEO.EPS_SMALL and
((Part1.b3Raw:getDimX() - Part2.b3Raw:getDimX() < 10 * GEO.EPS_SMALL and Part1.b3Raw:getDimX() - Part2.b3Raw:getDimX() > - 10 * GEO.EPS_SMALL and
Part1.b3Raw:getDimY() - Part2.b3Raw:getDimY() < 10 * GEO.EPS_SMALL and Part1.b3Raw:getDimY() - Part2.b3Raw:getDimY() > - 10 * GEO.EPS_SMALL) or
(Part1.b3Raw:getDimY() - Part2.b3Raw:getDimX() < 10 * GEO.EPS_SMALL and Part1.b3Raw:getDimY() - Part2.b3Raw:getDimX() > - 10 * GEO.EPS_SMALL and
Part1.b3Raw:getDimX() - Part2.b3Raw:getDimY() < 10 * GEO.EPS_SMALL and Part1.b3Raw:getDimX() - Part2.b3Raw:getDimY() > - 10 * GEO.EPS_SMALL))then
for i = 1, 4 do
if Part1.SemiProfiles[i] == Part2.SemiProfiles[i] then
dScore = dScore + ProfilesWeights[i]
end
end
-- punteggio "bonus" se il tipo di pezzo è lo stesso
if Part1.sPieceType and Part2.sPieceType and Part1.sPieceType == Part2.sPieceType then
dScore = dScore + 2
end
for i = 1, 4 do
if Part1.SemiProfiles[i] == Part2.SemiProfiles[i] then
dScore = dScore + ProfilesWeights[i]
end
end
-- punteggio "bonus" se il tipo di pezzo è lo stesso
if Part1.sPieceType and Part2.sPieceType and Part1.sPieceType == Part2.sPieceType then
dScore = dScore + 2
end
return dScore
end
+2 -2
View File
@@ -547,7 +547,7 @@ function WinExec.ProcessFeatures( PARTS)
local bIsApplyOk, sErr, b3MachEncumbrance = MachiningLib.AddOperation( MACHININGS[i]) -- TODO ingombro lavorazione mi restituisce dati sbagliati. C'è un riferimento?
-- se feature di testa, sposto testa in base a ingombro lavorazione
if MACHININGS[i].Proc.bHeadProfile and b3MachEncumbrance then
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase1.dOffsetX = min( b3MachEncumbrance:getMax():getX() - PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMin():getX() + 5, maxOffsetX[MACHININGS[i].Proc.nIndexPart])
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase1.dOffsetX = min( b3MachEncumbrance:getMax():getX() - PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMin():getX() + 45, maxOffsetX[MACHININGS[i].Proc.nIndexPart])
end
end
end
@@ -573,7 +573,7 @@ function WinExec.ProcessFeatures( PARTS)
local bIsApplyOk, sErr, b3MachEncumbrance = MachiningLib.AddOperation( MACHININGS[i]) -- TODO ingombro lavorazione mi restituisce dati sbagliati. C'è un riferimento?
-- se feature di testa, sposto testa in base a ingombro lavorazione
if MACHININGS[i].Proc.bHeadProfile and b3MachEncumbrance then
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase2.dOffsetX = min( PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMax():getX() - b3MachEncumbrance:getMin():getX() + 5, 94)
PARTS[MACHININGS[i].Proc.nIndexPart].DispOffsets.Phase2.dOffsetX = min( PARTS[MACHININGS[i].Proc.nIndexPart].b3Part:getMax():getX() - b3MachEncumbrance:getMin():getX() + 45, 94)
end
end
end