Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 83f5841ece | |||
| c1eee0201c | |||
| 05fc22b1d4 |
@@ -36,6 +36,9 @@ function FeatureLib.GetProcFromTrimesh( idTrimesh, Part, ProcToCopyFrom)
|
||||
if ProcToCopyFrom and Proc.dVolume < 10 * GEO.EPS_SMALL then
|
||||
Proc.dVolume = ProcToCopyFrom.dVolume
|
||||
end
|
||||
Proc.nParts = EgtSurfTmPartCount( Proc.id) or 1
|
||||
Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part)
|
||||
|
||||
-- TODO servono anche altri dati raccolti nel collect??
|
||||
|
||||
return Proc
|
||||
@@ -220,6 +223,10 @@ function FeatureLib.ClassifyTopology( Proc, Part)
|
||||
elseif Proc.nFct == 1 and ( bIsFeatureCuttingEntireSection or bIsFeatureCuttingEntireLength) then
|
||||
sFamily = 'Cut'
|
||||
bIsThrough = true
|
||||
-- se taglia intera sezione ed è rivolto verso la coda, bisogna considerare come se tocchi la faccia di coda
|
||||
if Proc.Faces[1].vtN:getX() < 0 then
|
||||
Proc.AffectedFaces.bLeft = true
|
||||
end
|
||||
elseif Proc.nFct == 1 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = true
|
||||
|
||||
@@ -316,10 +316,11 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
local dDepthToMachine = EdgesClosedNotMachined[i].dElevation - dMillingOffsetFromSide
|
||||
local dToolMarkLength = Milling1.dToolMarkLength or 0
|
||||
local OptionalParameters = {
|
||||
bIsSplitFeature = bIsSplitFeature,
|
||||
bIsSplitFeature = false, -- anche se feature splittata, le facce di chiusura si lavorano intere
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
dRadialStepSpan = dToolMarkLength,
|
||||
dDepthToMachine = dDepthToMachine
|
||||
dDepthToMachine = dDepthToMachine,
|
||||
nStepType = MCH_MILL_ST.ONEWAY
|
||||
}
|
||||
local Milling = FaceByMill.Make( Proc, Part, BottomFace1, EdgesClosedNotMachined[i], OptionalParameters)
|
||||
Milling.nInternalSortingPriority = 3
|
||||
@@ -342,10 +343,11 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
local dDepthToMachine = EdgesClosedNotMachined[i].dElevation - dMillingOffsetFromSide
|
||||
local dToolMarkLength = Milling2.dToolMarkLength or 0
|
||||
local OptionalParameters = {
|
||||
bIsSplitFeature = bIsSplitFeature,
|
||||
bIsSplitFeature = false, -- anche se feature splittata, le facce di chiusura si lavorano intere
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
dRadialStepSpan = dToolMarkLength,
|
||||
dDepthToMachine = dDepthToMachine
|
||||
dDepthToMachine = dDepthToMachine,
|
||||
nStepType = MCH_MILL_ST.ONEWAY
|
||||
}
|
||||
local Milling = FaceByMill.Make( Proc, Part, BottomFace2, EdgesClosedNotMachined[i], OptionalParameters)
|
||||
Milling.nInternalSortingPriority = 3
|
||||
|
||||
@@ -171,50 +171,58 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
|
||||
Cutting2.nInternalSortingPriority = 2
|
||||
Cutting2.dResultWeight = 0.3
|
||||
|
||||
-- se uno dei due lati non è riuscito, si estende il più possibile il lato rimasto
|
||||
if not Cutting1.bIsApplicable and Cutting2.bIsApplicable then
|
||||
|
||||
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
|
||||
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
|
||||
dStripWidth = TOOLS[Cutting2.nToolIndex].dThickness + 2 * dStripWidth
|
||||
end
|
||||
-- se richiesto, si calcola il codolo verticale
|
||||
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
|
||||
dDepthToMachine = TOOLS[Cutting2.nToolIndex].dMaxMaterial - 10
|
||||
else
|
||||
dDepthToMachine = min( TOOLS[Cutting2.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
|
||||
end
|
||||
|
||||
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
|
||||
|
||||
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
|
||||
Cutting2.nInternalSortingPriority = 2
|
||||
Cutting2.dResultWeight = 0.3
|
||||
table.insert( Cuttings, Cutting2)
|
||||
|
||||
elseif not Cutting2.bIsApplicable and Cutting1.bIsApplicable then
|
||||
|
||||
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
|
||||
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
|
||||
dStripWidth = TOOLS[Cutting1.nToolIndex].dThickness + 2 * dStripWidth
|
||||
end
|
||||
-- se richiesto, si calcola il codolo verticale
|
||||
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting2.dEdgeLength, Part) then
|
||||
dDepthToMachine = TOOLS[Cutting1.nToolIndex].dMaxMaterial - 10
|
||||
else
|
||||
dDepthToMachine = min( TOOLS[Cutting1.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
|
||||
end
|
||||
|
||||
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
|
||||
|
||||
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
|
||||
Cutting1.nInternalSortingPriority = 2
|
||||
Cutting1.dResultWeight = 0.3
|
||||
-- se entrambi i lati lavorati e codolo centrale, si aggiungono in lista senza fare altro
|
||||
if Cutting1.bIsApplicable and Cutting2.bIsApplicable and not bAllowPerpendicularStrip then
|
||||
table.insert( Cuttings, Cutting1)
|
||||
|
||||
table.insert( Cuttings, Cutting2)
|
||||
else
|
||||
table.insert( Cuttings, Cutting1)
|
||||
table.insert( Cuttings, Cutting2)
|
||||
-- si estende il lato il più possibile
|
||||
if Cutting1.bIsApplicable then
|
||||
|
||||
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
|
||||
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
|
||||
dStripWidth = TOOLS[Cutting1.nToolIndex].dThickness + 2 * dStripWidth
|
||||
end
|
||||
-- se richiesto, si calcola il codolo verticale
|
||||
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
|
||||
dDepthToMachine = TOOLS[Cutting1.nToolIndex].dMaxMaterial - 10
|
||||
-- CASO SPECIALE : se il massimo materiale è più di 3 volte la faccia, si fa lavorazione solo da un lato, l'altro viene annullato
|
||||
if TOOLS[Cutting1.nToolIndex].dMaxMaterial / 3 > EdgeToMachine.dElevation then
|
||||
Cutting2.bIsApplicable = false
|
||||
end
|
||||
else
|
||||
dDepthToMachine = min( TOOLS[Cutting1.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
|
||||
end
|
||||
|
||||
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
|
||||
|
||||
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
|
||||
Cutting1.nInternalSortingPriority = 2
|
||||
Cutting1.dResultWeight = 0.3
|
||||
table.insert( Cuttings, Cutting1)
|
||||
end
|
||||
|
||||
-- si estende il lato il più possibile
|
||||
if Cutting2.bIsApplicable then
|
||||
|
||||
-- se si lavora il lato in comune con l'altra BottomFace significa ci si deve fermare piú indietro
|
||||
if OtherBottomFace and ( EdgeToMachine.idAdjacentFace == OtherBottomFace.id) then
|
||||
dStripWidth = TOOLS[Cutting2.nToolIndex].dThickness + 2 * dStripWidth
|
||||
end
|
||||
-- se richiesto, si calcola il codolo verticale
|
||||
if bAllowPerpendicularStrip and FeatureLib.IsMachiningLong( Cutting1.dEdgeLength, Part) then
|
||||
dDepthToMachine = TOOLS[Cutting2.nToolIndex].dMaxMaterial - 10
|
||||
else
|
||||
dDepthToMachine = min( TOOLS[Cutting2.nToolIndex].dMaxMaterial, EdgeToMachine.dElevation - dStripWidth)
|
||||
end
|
||||
|
||||
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
|
||||
|
||||
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
|
||||
Cutting2.nInternalSortingPriority = 2
|
||||
Cutting2.dResultWeight = 0.3
|
||||
table.insert( Cuttings, Cutting2)
|
||||
end
|
||||
end
|
||||
|
||||
return Cuttings
|
||||
|
||||
Reference in New Issue
Block a user