- Creazione gruppo temporaneo (da riportare)

- Riconoscimento Topologico SawCut se attraversa la trave (da riportare)
- Dati di pinzaggio feature spostato in STR0012
This commit is contained in:
andrea.villa
2025-10-24 17:10:22 +02:00
parent fac9fd8877
commit 746eb9efe9
7 changed files with 87 additions and 8 deletions
+39 -5
View File
@@ -32,8 +32,6 @@ function FeatureLib.GetProcFromTrimesh( idTrimesh, Part, ProcToCopyFrom)
Proc.AffectedFaces = BeamLib.GetAffectedFaces( Proc, Part)
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
Proc.Faces = FaceData.GetFacesInfo( Proc, Part)
Proc.NotClampableLength = FeatureLib.CalculateFeatureNotClampableLengths( Proc, Part)
Proc.bHindersLaserMeasure = FeatureLib.CalculateFeatureHindersLaserMeasure( Proc, Part)
-- TODO servono anche altri dati raccolti nel collect??
return Proc
@@ -52,6 +50,39 @@ local function IsFeatureCuttingEntireLength( b3Proc, Part)
( b3Proc:getDimZ() > ( Part.b3Part:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Part:getDimX() - 500 * GEO.EPS_SMALL)))
end
-------------------------------------------------------------------------------------------------------------
-- restituisce vero se tutti i lati della faccia passata si trovano sul grezzo
local function AreAllFaceEdgesOnRaw( Part, Proc, idFace)
local bEdgeOnRaw = true
local idTempGroup = BeamLib.GetTempGroup()
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.id, idFace, idTempGroup)
if nLoopCnt > 1 then
error( 'AreAllFaceEdgesOnRaw : too many loops')
end
if nLoopId then
local dUmin, dUmax = EgtCurveDomain( nLoopId)
for dU = dUmin, dUmax-1 do
local ptMid = ( EgtUP( nLoopId, dU, GDB_ID.ROOT) + EgtUP( nLoopId, dU+1, GDB_ID.ROOT)) / 2
-- se punto medio dell'entita NON si trova su faccia testa o coda
if ptMid:getX() < Part.b3Part:getMin():getX() + 100 * GEO.EPS_SMALL or ptMid:getX() > Part.b3Part:getMax():getX() - 100 * GEO.EPS_SMALL or
ptMid:getY() < Part.b3Part:getMin():getY() + 100 * GEO.EPS_SMALL or ptMid:getY() > Part.b3Part:getMax():getY() - 100 * GEO.EPS_SMALL or
ptMid:getZ() < Part.b3Part:getMin():getZ() + 100 * GEO.EPS_SMALL or ptMid:getZ() > Part.b3Part:getMax():getZ() - 100 * GEO.EPS_SMALL then
bEdgeOnRaw = true
else
bEdgeOnRaw = false
break
end
end
--for j = 1, nLoopCnt do
-- EgtErase( nLoopId + j - 1)
--end
end
return bEdgeOnRaw
end
---------------------------------------------------------------------
-- recupero topologia della feature
function FeatureLib.NeedTopologyFeature( Proc, Part)
@@ -87,9 +118,7 @@ function FeatureLib.NeedTopologyFeature( Proc, Part)
elseif ID.IsStepJointNotch( Proc) then -- (0-80)
return true
-- feature con calcolo topologia da geometria SOLO se rispettano certe condizioni, altrimenti riconoscimento specifico
elseif ID.IsSawCut( Proc) and Proc.nFct == 1 then
--and ( IsFeatureCuttingEntireSection( Proc.b3Box, Part)
--or IsFeatureCuttingEntireLength( Proc.b3Box, Part)) then -- (0-13)
elseif ID.IsSawCut( Proc) and Proc.nFct == 1 and AreAllFaceEdgesOnRaw( Part, Proc, 0) then
return true
elseif ID.IsHipValleyRafterNotch( Proc) and Proc.nFct < 4 then -- (0-25)
return true
@@ -910,6 +939,11 @@ function FeatureLib.CalculateFeatureNotClampableLengths( Proc, Part)
local dNotClampableLengthHead = 0
local dNotClampableLengthTail = 0
-- se il grezzo non è definito, prendo il box del pezzo
if not Part.b3Raw then
Part.b3Raw = Part.b3Part
end
-- TODO se la feature ha più di 3 facce non viene mai calcolato!! Es. Tenone ecc....
if Proc.nFct < 3 then
-- eventuale segnalazione ingombro di testa o coda