- in PreSimulationLib aggiunta funzione CheckOutOfStrokeFromGeometry, refactoring da STR0001
This commit is contained in:
@@ -234,6 +234,36 @@ function PreSimulationLib.CheckOutOfStroke( PointsOnToolTipCenter, vtHead, nSCC,
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- check extracorsa da geometria
|
||||
function PreSimulationLib.CheckOutOfStrokeFromGeometry( idGeometry, Proc, nSCC, Tool)
|
||||
|
||||
local b3GeomMaxOffset = EgtGetBBoxGlob( idGeometry, GDB_BB.STANDARD)
|
||||
local ptBoxCenter = b3GeomMaxOffset:getCenter()
|
||||
local dBoxDimX = b3GeomMaxOffset:getDimX()
|
||||
local dBoxDimY = b3GeomMaxOffset:getDimY()
|
||||
local dBoxDimZ = b3GeomMaxOffset:getDimZ()
|
||||
|
||||
-- si controlla il finecorsa nei punti al centro delle 6 facce del box
|
||||
local PointsOnToolTipCenter = {}
|
||||
-- X+
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter + dBoxDimX / 2 * X_AX()))
|
||||
-- X-
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter - dBoxDimX / 2 * X_AX()))
|
||||
-- Y+
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter + dBoxDimY / 2 * Y_AX()))
|
||||
-- Y-
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter - dBoxDimY / 2 * Y_AX()))
|
||||
-- Z+
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter + dBoxDimZ / 2 * Z_AX()))
|
||||
-- Z-
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter - dBoxDimZ / 2 * Z_AX()))
|
||||
|
||||
local bOutOfStroke = PreSimulationLib.CheckOutOfStroke( PointsOnToolTipCenter, Proc.FeatureInfo.vtTenonN, nSCC, Tool)
|
||||
|
||||
return bOutOfStroke
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CheckCollisionPoint( ptToolExitToCheck, vtC, vtHead, PreCollisionData, Part, bCheckOnlyRestlength)
|
||||
|
||||
|
||||
@@ -190,29 +190,7 @@ local function GetTenonStrategy( Proc, Part)
|
||||
-- TODO sostituire con applicazione della lavorazione?
|
||||
local idGeomMaxOffset = EgtCopyGlob( Proc.FeatureInfo.idAddAuxGeom, Part.idTempGroup)
|
||||
EgtOffsetCurve( idGeomMaxOffset, Machining.Milling.AuxiliaryData.Clones[1].dRadialOffset + TOOLS[Machining.Milling.ToolInfo.nToolIndex].dDiameter / 2, Part.idTempGroup)
|
||||
local b3GeomMaxOffset = EgtGetBBoxGlob( idGeomMaxOffset, GDB_BB.STANDARD)
|
||||
local ptBoxCenter = b3GeomMaxOffset:getCenter()
|
||||
local dBoxDimX = b3GeomMaxOffset:getDimX()
|
||||
local dBoxDimY = b3GeomMaxOffset:getDimY()
|
||||
local dBoxDimZ = b3GeomMaxOffset:getDimZ()
|
||||
|
||||
-- si controlla il finecorsa nei punti al centro delle 6 facce del box
|
||||
local PointsOnToolTipCenter = {}
|
||||
-- X+
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter + dBoxDimX / 2 * X_AX()))
|
||||
-- X-
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter - dBoxDimX / 2 * X_AX()))
|
||||
-- Y+
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter + dBoxDimY / 2 * Y_AX()))
|
||||
-- Y-
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter - dBoxDimY / 2 * Y_AX()))
|
||||
-- Z+
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter + dBoxDimZ / 2 * Z_AX()))
|
||||
-- Z-
|
||||
table.insert( PointsOnToolTipCenter, Point3d( ptBoxCenter - dBoxDimZ / 2 * Z_AX()))
|
||||
|
||||
local bOutOfStroke = PreSimulationLib.CheckOutOfStroke( PointsOnToolTipCenter, Proc.FeatureInfo.vtTenonN, Machining.Milling.nSCC, TOOLS[Machining.Milling.ToolInfo.nToolIndex])
|
||||
|
||||
local bOutOfStroke = PreSimulationLib.CheckOutOfStrokeFromGeometry( idGeomMaxOffset, Proc, Machining.Milling.nSCC, TOOLS[Machining.Milling.ToolInfo.nToolIndex])
|
||||
if bOutOfStroke then
|
||||
Machining.Milling.bIsApplicable = false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user