Compare commits

..

1 Commits

Author SHA1 Message Date
daniele.nicoli 6a54d2315b NON completamente funzionante - Ingressi e uscite Saw per Slot. Ticket#3045 2026-07-23 17:19:17 +02:00
4 changed files with 82 additions and 50 deletions
+2 -2
View File
@@ -931,7 +931,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
end
---------------------------------------------------------------------
function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vtRef, dCutExtra, b3Box)
function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vtRef, dCutExtra, b3Box, bIsRightWorkside)
-- Mi assicuro che i vettori ingresso/uscita giacciano nel piano
vtV1 = vtV1 - vtV1 * vtN * vtN ; vtV1:normalize()
vtV2 = vtV2 - vtV2 * vtN * vtN ; vtV2:normalize()
@@ -941,7 +941,7 @@ function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vt
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
local bRight = ( vtX * vtRef > 0)
local bRight = EgtIf( bIsRightWorkside == nil, ( vtX * vtRef > 0), bIsRightWorkside)
EgtOutLog( 'LioPerp --> Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Versore di attacco e uscita
+79 -44
View File
@@ -5662,7 +5662,7 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
end
function SawPlusChain.CalculateLeadInOut( Machining, EdgeToMachine, FaceToMachine, b3Raw)
function SawPlusChain.CalculateLeadInOut( Machining, EdgeToMachine, FaceToMachine, b3Raw, Proc)
-- TODO implementare le funzioni di Tool Collision Avoidance (vedi wiki e FacesBysaw -> CalcLeadInOutPerpGeom)
-- si determina l'eventuale riduzione da applicare in caso di inizio o fine chiusi
@@ -5713,18 +5713,49 @@ function SawPlusChain.CalculateLeadInOut( Machining, EdgeToMachine, FaceToMachin
LeadIn.StartAddLength = BD.CUT_EXTRA
LeadOut.EndAddLength = BD.CUT_EXTRA
end
local vtN = Vector3d( FaceToMachine.VtN)
local vtOrthO
if EdgeToMachine.Elevation > - 10 * GEO.EPS_SMALL then
vtOrthO = Vector3d( EdgeToMachine.ToolDirection)
else
vtOrthO = -Vector3d( EdgeToMachine.ToolDirection)
end
local ptP1 = Point3d( EdgeToMachine.ptStart)
local ptP2 = Point3d( EdgeToMachine.ptEnd)
local Edges = BL.GetEdgesInfo( Proc, FaceToMachine.Id)
local vtV1 = -Vector3d( Edges[EdgeToMachine.PreviousEdgeIndex].vtEdge)
local vtV2 = Vector3d( Edges[EdgeToMachine.NextEdgeIndex].vtEdge)
local bInvert = Machining.Invert
if bInvert then
ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1
end
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
Machining.vtTg = vtTg
Machining.vtV = vtV1
-- Versore di riferimento
local vtRef = Vector3d( vtTg)
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
local bIsRightWorkside = Machining.Workside == MCH_MILL_WS.RIGHT
if bIsRightWorkside ~= bInvert--[[ and EdgeToMachine.Id ~= FaceToMachine.Edges.BottomEdge.Id]] then
vtV1 = -vtV1
vtV2 = -vtV2
end
local b3Box = BBox3d( b3Raw)
b3Box:expand( BD.CUT_SIC)
local ptPa1 = ptP1 + LeadIn.StartAddLength * -vtTg
local ptPa2 = ptP2 + LeadOut.EndAddLength * vtTg
Machining.vtTg = vtTg
LeadIn.vtV1 = vtV1
LeadOut.vtV2 = vtV2
LeadIn.ptP1 = ptP1
LeadOut.ptP2 = ptP2
Machining.vtOffset = vtRef
LeadIn.TangentDistance, LeadIn.PerpDistance, LeadOut.TangentDistance, LeadOut.PerpDistance = Fbs.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, ( Machining.Tool.Diameter / 2), vtRef, -Machining.RadialOffset, b3Box, bIsRightWorkside)
else
if Machining.IsStartClosed then
LeadIn.StartAddLength = -dAddLengthToReduce
@@ -5837,42 +5868,23 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
end
function SawPlusChain.Saw.GetSCC( vtMachiningDirection, vtN, vtTg)
function SawPlusChain.Saw.GetSCC( vtMachiningDirection)
-- TODO implementare SCC come per FacesBySaw
if not BD.TURN then
-- per ora aggregato usato in verticale solo in split e headcut; Fast non influenzata
if BD.C_SIMM and bMaximizeVerticalDepth then
nSCC = MCH_SCC.ADIR_ZM
elseif abs( vtMachiningDirection:getX()) > abs( vtMachiningDirection:getY()) - GEO.EPS_SMALL then
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = EgtIf( ( vtMachiningDirection:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
else
nSCC = EgtIf( ( vtMachiningDirection:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
else
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = EgtIf( ( vtMachiningDirection:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
else
nSCC = EgtIf( ( vtMachiningDirection:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
else
if AreSameVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZP
elseif AreOppositeVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZM
elseif AreSameVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YP
elseif AreOppositeVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YM
elseif AreSameVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XP
elseif AreOppositeVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XM
end
local nSCC = MCH_SCC.NONE
if AreSameVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZP
elseif AreOppositeVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZM
elseif AreSameVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YP
elseif AreOppositeVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YM
elseif AreSameVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XP
elseif AreOppositeVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XM
end
return nSCC
end
@@ -5994,15 +6006,15 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
Cutting.Faceuse = BL.GetNearestOrthoOpposite( -EdgeToMachine.ToolDirection)
end
Cutting.nEdgeFaceUse = EdgeToMachine.Id
-- SCC
Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection)
-- asse bloccato
Cutting.BlockedAxis = {}
Cutting.BlockedAxis.Orientation = 'perpendicular'
Cutting.BlockedAxis.VtN = FaceToMachine.VtN
Cutting.BlockedAxis.VtOut = EgtIf( FaceToMachine.VtN:getX() > 0, X_AX(), -X_AX())
-- approccio e retrazione
Cutting.LeadIn, Cutting.LeadOut = SawPlusChain.CalculateLeadInOut( Cutting, EdgeToMachine, FaceToMachine, b3Raw)
-- SCC
Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection, FaceToMachine.VtN, Cutting.vtTg)
Cutting.LeadIn, Cutting.LeadOut = SawPlusChain.CalculateLeadInOut( Cutting, EdgeToMachine, FaceToMachine, b3Raw, Proc)
-- eventuale step orizzontale
Cutting.HorizontalSteps = {}
if Cutting.Tool.SideStep then
@@ -6036,15 +6048,38 @@ function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
local bIsCuttingOk = false
local sCuttingOriginalMessage = Cutting.Message or ''
local sCuttingApplyMessage = ''
local vtTg = Cutting.vtTg
local bInvert = Cutting.Invert
local dOriginalRadialOffset = Cutting.RadialOffset
local dOriginalLeadInPerpDistance = Cutting.LeadIn.PerpDistance
local dOriginalLeadInTangDistance = Cutting.LeadIn.TangentDistance
local dOriginalLeadOutPerpDistance = Cutting.LeadOut.PerpDistance
local dOriginalLeadOutTangDistance = Cutting.LeadOut.TangentDistance
for i = Cutting.HorizontalSteps.Count, 1, -1 do
Cutting.RadialOffset = dOriginalRadialOffset + Cutting.HorizontalSteps.StepLength * ( i - 1)
local dRadialStep = Cutting.HorizontalSteps.StepLength * ( i - 1)
local dDirectionProportion = ( Cutting.LeadIn.vtV1 * vtTg)
Cutting.RadialOffset = dOriginalRadialOffset + dRadialStep
local dStepOffset = Cutting.RadialOffset - dOriginalRadialOffset
local dTangOffsetStep = ( Cutting.RadialOffset * dDirectionProportion)
local bTiltedSlot = abs( dDirectionProportion) > 0 + 10 * GEO.EPS_SMALL
local bIsRightWorkside = Cutting.Workside == MCH_MILL_WS.RIGHT
-- update distanza perpendicolare attacco per contemplare l'offset applicato
Cutting.LeadIn.PerpDistance = dOriginalLeadInPerpDistance - Cutting.RadialOffset
Cutting.LeadOut.PerpDistance = dOriginalLeadOutPerpDistance - Cutting.RadialOffset
local b3Box = BBox3d( b3Raw)
b3Box:expand( BD.CUT_SIC)
local ptPa1 = Cutting.LeadIn.ptP1 + ( Cutting.LeadIn.StartAddLength - dTangOffsetStep) * -vtTg + dStepOffset * Cutting.LeadIn.vtV1
local ptPa2 = Cutting.LeadOut.ptP2 + ( Cutting.LeadOut.EndAddLength + dTangOffsetStep) * vtTg + dStepOffset * Cutting.LeadOut.vtV2
Cutting.LeadIn.TangentDistance, Cutting.LeadIn.PerpDistance, Cutting.LeadOut.TangentDistance, Cutting.LeadOut.PerpDistance = Fbs.CalcLeadInOutPerpGeom( ptPa1, ptPa2, Cutting.LeadIn.vtV1, Cutting.LeadOut.vtV2, Cutting.BlockedAxis.VtN, ( Cutting.Tool.Diameter / 2), Cutting.vtOffset, -Cutting.RadialOffset, b3Box, bIsRightWorkside)
--Cutting.LeadIn.PerpDistance = dOriginalLeadInPerpDistance - dRadialStep --dOriginalLeadInPerpDistance - Cutting.RadialOffset
--Cutting.LeadIn.TangentDistance = dOriginalLeadInTangDistance + dTangOffsetStep --+ Cutting.LeadIn.StartAddLength
--Cutting.LeadOut.PerpDistance = dOriginalLeadOutPerpDistance - dRadialStep --- Cutting.RadialOffset
--Cutting.LeadOut.TangentDistance = dOriginalLeadOutTangDistance - dTangOffsetStep --- Cutting.LeadOut.EndAddLength
Cutting.LeadIn.StartAddLength = Cutting.LeadIn.StartAddLength + EgtIf( bTiltedSlot, - ( dTangOffsetStep + Cutting.LeadIn.StartAddLength), 0)
Cutting.LeadOut.EndAddLength = Cutting.LeadOut.EndAddLength + EgtIf( bTiltedSlot, ( dTangOffsetStep + Cutting.LeadOut.EndAddLength), 0)
-- applicazione lavorazione
bIsCuttingOk, sCuttingApplyMessage = SawPlusChain.ApplyMachining( Cutting, b3Raw)
-- update messaggi
-3
View File
@@ -1,8 +1,5 @@
==== Beam Update Log ====
Versione 3.1g3 (24/07/2026)
- Fixed : in slot con lama corretta scelta SCC
Versione 3.1g2 (17/07/2026)
- Modif : Diminuito LastStep forature in doppio
- Modif : ScarfJoint tra le feature da eseguire dopo i fori che la attraversano
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '3.1g3'
VERSION = '3.1g2'
MIN_EXE = '3.1b1'