3dPrinting :

- in spiral vase spostata approssimazione delle curve per farla sempre su curva piana.
This commit is contained in:
SaraP
2025-04-28 15:07:36 +02:00
parent bcaf1c56a4
commit ad44ff7c5a
2 changed files with 23 additions and 22 deletions
+22 -21
View File
@@ -2105,18 +2105,28 @@ local function SpiralVase( vLayIds, LayerParams)
EgtModifyCurveStartPoint( nNewEntId, ptOld, GDB_RT.GLOB)
else
-- distribuisco la differenza su tutta la curva
-- recupero la curva da usare come guida
local nGuideId = EgtCopyGlob( nOldPathId, nPathGrpId)
-- la rendo coerente con il toolpath
EgtMove( nGuideId, vtMove + LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
if LayerParams.bInvert then
EgtInvertCurve( nGuideId)
if not AreSamePointApprox( ptOld, ptNew) then
-- recupero la curva da usare come guida
local nGuideId = EgtCopyGlob( nOldPathId, nPathGrpId)
-- la rendo coerente con il toolpath
EgtMove( nGuideId, vtMove + LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
if LayerParams.bInvert then
EgtInvertCurve( nGuideId)
end
-- modifico i punti iniziali affinchè coincidano con il punto finale del percorso precedente
EgtChangeClosedCurveStartPoint( nGuideId, ptOld, GDB_RT.GLOB)
EgtChangeClosedCurveStartPoint( nNewEntId, ptOld, GDB_RT.GLOB)
EgtSpiralizeCurveAlongGuide( nNewEntId, nGuideId)
EgtErase( nGuideId)
end
-- modifico i punti iniziali affinchè coincidano con il punto finale del percorso precedente
EgtChangeClosedCurveStartPoint( nGuideId, ptOld, GDB_RT.GLOB)
EgtChangeClosedCurveStartPoint( nNewEntId, ptOld, GDB_RT.GLOB)
EgtSpiralizeCurveAlongGuide( nNewEntId, nGuideId)
EgtErase( nGuideId)
end
-- approssimo
local ptS = EgtSP( nNewEntId, GDB_ID.ROOT)
EgtCopyGlob( nNewEntId, nPathGrpId)
EgtApproxCurve( nNewEntId, GDB_CA.ARCS, s_dApproxTol)
if EgtCurveIsClosed( nNewEntId) then
EgtChangeClosedCurveStartPoint( nNewEntId, ptS, GDB_RT.GLOB)
end
-- modifica graduale del'altezza
@@ -2129,17 +2139,8 @@ local function SpiralVase( vLayIds, LayerParams)
EgtSpiralizeCurveAlongExtrusion( nNewEntId, LayerParams.dLayHeight)
end
end
-- approssimo
local vTPathsCrvs = EgtGetAllInGroup( nTpathGrpId)
for i = 1, #vTPathsCrvs do
local ptS = EgtSP( vTPathsCrvs[i], GDB_ID.ROOT)
EgtApproxCurve( vTPathsCrvs[i], GDB_CA.ARCS, s_dApproxTol)
if EgtCurveIsClosed( vTPathsCrvs[i]) then
EgtChangeClosedCurveStartPoint( vTPathsCrvs[i], ptS, GDB_RT.GLOB)
end
end
nOldPathId = vEntIds[1]
nOldId = vTPathsCrvs[#vTPathsCrvs]