- in SLOTBYCHAINSAW rimosse parti non utili
- in STR0003 piccole correzioni
This commit is contained in:
@@ -7,54 +7,12 @@
|
||||
local BeamLib = require( 'BeamLib')
|
||||
local BeamData = require( 'BeamData')
|
||||
local MachiningLib = require( 'MachiningLib')
|
||||
local FeatureData = require( 'FeatureData')
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local SLOTBYCHAINSAW = {}
|
||||
local Strategy = {}
|
||||
local Chainsaw = {}
|
||||
Result = {}
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local function IsTopologyOk( Proc)
|
||||
if Proc.Topology.bAllRightAngles and
|
||||
( Proc.Topology.sName == 'Pocket-5-Blind' or
|
||||
Proc.Topology.sName == 'Groove-3-Through' or
|
||||
Proc.Topology.sName == 'Groove-4-Blind' or
|
||||
Proc.Topology.sName == 'Tunnel-4-Through') then
|
||||
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function GetCompletionPercentage( Proc, Result)
|
||||
local dNotMachinedArea = 0
|
||||
local dCompletionPercentage = 0
|
||||
|
||||
if Proc.Topology.sFamily == 'Tunnel' then
|
||||
dNotMachinedArea = Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1].dLength * ( Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength - Result[1].dDepthMachined)
|
||||
if #Result == 2 then
|
||||
dNotMachinedArea = dNotMachinedArea - Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1].dLength * ( Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength - Result[2].dDepthMachined)
|
||||
end
|
||||
else
|
||||
if #Result == 1 then
|
||||
dNotMachinedArea = Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.dLength * ( Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength - Result[1].dDepthMachined)
|
||||
elseif #Result == 2 then
|
||||
dNotMachinedArea = ( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.dLength - Result[2].dDepthMachined) * ( Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength - Result[1].dDepthMachined)
|
||||
elseif #Result == 3 then
|
||||
dNotMachinedArea = ( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.dLength - Result[2].dDepthMachined - Result[3].dDepthMachined) * ( Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength - Result[1].dDepthMachined)
|
||||
end
|
||||
end
|
||||
dCompletionPercentage = 100 - dNotMachinedArea / Proc.MainFaces.LongFaces[1].dArea * 100
|
||||
|
||||
return dCompletionPercentage
|
||||
end
|
||||
|
||||
|
||||
local function CalculateLeadInOut( Machining, EdgeToMachine, sSideToMachine, dLengthToMachine)
|
||||
-- TODO implementare le funzioni di Tool Collision Avoidance (vedi wiki e FacesBysaw -> CalcLeadInOutPerpGeom)
|
||||
|
||||
@@ -89,7 +47,7 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, sSideToMachine, dLe
|
||||
end
|
||||
|
||||
|
||||
-- TODO calcolo area lavorata
|
||||
-- TODO calcolo area lavorata per completamento
|
||||
function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalParameters)
|
||||
local Mortising = {}
|
||||
Mortising.bIsApplicable = true
|
||||
|
||||
@@ -600,11 +600,11 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
-- ancora materiale residuo - si lavora da entrambi i lati
|
||||
if Chainsaw.Result.Side[1].dResidualDepth > 10 * GEO.EPS_SMALL then
|
||||
Chainsaw.Result.Side[1].bIsApplicable = false
|
||||
local OptionalParameters = { dMaxElev = Blade.Result[2].dResidualDepth + BeamData.CUT_EXTRA}
|
||||
local OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result[2].dResidualDepth + BeamData.CUT_EXTRA}
|
||||
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters)
|
||||
Chainsaw.AddResult( Mortising)
|
||||
OptionalParameters = {}
|
||||
OptionalParameters = { dMaxElev = Blade.Result[3].dResidualDepth + BeamData.CUT_EXTRA}
|
||||
OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result[3].dResidualDepth + BeamData.CUT_EXTRA}
|
||||
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters)
|
||||
Chainsaw.AddResult( Mortising)
|
||||
-- lavorando dai due lati non c'è materiale residuo - si può disabilitare la lavorazione del fondo
|
||||
|
||||
Reference in New Issue
Block a user