Compare commits
7 Commits
ScarfJoint
...
3.1e1
| Author | SHA1 | Date | |
|---|---|---|---|
| c7045499f4 | |||
| 44478b91f0 | |||
| 1f4aa15af4 | |||
| a5d606b225 | |||
| c4697fbd6f | |||
| f58004dfeb | |||
| 7c485360de |
@@ -153,6 +153,11 @@ function BeamExec.GetToolsFromDB()
|
||||
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE', 'd')
|
||||
Tool.bIsProfiledTool = not EgtTdbIsCurrToolStandardDraw()
|
||||
|
||||
-- TODO per capire se ToolHolder è flottante bisogna leggere nota TYPE='Float' su ToolHolder. Serve funzione
|
||||
-- info per utensile su ToolHolder flottante
|
||||
Tool.dOverHang = EgtGetValInNotes( Tool.sUserNotes, 'TOOL_OVERHANG', 'd') or 0
|
||||
Tool.bToolOnFloatingTH = Tool.dOverHang > 0
|
||||
|
||||
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
|
||||
if sToolFamily ~= 'DRILLBIT' then
|
||||
Tool.dThickness = EgtTdbGetCurrToolParam( MCH_TP.THICK)
|
||||
|
||||
+11
-10
@@ -785,17 +785,18 @@ function BeamLib.BinaryToDecimal( dNumber)
|
||||
local sNumberToConvert = tostring( dNumber)
|
||||
local dResult = 0
|
||||
local k = 0
|
||||
|
||||
|
||||
for i = #sNumberToConvert, 1, -1 do
|
||||
k = k + 1
|
||||
local n = string.sub(sNumberToConvert, k, k)
|
||||
dResult = dResult + n*(2^(i-1))
|
||||
local n = string.sub( sNumberToConvert, k, k)
|
||||
dResult = dResult + n * ( 2^( i-1))
|
||||
end
|
||||
|
||||
|
||||
return dResult
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO si può sostituire con funzione EgtNumToBitString
|
||||
function BeamLib.DecimalToBinary( dNumber)
|
||||
local sNumberToConvert = tostring( dNumber)
|
||||
local n = sNumberToConvert
|
||||
@@ -803,12 +804,12 @@ function BeamLib.DecimalToBinary( dNumber)
|
||||
local sResult = ""
|
||||
|
||||
for i = sNumberToConvert, 0, -1 do
|
||||
local q = math.modf(n)
|
||||
n = n/2
|
||||
local b = q%2
|
||||
table.insert(tmp, b)
|
||||
local q = math.modf( n)
|
||||
n = n / 2
|
||||
local b = q % 2
|
||||
table.insert( tmp, b)
|
||||
|
||||
if (q == 1) then
|
||||
if ( q == 1) then
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -816,7 +817,7 @@ function BeamLib.DecimalToBinary( dNumber)
|
||||
for i = #tmp, 1, -1 do
|
||||
sResult = sResult..tmp[i]
|
||||
end
|
||||
|
||||
|
||||
return tonumber( sResult)
|
||||
end
|
||||
|
||||
|
||||
@@ -301,16 +301,14 @@ local function MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||
EgtSetAxisPos( AxesNames[6], dRotative3)
|
||||
end
|
||||
|
||||
return dTHome - dLinear1, AxesNames
|
||||
return dLinear1 - dTHome
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
|
||||
|
||||
-- spostamento assi macchina in posizione
|
||||
local dDeltaXBeamOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||
-- spostamento trave in posizione macchina (è da riportare in posizione originale prima di return)
|
||||
EgtMove( Part.idRaw, Vector3d( dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
||||
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||
|
||||
-- si recuperano gli id delle geometrie dell'asse con cui controllare la collisione
|
||||
local idCollisionGroup = EgtGetFirstNameInGroup( EgtGetAxisId( sAxis), 'COLLISION')
|
||||
@@ -321,14 +319,18 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
||||
local CollisionSurfTmId = {}
|
||||
for i = 1, #CollisionGroupEntitiesId do
|
||||
if EgtGetType( CollisionGroupEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||
table.insert( CollisionSurfTmId, CollisionGroupEntitiesId[i])
|
||||
local idCollisionSurfTmCopy = EgtCopyGlob( CollisionGroupEntitiesId[i], Part.idTempGroup)
|
||||
EgtMove( idCollisionSurfTmCopy, Vector3d( dDeltaXHeadOffset, 0, 0), GDB_RT.GLOB)
|
||||
table.insert( CollisionSurfTmId, idCollisionSurfTmCopy)
|
||||
end
|
||||
end
|
||||
-- se presenti geometrie nel gruppo other si aggiungono anche quelle
|
||||
if CollisionGroupOtherEntitiesId and #CollisionGroupOtherEntitiesId > 0 then
|
||||
for i = 1, #CollisionGroupEntitiesId do
|
||||
if EgtGetType( CollisionGroupEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||
table.insert( CollisionSurfTmId, CollisionGroupEntitiesId[i])
|
||||
for i = 1, #CollisionGroupOtherEntitiesId do
|
||||
if EgtGetType( CollisionGroupOtherEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||
local idCollisionOtherSurfTmCopy = EgtCopyGlob( CollisionGroupOtherEntitiesId[i], Part.idTempGroup)
|
||||
EgtMove( idCollisionOtherSurfTmCopy, Vector3d( dDeltaXHeadOffset, 0, 0), GDB_RT.GLOB)
|
||||
table.insert( CollisionSurfTmId, idCollisionOtherSurfTmCopy)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -357,8 +359,6 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
||||
|
||||
-- se trovata collisione con pezzo è inutile procedere con il grezzo
|
||||
if bCollisionFoundPiece then
|
||||
-- si riporta la trave in posizione originale
|
||||
EgtMove( Part.idRaw, Vector3d( -dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -368,7 +368,6 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
||||
local bCollisionFoundRestLength = false
|
||||
if not ( bCollisionFoundPiece or bCannotSplitRestLength) then
|
||||
local idRestLengthSurfFr = GetRestlengthSurfTm( Part, sRestLengthSideForPreSimulation)
|
||||
EgtMove( idRestLengthSurfFr, Vector3d( dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
||||
if idRestLengthSurfFr then
|
||||
for i = 1, #CollisionSurfTmId do
|
||||
bCollisionFoundRestLength = EgtCDeSolidSolid( idRestLengthSurfFr, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||
@@ -385,9 +384,6 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
||||
end
|
||||
end
|
||||
|
||||
-- si riporta la trave in posizione originale
|
||||
EgtMove( Part.idRaw, Vector3d( -dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
||||
|
||||
return false, bCollisionFoundRestLength
|
||||
end
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ local function GetTenonStrategy( Proc, Part)
|
||||
ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( Strategy.idTenonCutPlane, 0, Part.b3Part, true, GDB_ID.ROOT)
|
||||
|
||||
ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN
|
||||
ToolSearchParameters.sMillShape = 'STANDARD'
|
||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
||||
Machining.Cutting.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ local function GetSCC( Machining)
|
||||
|
||||
if TOOLS[Machining.nToolIndex].SetupInfo.bToolOnAggregate then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif TOOLS[Machining.nToolIndex].SetupInfo.nBlockedSCC then
|
||||
nSCC = TOOLS[Machining.nToolIndex].SetupInfo.nBlockedSCC
|
||||
elseif Machining.vtToolDirection:getY() <= 0 then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
else
|
||||
@@ -96,7 +98,7 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Strategy.Machining.nSCC = GetSCC( Strategy.Machining)
|
||||
|
||||
Strategy.Machining.nType = MCH_MY.MILLING
|
||||
Strategy.Machining.sDepth = EgtClamp( Strategy.Parameters.dMachiningDepth, -1, 5)
|
||||
Strategy.Machining.sDepth = EgtClamp( Strategy.Parameters.dMachiningDepth, -1, TOOLS[Strategy.Machining.nToolIndex].dMaxMaterial)
|
||||
Strategy.Machining.nWorkside = MCH_MILL_WS.CENTER
|
||||
|
||||
-- LeadIn / LeadOut
|
||||
@@ -104,7 +106,19 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Strategy.Machining.LeadOut = {}
|
||||
Strategy.Machining.LeadIn.nType = MCH_MILL_LI.NONE
|
||||
Strategy.Machining.LeadOut.nType = MCH_MILL_LI.NONE
|
||||
|
||||
-- se è una penna, si limita la lavorazione per evitare di partire fuori dal grezzo
|
||||
if ToolSearchParameters.sMillShape == 'PEN' then
|
||||
Strategy.Machining.LeadIn.dStartAddLength = -20
|
||||
Strategy.Machining.LeadOut.dEndAddLength = -20
|
||||
end
|
||||
|
||||
-- TODO gestire meglio
|
||||
-- se utensile montato su aggregato flottante
|
||||
if TOOLS[Strategy.Machining.nToolIndex].bToolOnFloatingTH then
|
||||
Strategy.Machining.dMaxElev = Strategy.Parameters.dMachiningDepth
|
||||
Strategy.Machining.dLongitudinalOffset = -5
|
||||
end
|
||||
-- stessi parametri cambia solo al geometria
|
||||
for i = 1, #Proc.FeatureInfo.AdditionalGeometries do
|
||||
local AuxId = Proc.id + Proc.FeatureInfo.AdditionalGeometries[i]
|
||||
|
||||
@@ -232,6 +232,9 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
Tool = TOOLS[Cutting.nToolIndex],
|
||||
dDepthToMachine = dDepthToMachine
|
||||
}
|
||||
if OppositeToolDirectionMode == 'Enabled' then
|
||||
BladeEngagementParameters.Edge = EdgeToMachineOpposite
|
||||
end
|
||||
local BladeEngagementOptionalParameters = {
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6-- (--/--/2024)
|
||||
- Primo commit creazione nuovo automatismo BEAM con strategie
|
||||
Versione 3.1e1 (29/05/2026)
|
||||
- Primo commit nuovo automatismo a strategie
|
||||
+2
-2
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.8a1'
|
||||
MIN_EXE = '2.7j2'
|
||||
VERSION = '3.1e1'
|
||||
MIN_EXE = '3.1e1'
|
||||
|
||||
Reference in New Issue
Block a user