Compare commits

...

2 Commits

Author SHA1 Message Date
SaraP 1596869230 3dPrinting 2.6f1 :
- correzione nell'unione delle curve per esportazione 3dm.
2024-06-10 17:37:26 +02:00
SaraP 68caeb21b2 3dPrinting :
- correzioni spiral vase.
2024-05-16 15:38:34 +02:00
4 changed files with 48 additions and 40 deletions
+1 -1
View File
@@ -2097,7 +2097,7 @@ local function SpiralVase( vLayIds, LayerParams)
local nGuideId = EgtCopyGlob( nOldPathId, nTpathGrpId)
-- la porto alla stessa quota del toolpath
EgtMove( nGuideId, vtMove + LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
EgtChangeClosedCurveStartPoint( nGuideId, ptOld, GDB_RT.GLOB)
EgtChangeClosedCurveStartPoint( nGuideId, ptNew, GDB_RT.GLOB)
EgtSpiralizeCurveAlongGuide( nNewEntId, nGuideId)
EgtErase( nGuideId)
+4
View File
@@ -112,6 +112,10 @@ local function CreateSpiralVaseSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
-- gruppo temporaneo per conti
local nGrpTmp = EgtGroup( nSolidGrp, Frame3d( ORIG(), LayerParams.vtSlicing, GDB_RT.GLOB))
-- accorcio leggermente la curva per evitare problemi di inconsistent orientation nel solido
local dLen = EgtCurveLength( nCrvId)
EgtTrimCurveEndAtLen( nCrvId, dLen - 20 * GEO.EPS_SMALL)
local ptS = EgtSP( nCrvId, GDB_ID.ROOT)
local vtS = EgtSV( nCrvId, GDB_ID.ROOT)
local ptE = EgtEP( nCrvId, GDB_ID.ROOT)
+42 -38
View File
@@ -28,52 +28,56 @@ local function CalcCurves( nSliceId, nDestGrp, vtSlicing, dStrandBase)
if nType ~= TYPE.WIPE then
local dStrand = EgtGetInfo( nId, KEY_CRV_STRAND, 'd') or dStrandBase
-- calcolo fat curve a partire da una copia della curva ( in questo modo nel DB geometrico non restano
-- calcolo fat region a partire da una copia della curva ( in questo modo nel DB geometrico non restano
-- salvati i diagrammi di Voronoi che non servono per conti futuri)
local nCopy = EgtCopyGlob( nId, nDestGrp)
local nCrv, nCnt = EgtCurveGetFatCurve( nCopy, nDestGrp, 0.5 * dStrand, false)
local nSurf = EgtSurfFrFatCurve( nDestGrp, nCopy, 0.5 * dStrand, false)
-- se fallisce ritento con valore leggermente diverso
if not nCrv or nCnt == 0 then
nCrv, nCnt = EgtCurveGetFatCurve( nCopy, nDestGrp, 0.5 * dStrand - 0.05, false)
if not nSurf or nSurf == GDB_ID.NULL then
nSurf = EgtSurfFrFatCurve( nDestGrp, nCopy, 0.5 * dStrand - 0.05, false)
end
EgtErase( nCopy)
if nCrv and nCnt > 0 then
-- se sono curve chiuse piccoli aggistamenti per creare un percorso unico
if nCnt > 1 then
for nLoopId = nCrv + 1, nCrv + nCnt - 1 do
EgtInvertCurve( nLoopId)
local dLen = EgtCurveLength( nLoopId)
local dPar1 = EgtCurveParamAtLength( nLoopId, dLen * 0.5)
local dPar2 = EgtCurveParamAtLength( nLoopId, dLen * 0.5 + 2 * GEO.EPS_SMALL)
local ptM = EgtUP( nLoopId, dPar1)
local ptM2 = EgtUP( nLoopId, dPar2)
local _, _, dParRef1 = EgtPointCurveDist( ptM, nCrv)
local _, _, dParRef2 = EgtPointCurveDist( ptM, nCrv)
EgtTrimCurveStartEndAtParam( nCrv, dParRef2, dParRef1)
EgtTrimCurveStartEndAtParam( nLoopId, dPar2, dPar1)
EgtInvertCurve( nLoopId)
EgtAddCurveCompoLine( nCrv, EgtSP( nLoopId))
EgtAddCurveCompoCurve( nCrv, nLoopId)
EgtCloseCurveCompo( nCrv)
if nSurf then
local nChunks = EgtSurfFrChunkCount( nSurf)
for k = 0, nChunks - 1 do
-- estraggo i loop associati
local nCrv, nCnt = EgtExtractSurfFrChunkLoops( nSurf, k, nDestGrp)
-- eventuali aggiustamenti per creare un percorso unico
if nCnt > 1 then
for nLoopId = nCrv + 1, nCrv + nCnt - 1 do
local dLen = EgtCurveLength( nLoopId)
local dPar1 = EgtCurveParamAtLength( nLoopId, dLen * 0.5)
local dPar2 = EgtCurveParamAtLength( nLoopId, dLen * 0.5 + 2 * GEO.EPS_SMALL)
local ptM = EgtUP( nLoopId, dPar1)
local ptM2 = EgtUP( nLoopId, dPar2)
local _, _, dParRef1 = EgtPointCurveDist( ptM2, nCrv)
local _, _, dParRef2 = EgtPointCurveDist( ptM, nCrv)
EgtTrimCurveStartEndAtParam( nCrv, dParRef2, dParRef1)
EgtTrimCurveStartEndAtParam( nLoopId, dPar2, dPar1)
EgtAddCurveCompoLine( nCrv, EgtSP( nLoopId))
EgtAddCurveCompoCurve( nCrv, nLoopId)
EgtCloseCurveCompo( nCrv)
end
end
if nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL then
EgtSetColor( nCrv, EgtStdColor( 'TEAL'))
elseif nType == TYPE.INNER_SHELL or nType == TYPE.EXTRA_SHELL then
EgtSetColor( nCrv, EgtStdColor( 'ORANGE'))
elseif nType == TYPE.LINK then
EgtSetColor( nCrv, EgtStdColor( 'GRAY'))
elseif nType == TYPE.INFILL then
EgtSetColor( nCrv, EgtStdColor( 'YELLOW'))
elseif nType == TYPE.COASTING then
EgtSetColor( nCrv, EgtStdColor( 'BLUE'))
elseif nType == TYPE.RIB then
EgtSetColor( nCrv, EgtStdColor( 'OLIVE'))
elseif nType == TYPE.AUX_SOLID then
EgtSetColor( nCrv, EgtStdColor( 'AQUA'))
end
end
if nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL then
EgtSetColor( nCrv, EgtStdColor( 'TEAL'))
elseif nType == TYPE.INNER_SHELL or nType == TYPE.EXTRA_SHELL then
EgtSetColor( nCrv, EgtStdColor( 'ORANGE'))
elseif nType == TYPE.LINK then
EgtSetColor( nCrv, EgtStdColor( 'GRAY'))
elseif nType == TYPE.INFILL then
EgtSetColor( nCrv, EgtStdColor( 'YELLOW'))
elseif nType == TYPE.COASTING then
EgtSetColor( nCrv, EgtStdColor( 'BLUE'))
elseif nType == TYPE.RIB then
EgtSetColor( nCrv, EgtStdColor( 'OLIVE'))
elseif nType == TYPE.AUX_SOLID then
EgtSetColor( nCrv, EgtStdColor( 'AQUA'))
end
EgtErase( nSurf)
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
-- Version.lua by Egaltech s.r.l. 2024/05/06
-- Gestione della versione di 3dPrinting
VERSION = '2.6e1'
VERSION = '2.6f1'