3dPrinting :

- aggiunte tipologie per ribs ( interni, esterni, illimitati)
- migliorie per ordinamento ribs.
This commit is contained in:
SaraP
2022-10-26 16:12:25 +02:00
parent aa750ff933
commit 213e6ac6ed
5 changed files with 397 additions and 208 deletions
+28 -15
View File
@@ -320,24 +320,29 @@ local function VerifyRibsLink( nLinkId, nCurr, nNext, dStrand, nGrpTmp)
-- verifico se si trova nella regione ammissibile
local nSurfId = EgtGetInfo( nCurr, KEY_ASSOCIATED_SURF, 'i')
local nRes = EgtCurveWithRegionClassify( nLinkId, nSurfId)
if nRes == GDB_CRC.OUT or nRes == GDB_CRC.INTERS then
return false
local nType1 = EgtGetInfo( nCurr, KEY_RIBS_TYPE, 'i')
local nType2 = EgtGetInfo( nNext, KEY_RIBS_TYPE, 'i')
if nType1 == RIB_TYPE.INTERNAL and nType2 == RIB_TYPE.INTERNAL then
if nRes == GDB_CRC.OUT or nRes == GDB_CRC.INTERS then
return false
end
elseif nType1 == RIB_TYPE.EXTERNAL and nType2 == RIB_TYPE.EXTERNAL then
if nRes == GDB_CRC.IN or nRes == GDB_CRC.INTERS then
return false
end
end
-- verifico se il link interseca una delle altre costolature
local vRibsIds = EgtGetNameInGroup( nGrp, RIBS_CRV .. '*')
local nLinkLoc = EgtCopyGlob( nLinkId, nGrpTmp)
local nLinkSrf = EgtSurfFrFatCurve( nGrpTmp, nLinkId, 0.5 * dStrand, false) or GDB_ID.NULL
for i = 1, #vRibsIds do
if vRibsIds[i] ~= nCurr and vRibsIds[i] ~= nNext then
local nCrvLoc = EgtCopyGlob( vRibsIds[i], nGrpTmp)
local ptInt = EgtIP( nLinkLoc, nCrvLoc, ORIG())
if ptInt then
local nRes = EgtCurveWithRegionClassify( vRibsIds[i], nLinkSrf)
if nRes == GDB_CRC.INTERS then
return false
end
end
end
EgtErase( nTotLink)
return true
end
@@ -685,6 +690,8 @@ local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, n
-- terzo tratto ( diretto verso esterno con ugello chiuso)
if dRibsLOWipe > GEO.EPS_SMALL then
local dAng = dRibsLOWipeAng + s_nDefaultWipeAng
local nType = EgtGetInfo( nCrv, KEY_RIBS_TYPE, 'i')
if nType == RIB_TYPE.EXTERNAL then dAng = - dAng end
vtE:rotate( vtSlicing, EgtIf( bInvert, - dAng, dAng))
local ptFinal = ptE + vtE * dRibsLOWipe
-- verifico soddisfi altezza minima per dimensioni utensile
@@ -774,10 +781,17 @@ local function CalcRibsToolPath( nCrvGrp, nTpathGrpId, LayerParams, dCorrZ)
local nShellsNbr = EgtGetInfo( tabRibs[i][1], KEY_RIBS_SHELLS_NBR, 'i')
-- se link aggiorno bInvert per il gruppo di costolature corrente in modo da essere coerente con il collegamento
if LayerParams.bRibsLink then
if i > 1 and not nInfo then
local nPrevShellsNbr = EgtGetInfo( tabRibs[i-1][1], KEY_RIBS_SHELLS_NBR, 'i')
if nPrevShellsNbr % 2 == 1 then
bInvert = not bInvert
if i > 1 then
nPrevType = EgtGetInfo( tabRibs[i-1][1], KEY_RIBS_TYPE, 'i')
nCurrType = EgtGetInfo( tabRibs[i][1], KEY_RIBS_TYPE, 'i')
-- se cambio tipologia di setto, l'orientamento della curva è già corretto
if nPrevType ~= nCurrType then
bInvert = false
elseif not nInfo then
local nPrevShellsNbr = EgtGetInfo( tabRibs[i-1][1], KEY_RIBS_SHELLS_NBR, 'i')
if nPrevShellsNbr % 2 == 1 then
bInvert = not bInvert
end
end
end
end
@@ -1058,8 +1072,7 @@ function CalcToolPath.Exec( nPartId)
local vtMove = Vector3d( 0, 0, dCorrZ)
-- se slicing a 45° aggiungo correzione anche in direzione dello slicing
local nSlicingType = EgtGetInfo( s_nPartId, KEY_SLICING_TYPE, 'i') or 1
local bSlicing45 = EgtGetInfo( s_nPartId, KEY_SLICING_45, 'b') or false -- da rimuovere
if nSlicingType == SLICING_TYPE.DEG45 or bSlicing45 then
if nSlicingType == SLICING_TYPE.DEG45 then
vtMove = vtMove + LayerParams.dLayHeight / 2 * LayerParams.vtSlicing
end
local SolidLayId = EgtGetFirstNameInGroup( s_nPartId, PRINT_SOLID)