Compare commits
13 Commits
3.1g2
...
DiceRawFix
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d2d17e11f | |||
| 16c9ac9771 | |||
| 098c4e1fe3 | |||
| 33ede89b64 | |||
| b171ba5d0d | |||
| ed658fffa6 | |||
| 18789c30f2 | |||
| 4e2afcd4bf | |||
| 4e4e183382 | |||
| d769b603bd | |||
| 06ed12b1fe | |||
| 2e289e1921 | |||
| c55395f829 |
@@ -356,11 +356,11 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
||||
end
|
||||
end
|
||||
|
||||
-- se trovata collisione con pezzo è inutile procedere con il grezzo
|
||||
if bCollisionFoundPiece then
|
||||
-- se trovata collisione con pezzo è inutile procedere con il grezzo
|
||||
if bCollisionFoundPiece then
|
||||
|
||||
return true
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- check collisione con grezzo restante, se con il pezzo non c'è collisione e non è un taglio di testa o coda
|
||||
local bCollisionFoundRestLength = false
|
||||
@@ -443,6 +443,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
||||
idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB)
|
||||
end
|
||||
|
||||
-- TODO raggruppare parametri opzionali!
|
||||
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
|
||||
|
||||
-- se trovata collisione con pezzo è inutile controllare gli altri punti
|
||||
|
||||
@@ -326,7 +326,7 @@ function STR0001.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
|
||||
-- controllo conformità offset tenone
|
||||
Strategy.Parameters.dOverMatOnRadius = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
|
||||
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
|
||||
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnLength, -5, 5)
|
||||
|
||||
-- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda
|
||||
local dLengthOnX = Proc.b3Box:getDimX()
|
||||
|
||||
@@ -216,6 +216,9 @@ function STR0011.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
|
||||
-- aggiunge lavorazione
|
||||
for j = 1, #Strategy.Machinings do
|
||||
if Proc.AffectedFaces.bLeft and not Proc.FeatureInfo.bIsDrillOpen then
|
||||
Strategy.Machinings[j].sStage = 'AfterTail'
|
||||
end
|
||||
Strategy.Machinings[j].nType = MCH_MY.DRILLING
|
||||
Strategy.Machinings[j].Steps.dStep = TOOLS[Strategy.Machinings[j].ToolInfo.nToolIndex].dStep
|
||||
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j])
|
||||
|
||||
@@ -858,24 +858,38 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
CurrentMachining.LeadInForSplit.nType = MCH_MILL_LI.LINEAR
|
||||
CurrentMachining.LeadOutForSplit.nType = MCH_MILL_LI.LINEAR
|
||||
CurrentMachining.LeadInForSplit.dTangentDistance = 0
|
||||
CurrentMachining.LeadInForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||
CurrentMachining.LeadOutForSplit.dTangentDistance = 0
|
||||
CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||
if not ID.IsFreeContour( Proc) then
|
||||
CurrentMachining.LeadInForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||
CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||
end
|
||||
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
if CurrentMachining.bOtherDirection then
|
||||
CurrentMachining.bToolInvert = true
|
||||
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
|
||||
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
-- sistemo il lato e la direzione di lavoro; se FreeContour il lato è determinato dalla Feature, altrimenti dalla concordanza
|
||||
if ID.IsFreeContour( Proc) then
|
||||
CurrentMachining.bInvert = false
|
||||
if Proc.nGrp == 0 then
|
||||
CurrentMachining.nWorkside = MCH_MILL_WS.CENTER
|
||||
elseif Proc.nGrp == 3 then
|
||||
CurrentMachining.nWorkside = MCH_MILL_WS.LEFT
|
||||
elseif Proc.nGrp == 4 then
|
||||
CurrentMachining.nWorkside = MCH_MILL_WS.RIGHT
|
||||
end
|
||||
else
|
||||
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true)
|
||||
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
if CurrentMachining.bOtherDirection then
|
||||
CurrentMachining.bToolInvert = true
|
||||
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
|
||||
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
else
|
||||
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true)
|
||||
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
end
|
||||
end
|
||||
CurrentMachining.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
|
||||
CurrentMachining.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
|
||||
CurrentMachining.dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom)
|
||||
CurrentMachining.vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT)
|
||||
CurrentMachining.dLengthOnX = Proc.b3Box:getDimX()
|
||||
CurrentMachining.vtHead = CurrentMachining.vtToolDirection
|
||||
|
||||
local MachiningToSplit = {}
|
||||
table.insert( MachiningToSplit, CurrentMachining)
|
||||
|
||||
@@ -782,44 +782,74 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
|
||||
end
|
||||
|
||||
|
||||
-- TODO da rivedere!! Si devono creare trimesh estruse nelle direzioni normali alle due facce, unirle e poi sottrarle al solido
|
||||
-- nel modo attuale funziona solo se i cubetti sono orientati come le direzioni principali
|
||||
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
|
||||
|
||||
-- frame solidale alla feature
|
||||
local vtZ = MainFace.vtN
|
||||
local vtX = OtherFace and OtherFace.vtN or nil
|
||||
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
|
||||
-- -- frame solidale alla feature
|
||||
-- local vtZ = MainFace.vtN
|
||||
-- local vtX = OtherFace and OtherFace.vtN or nil
|
||||
-- local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
|
||||
|
||||
-- box del cubetto in riferimento feature
|
||||
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
|
||||
if idPerpendicularTm then
|
||||
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
|
||||
b3Surf:Add( b3SurfPerpendicular)
|
||||
else
|
||||
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
|
||||
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
|
||||
b3Surf:Add( ptDeltaZ)
|
||||
end
|
||||
-- -- box del cubetto in riferimento feature
|
||||
-- local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
|
||||
-- if idPerpendicularTm then
|
||||
-- local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
|
||||
-- b3Surf:Add( b3SurfPerpendicular)
|
||||
-- else
|
||||
-- -- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
|
||||
-- local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
|
||||
-- b3Surf:Add( ptDeltaZ)
|
||||
-- end
|
||||
|
||||
-- estensione box per non avere problemi nella sottrazione booleana
|
||||
if OtherFace and idPerpendicularTm then
|
||||
local vtY = vtZ ^ vtX
|
||||
local ptDeltaX = b3Surf:getMax() + vtX * 1
|
||||
local ptDeltaZ = b3Surf:getMax() + vtZ * 1
|
||||
local ptDeltaYplus = b3Surf:getMax() + vtY * 1
|
||||
local ptDeltaYminus = b3Surf:getMin() - vtY * 1
|
||||
b3Surf:Add( ptDeltaX)
|
||||
b3Surf:Add( ptDeltaZ)
|
||||
b3Surf:Add( ptDeltaYplus)
|
||||
b3Surf:Add( ptDeltaYminus)
|
||||
else
|
||||
b3Surf:expand( 1)
|
||||
end
|
||||
-- -- estensione box per non avere problemi nella sottrazione booleana
|
||||
-- if OtherFace and idPerpendicularTm then
|
||||
-- local vtY = vtZ ^ vtX
|
||||
-- local ptDeltaX = b3Surf:getMax() + vtX * 1
|
||||
-- local ptDeltaZ = b3Surf:getMax() + vtZ * 1
|
||||
-- local ptDeltaYplus = b3Surf:getMax() + vtY * 1
|
||||
-- local ptDeltaYminus = b3Surf:getMin() - vtY * 1
|
||||
-- b3Surf:Add( ptDeltaX)
|
||||
-- b3Surf:Add( ptDeltaZ)
|
||||
-- b3Surf:Add( ptDeltaYplus)
|
||||
-- b3Surf:Add( ptDeltaYminus)
|
||||
-- else
|
||||
-- b3Surf:expand( 1)
|
||||
-- end
|
||||
|
||||
-- si porta il box in riferimento globale
|
||||
b3Surf:toGlob( frMainFace)
|
||||
-- -- si porta il box in riferimento globale
|
||||
-- b3Surf:toGlob( frMainFace)
|
||||
|
||||
-- -- conversione box cubetto in superficie
|
||||
-- local idSurfTmToSubtract = EgtSurfTmBBox( Part.idTempGroup, b3Surf, false, GDB_RT.GLOB)
|
||||
|
||||
-- frame solidale alla feature
|
||||
|
||||
local idAddGroup = BeamLib.GetAddGroup( Part.id)
|
||||
|
||||
|
||||
-- contorno della faccia parallela
|
||||
local vtNParallelFaceTm = EgtSurfTmFacetNormVersor( idParallelTm, 0, GDB_ID.ROOT)
|
||||
local idParallelFaceCurveCompo = EgtExtractSurfTmLoops( idParallelTm, idAddGroup) --Part.idTempGroup
|
||||
EgtModifyCurveExtrusion( idParallelFaceCurveCompo, vtNParallelFaceTm, GDB_RT.GLOB)
|
||||
EgtOffsetCurve( idParallelFaceCurveCompo, 1000, GDB_OT.EXTEND)
|
||||
|
||||
-- trimesh da sottrarre
|
||||
local vtExtrusion = 1000 * vtNParallelFaceTm
|
||||
local idSurfTmToSubtract = EgtSurfTmByRegionExtrusion( idAddGroup, idParallelFaceCurveCompo, vtExtrusion , 0.05, GDB_RT.GLOB) --Part.idTempGroup
|
||||
local ptCenterPerpendicularTm, vtNPerpendicularTm = EgtSurfTmFacetCenter( idPerpendicularTm, 0, GDB_ID.ROOT)
|
||||
if idPerpendicularTm then
|
||||
EgtCutSurfTmPlane( idSurfTmToSubtract, ptCenterPerpendicularTm, -vtNPerpendicularTm, false, GDB_RT.GLOB)
|
||||
end
|
||||
|
||||
local idRemovedFaceCurveCompo = EgtExtractSurfTmLoops( idSurfTmToSubtract, idAddGroup)
|
||||
local idRemovedFaceTm = EgtSurfTmByFlatContour( idAddGroup, idRemovedFaceCurveCompo)
|
||||
local vtNRemovedFace = EgtSurfTmFacetNormVersor( idRemovedFaceTm, 0, GDB_ID.ROOT)
|
||||
if AreSameVectorApprox( vtNPerpendicularTm, vtNRemovedFace) then
|
||||
EgtInvertSurf( idRemovedFaceTm)
|
||||
end
|
||||
idSurfTmToSubtract = EgtSurfTmBySewing( idAddGroup, { idSurfTmToSubtract, idRemovedFaceTm})
|
||||
|
||||
-- conversione box cubetto in superficie
|
||||
local idSurfTmToSubtract = EgtSurfTmBBox( Part.idTempGroup, b3Surf, false, GDB_RT.GLOB)
|
||||
|
||||
-- sottrazione del cubetto dal grezzo
|
||||
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
|
||||
|
||||
+2
-2
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di BeamNT
|
||||
|
||||
NAME = 'BeamNT'
|
||||
VERSION = '3.1g2'
|
||||
MIN_EXE = '3.1g1'
|
||||
VERSION = '3.1g4'
|
||||
MIN_EXE = '3.1g3'
|
||||
|
||||
Reference in New Issue
Block a user