Compare commits

..

17 Commits

Author SHA1 Message Date
Emmanuele Sassi 87d2641ab1 - gestito calcolo F e S con strand di differente larghezza 2023-09-25 15:48:10 +02:00
SaraP b610f1f5e1 3dPrinting 2.5i1 :
- sistemata gestione degli strand variabili con valore nullo.
2023-09-20 15:59:58 +02:00
SaraP d83b571883 3dPrinting :
- correzioni nel collegamento tra ribs che terminano esattamente sul pezzo
- migliorie varie nei ribs.
2023-09-01 17:03:25 +02:00
SaraP a595fcdb98 3dPrinting :
- corretto collegamento fra ribs esterni che passa sotto il solido.
2023-08-30 09:52:28 +02:00
Dario Sassi 43949d7f13 3dPrinting 2.5h1 :
- aggiunta direzione su estrusioni a 45deg in X e Y (X+/- e Y+/-).
2023-08-28 19:52:40 +02:00
SaraP 00700f3194 3dPrinting :
- lettura di HMax per slicing dai parametri
- correzione slicing filled solids.
2023-08-25 09:25:14 +02:00
SaraP 28686fe6b6 3dPrinting :
- introdotta info con numero totale di layers.
2023-08-09 17:34:16 +02:00
SaraP 4a4a7d648b 3dPrinting :
- aggiunta chiusura dei percorsi di extra shell
- aggiunto clamp sui valori di strand width.
2023-07-20 12:44:32 +02:00
SaraP 03c1768afe 3dPrinting 2.5g1 :
- aggiunto numero di passate per Filled Solids.
2023-07-03 10:23:37 +02:00
SaraP ba9470ee88 3dPrinting :
- aggiunto collegamento infill.
2023-06-30 12:52:39 +02:00
SaraP e629f1b12d 3dPrinting 2.5f2 :
- gestione strand variabili per entità.
2023-06-21 09:21:17 +02:00
SaraP 451f3a2939 3dPrinting 2.5f1 :
- correzioni infill
- aggiornamento versione.
2023-06-15 10:17:29 +02:00
SaraP bc3cf3b3a9 3dPrinting :
- corretto errore reduced shell number di area nulla.
2023-06-08 10:34:42 +02:00
SaraP 4225985a61 3dPrinting :
- aggiunta approssimazione delle curve dopo slicing ( per evitare caso di fallimento offset)
- migliorata segnalazione errori.
2023-06-06 17:11:09 +02:00
SaraP fcd61efd53 3dPrinting :
- piccole correzioni nei setti per evitare interruzione calcolo.
2023-06-01 17:31:43 +02:00
SaraP 01711d2925 3dPrinting 2.5e3 :
- infill prima versione ( lineari, griglia, zigzag, nido d'ape)
- aggiunto riempimento ad infill anche nei solidi ausiliari
- migliorie varie nella gestione dei riempimenti pieni
- migliorie nei link e in StartPointOffsetOnLayer.
2023-05-26 15:20:27 +02:00
SaraP e015136592 3dPrinting 2.5e2 ;
- corretto errore nel lead in/lead out dei setti quando terminano su altro setto
- migliorie varie per lead in, lead out e link dei setti.
2023-05-24 08:26:27 +02:00
9 changed files with 3269 additions and 1484 deletions
+34
View File
@@ -0,0 +1,34 @@
{
"Lua.diagnostics.globals": [
"MATERIAL",
"EgtGetFirstNameInGroup",
"GDB_ID",
"EgtGroup",
"EgtSetLevel",
"EgtSetName",
"GDB_LV",
"EgtGetCurrMachineDir",
"EgtGetCurrMachineName",
"EgtGetStringFromIni",
"EgtGetFirstPart",
"EgtGetInfo",
"EgtGetNextPart",
"EgtGetLastNameInGroup",
"EgtRemoveInfo",
"EgtGetFirstInGroup",
"EgtGetName",
"EgtCurveLength",
"EgtGetNext",
"EgtCurveArea",
"EgtGetNextName",
"EgtSetInfo",
"floor",
"pi",
"pow",
"EgtProcessEvents",
"EgtEmptyGroup",
"EgtOutLog",
"EgtIf",
"EgtProtectGlobal"
]
}
+68 -13
View File
@@ -34,6 +34,7 @@ SURF_LOOP = "SurfLoop"
MIN_LEN = 0.1
MIN_AREA = 0.01
MIN_RIBS_LEN = 2
MIN_INFILL_LEN = 2
-- Parametri di lavorazione
SEC_DEFAULT = "Default"
@@ -45,6 +46,7 @@ KEY_SLICING_DIR = "SlicingDir"
KEY_SLICE_STEP = "StrandH"
KEY_SHELLS_NBR = "StrandCount"
KEY_STRAND = "StrandW"
KEY_INNER_STRAND = "InnerStrandW"
KEY_STRAND_OVERLAP = "StrandOverlap"
KEY_OFFSET_SLICE = "Offset"
KEY_SP_OFFSET_ON_SLICE = "StartPointOffsetOnSlice"
@@ -55,10 +57,6 @@ KEY_TYPE = "Type"
KEY_LINK_TYPE = "LinkType"
KEY_LINK_PARAM = "LinkParam"
KEY_LINK_ZUP = "LinkZup"
KEY_FLOOR_NBR = "FloorCount"
KEY_FLOOR_TYPE = "FloorType"
KEY_CEIL_NBR = "CeilCount"
KEY_CEIL_TYPE = "CeilType"
KEY_SPEED = "Speed"
KEY_FEED = "Feed"
KEY_EXT_FEED = "ExtFeed"
@@ -81,9 +79,31 @@ KEY_COASTING_FEED = "CoastingFeed"
KEY_WIPE_LEN = "WipeLen"
KEY_WIPE_DIR = "WipeDir"
KEY_WIPE_FEEDPU = "WipeFeedPu"
KEY_TOOL_DIAM = "ToolDiam"
KEY_TOOL_DIAM = "ToolDiam"
-- Solid Fill
KEY_FLOOR_NBR = "FloorCount"
KEY_FLOOR_TYPE = "FloorType"
KEY_CEIL_NBR = "CeilCount"
KEY_CEIL_TYPE = "CeilType"
KEY_FILL_TYPE = "FillType"
-- Infill
KEY_INFILL_STRAND = "InfillStrandW"
KEY_INFILL_TYPE = "InfillType"
KEY_INFILL_DENSITY = "InfillDensity"
KEY_INFILL_LINK = "InfillLink"
KEY_INFILL_OVERLAP = "InfillOverlap"
KEY_INFILL_GRID_OVERLAP = "InfillGridOverlap"
KEY_INFILL_DIR = "InfillDirection"
KEY_INFILL_OFFSET_X = "InfillOffsetX"
KEY_INFILL_OFFSET_Y = "InfillOffsetY"
KEY_INFILL_COASTING = "InfillCoasting"
KEY_INFILL_WIPE = "InfillWipe"
KEY_INFILL_WIPE_DIR = "InfillWipeDir"
-- Ribs
KEY_RIBS_STRAND = "RibsStrandW"
KEY_RIBS_TYPE = "RibsType"
KEY_LIMIT_UNBDD_RIBS = "LimitUnboundedRibsWithSolid"
KEY_RIBS_OVERLAP = "RibsOverlap"
@@ -125,12 +145,21 @@ KEY_EXTRA_SHELL_WIPE = "ExtraShellWipe"
KEY_EXTRA_SHELL_WIPE_DIR = "ExtraShellWipeDir"
-- Solidi ausiliari
KEY_AUX_SOLIDS_STRAND = "AuxSolidsStrandW"
KEY_AUX_SOLIDS_SHELLS_NBR = "AuxSolidsStrandCount"
KEY_AUX_SOLIDS_OVERLAP = "AuxSolidsOverlap"
KEY_AUX_SOLIDS_INFILL = "AuxSolidsInfill"
KEY_AUX_SOLIDS_PRINT_ORDER = "AuxSolidsStrandOrder"
KEY_AUX_SOLIDS_OVERLAP = "AuxSolidsOverlap"
KEY_AUX_SOLIDS_LINK_TYPE = "AuxSolidsLinkType"
KEY_AUX_SOLIDS_SP_OFFSET = "AuxSolidsStartPointOffsetOnSlice"
KEY_AUX_SOLIDS_LINK_PARAM = "AuxSolidsLinkParam"
KEY_AUX_SOLIDS_SP_OFFSET = "AuxSolidsStartPointOffsetOnSlice"
KEY_AUX_SOLIDS_LP_OFFSET = "AuxSolidsOffsetLeadPoint"
KEY_AUX_SOLIDS_INFILL_LINK = "AuxSolidsInfillLink"
KEY_AUX_SOLIDS_DENSITY = "AuxSolidsDensity"
KEY_AUX_SOLIDS_DIR = "AuxSolidsDirection"
KEY_AUX_SOLIDS_OFFSET_X = "AuxSolidsOffsetX"
KEY_AUX_SOLIDS_OFFSET_Y = "AuxSolidsOffsetY"
KEY_AUX_SOLIDS_GRID_OVERLAP = "AuxSolidsGridOverlap"
KEY_AUX_SOLIDS_COASTING_LEN = "AuxSolidsCoastingLen"
KEY_AUX_SOLIDS_WIPE_LEN = "AuxSolidsWipeLen"
KEY_AUX_SOLIDS_WIPE_DIR = "AuxSolidsWipeDir"
@@ -143,6 +172,7 @@ KEY_SPEED_MIN = "SpeedMin"
KEY_SPEED_MAX = "SpeedMax"
-- Altre chiavi
KEY_MAX_H = "SlicingHeight"
KEY_SLICE_NBR = "SliceNbr"
KEY_SLICE_Z = "SliceZ"
KEY_SLICE_DELTAZ = "DeltaZ"
@@ -156,7 +186,16 @@ KEY_ASSOCIATED_CRVS = "AssociatedCrvs"
KEY_ORIGINAL_SURF = "OriginalSurf"
KEY_HAS_SOLIDS = "Solids"
KEY_BOX_MIN_Z = "PartBoxMinZ"
KEY_START_POINT = "StartPoint"
KEY_ORIGINAL_START_POINT = "OriginalStartPoint"
KEY_FIRST_SOLID_LAY = "FirstSolidLay"
KEY_LAST_SOLID_LAY = "LastSolidLay"
KEY_ASSOCIATED_TP_CRV = "AssociatedToolPathCrv"
KEY_ASSOCIATED_P_CRV = "AssociatedPathCrv"
KEY_INTERNAL_SRF_LOOP = "InternalSrfLoop"
KEY_PREV_CRV = "PrevCrv"
KEY_NEXT_CRVS = "NextCrvs"
KEY_CRV_STRAND = "CurveStrand"
KEY_LAYER_CNT = "LayerCnt"
SLICING_TYPE = {
VERTICAL = 1,
@@ -202,7 +241,7 @@ PRINT_DIRECTION = {
LINK_TYPE = {
NONE = 1,
LINEAR = 2,
BIARC = 3,
BIARC = 3,
}
LEAD_TYPE = {
@@ -211,10 +250,21 @@ LEAD_TYPE = {
ARC = 3,
}
INFILL_TYPE = {
NONE = 1,
OFFSET = 2,
ZIGZAG = 3,
FILL_CATEGORY = {
NONE = 0,
SOLID_FILL = 16,
INFILL = 32,
}
FILL_TYPE = {
NONE = 0,
OFFSET = 16,
ZIGZAG = 17,
LINES = 32,
GRID = 33,
ZIG_ZAG_GRID = 34,
HONEYCOMB = 35,
HONEYCOMB_GRID = 36,
}
RIB_TYPE = {
@@ -293,9 +343,14 @@ SHELL_NBR_CRV = "ShellNbrRegion"
SHELL_NBR_SURF = "ShellNbrSurf"
AUX_SOLIDS_GRP = "AuxSolids"
AUX_SOLIDS_INFILL_GRP = "InfillAuxSolids"
AUX_SOLIDS_CRV = "AuxSolid"
AUX_SOLIDS_INFILL_CRV = "InfillAuxSolid"
AUX_SOLIDS_SRF = "SrfAuxSolid"
INFILL_GRP = "Infill"
INFILL_CRV = "InfillCrv"
---------------------------------------------------------------------
-- parametri calcolo tempi, F ed S
LAY_TFSCALC = "TFSCalc"
+1267 -731
View File
File diff suppressed because it is too large Load Diff
+656 -265
View File
File diff suppressed because it is too large Load Diff
+1133 -442
View File
File diff suppressed because it is too large Load Diff
+9 -10
View File
@@ -20,7 +20,6 @@ local function GetLayerParamsForSolidCalc( nPartId)
local LayerParams = {}
LayerParams.bSpiralVase = EgtGetInfo( nPartId, KEY_SPIRAL_VASE, 'b') or false
LayerParams.dLayHeight = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd')
LayerParams.dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd')
LayerParams.vtSlicing = EgtGetInfo( nPartId, KEY_SLICING_DIR, 'v')
return LayerParams
end
@@ -192,7 +191,7 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
local nType = EgtGetInfo( nCrvId, KEY_TYPE, 'i')
if nType == TYPE.WIPE then return true end
-- scelta del colore
local Color = EgtStdColor( 'GRAY')
local Color = EgtStdColor( 'GRAY')
if nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL then
Color = EgtStdColor( 'TEAL')
elseif nType == TYPE.INNER_SHELL or nType == TYPE.EXTRA_SHELL then
@@ -203,14 +202,13 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
Color = EgtStdColor( 'YELLOW')
elseif nType == TYPE.COASTING then
Color = EgtStdColor( 'BLUE')
elseif nType == TYPE.WIPE then
Color = EgtStdColor( 'LIME')
elseif nType == TYPE.RIB then
Color = EgtStdColor( 'OLIVE')
elseif nType == TYPE.AUX_SOLID then
Color = EgtStdColor( 'AQUA')
end
local dStrand = EgtGetInfo( nCrvId, KEY_CRV_STRAND, 'd')
local nCopyId = EgtCopyGlob( nCrvId, nSolidGrp)
local nId = GDB_ID.NULL
local nParts = 1
@@ -230,7 +228,7 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
local bOk = true
for nInd = 0, nParts - 1 do
local nGuideId = nId + nInd
local nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, LayerParams.dStrand - 5 * GEO.EPS_SMALL)
local nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, dStrand - 5 * GEO.EPS_SMALL)
if not nSrfId then
EgtOutLog( 'Warning : CreateSolid failed '.. '(layer '..tostring( nLayer)..', curve '..tostring( nCrvId)..')')
-- se non ultima, provo a spostare l'estremità finale
@@ -241,9 +239,9 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
local bOk1 = EgtTrimCurveEndAtLen( nCopyId, LEN_TRIM)
local bOk2 = EgtAddCurveCompoCurve( nGuideId, nCopyId)
local bOk3 = EgtTrimCurveStartAtLen( nGuideId + 1, LEN_TRIM)
nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, LayerParams.dStrand - 5 * GEO.EPS_SMALL)
nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, dStrand - 5 * GEO.EPS_SMALL)
if not nSrfId then
nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, LayerParams.dStrand - 50 * GEO.EPS_SMALL)
nSrfId = CreateSolid( nGuideId, nSolidGrp, LayerParams, dStrand - 50 * GEO.EPS_SMALL)
end
end
end
@@ -258,7 +256,7 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
if nFirstCrv and nCrvNbr > 1 then
local nSrfIds = {}
for nInd2 = 0, nCrvNbr-1 do
local nSrfId2 = CreateSolid( nFirstCrv + nInd2, nSolidGrp, LayerParams, LayerParams.dStrand - 50 * GEO.EPS_SMALL)
local nSrfId2 = CreateSolid( nFirstCrv + nInd2, nSolidGrp, LayerParams, dStrand - 50 * GEO.EPS_SMALL)
EgtErase( nFirstCrv + nInd2)
if nSrfId2 then
table.insert( nSrfIds, nSrfId2)
@@ -279,6 +277,7 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
if nSrfId then
EgtSetColor( nSrfId, Color)
EgtSetInfo( nSrfId, KEY_TYPE, nType)
EgtSetInfo( nSrfId, KEY_SLICE_NBR, nLayer)
else
bOk = false
EgtOutLog( 'Warning : CreateSolid_Sewing failed')
@@ -330,7 +329,7 @@ function RunCalcSolids.Exec()
local nTPathGrpId = EgtGetFirstNameInGroup( nCrvGrpId, TOOLPATH_GRP) or GDB_ID.NULL
if nTPathGrpId == GDB_ID.NULL then
EgtOutBox( 'Error no tool paths', 'SolidCalc')
return
return
end
-- recupero il gruppo dei solidi
+92 -16
View File
@@ -62,7 +62,7 @@ function RunMachParamFromSWCalc.Exec()
while nPartId do
if not EgtGetInfo( nPartId, KEY_PART_ON_TABLE, 'b') then
nPartId = EgtGetNextPart( nPartId)
goto continue
goto continue
end
-- recupero i parametri di lavorazione del pezzo
local dSliceStep = EgtGetInfo( nPartId, KEY_SLICE_STEP, 'd')
@@ -77,6 +77,8 @@ function RunMachParamFromSWCalc.Exec()
while nLayerId do
-- rimuovo eventuale info precedente del tempo di attesa
EgtRemoveInfo( nLayerId, KEY_WAITING_TIME)
-- divido curve in base alla larghezza strand
local LengthCrvList = {}
-- calcolo lunghezza totale del layer
local dTotLayerLength = 0
local dTotLayerLengthForMass = 0
@@ -84,14 +86,29 @@ function RunMachParamFromSWCalc.Exec()
local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- sommo lunghezze percorsi
-- recupero lunghezze percorsi
local dTotCrvLength = 0
local dTotCrvLengthForMass = 0
nShellId = EgtGetFirstInGroup( nToolPathId)
local nShellId = EgtGetFirstInGroup( nToolPathId)
while nShellId do
dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId)
local dShellWidth = EgtGetInfo( nShellId, KEY_CRV_STRAND, "d")
local dShellLength = EgtCurveLength( nShellId)
local bFound = false
for LengthIndex = 1, #LengthCrvList do
if LengthCrvList[LengthIndex].Width == dShellWidth then
table.insert( LengthCrvList[LengthIndex].IdList, nShellId)
LengthCrvList[LengthIndex].Length = LengthCrvList[LengthIndex].Length + dShellLength
bFound = true
break
end
end
if not bFound then
table.insert( LengthCrvList, { Width = dShellWidth, IdList = { nShellId}, Length = dShellLength})
end
-- sommo per lunghezza totale
dTotCrvLength = dTotCrvLength + dShellLength
if EgtGetName( nShellId) ~= WIPE_CRV then
dTotCrvLengthForMass = dTotCrvLengthForMass + EgtCurveLength( nShellId)
dTotCrvLengthForMass = dTotCrvLengthForMass + dShellLength
end
nShellId = EgtGetNext( nShellId)
end
@@ -109,6 +126,44 @@ function RunMachParamFromSWCalc.Exec()
end
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end
-- -- rimuovo eventuale info precedente del tempo di attesa
-- EgtRemoveInfo( nLayerId, KEY_WAITING_TIME)
-- -- calcolo lunghezza totale del layer
-- local dTotLayerLength = 0
-- local dTotLayerLengthForMass = 0
-- local dTotLayerArea = 0
-- local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
-- while nCrvId do
-- local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- -- sommo lunghezze percorsi
-- local dTotCrvLength = 0
-- local dTotCrvLengthForMass = 0
-- local nShellId = EgtGetFirstInGroup( nToolPathId)
-- while nShellId do
-- dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId)
-- if EgtGetName( nShellId) ~= WIPE_CRV then
-- dTotCrvLengthForMass = dTotCrvLengthForMass + EgtCurveLength( nShellId)
-- end
-- nShellId = EgtGetNext( nShellId)
-- end
-- dTotLayerLength = dTotLayerLength + dTotCrvLength
-- dTotLayerLengthForMass = dTotLayerLengthForMass + dTotCrvLengthForMass
-- -- recupero area
-- local nOuterCrvId = EgtGetFirstNameInGroup( nCrvId, OUTER_CRV)
-- if nOuterCrvId and dStrandCount > 0.5 then
-- local _, _, dTotCrvArea = EgtCurveArea( nOuterCrvId)
-- local dOuterLength = EgtCurveLength( nOuterCrvId)
-- -- recupero offset del part per aggiungerlo all'area interna
-- local dOffset = EgtGetInfo( nPartId, KEY_OFFSET_SLICE, 'd')
-- dTotCrvArea = dTotCrvArea + ( dOffset * dOuterLength)
-- dTotLayerArea = dTotLayerArea + dTotCrvArea
-- end
-- nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
-- end
-- recupero feed del layer
local dLayerFeed = 0
local dLayerWait = 0
@@ -132,11 +187,18 @@ function RunMachParamFromSWCalc.Exec()
table.insert( nOrigLayers, nLayerId)
end
EgtSetInfo( nLayerResultId, KEY_SLICEID, nOrigLayers)
-- calcolo strand medio (media ponderata sulla lunghezza)
local dStrandMean = 0
for nMeanIndex = 1, #LengthCrvList do
dStrandMean = dStrandMean + LengthCrvList[nMeanIndex].Width * LengthCrvList[nMeanIndex].Length
end
dStrandMean = dStrandMean / dTotLayerLength
-- calcolo costante MF
local dMF = 1
local dSC = 1
if dTotLayerArea > 1 then
dMF = dTotLayerLength * dStrand / dTotLayerArea * 100
-- dMF = dTotLayerLength * dStrand / dTotLayerArea * 100
dMF = dTotLayerLength * dStrandMean / dTotLayerArea * 100
dSC = dStrandCount
else
dMF = 100
@@ -151,9 +213,9 @@ function RunMachParamFromSWCalc.Exec()
end
end
-- calcolo tempi stimati del layer
local dTMin = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMin) / MATERIAL.BMin * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTTrg = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.ATrg) / MATERIAL.BTrg * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTMax = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMax) / MATERIAL.BMax * pow( 0.25 * dStrand, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTMin = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMin) / MATERIAL.BMin * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTTrg = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.ATrg) / MATERIAL.BTrg * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTMax = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMax) / MATERIAL.BMax * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dFMin = dTotLayerLength / dTMax * 60
local dFTrg = dTotLayerLength / dTTrg * 60
local dFMax = dTotLayerLength / dTMin * 60
@@ -165,7 +227,7 @@ function RunMachParamFromSWCalc.Exec()
end
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
-- calcolo la portata
local Vf = dLayerFeed * ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) / 1000
local Vf = dLayerFeed * ( ( dStrandMean - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) / 1000
-- calcolo speed
local dSpeed = ( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0) * pow( Vf / MATERIAL.C1, 1 / MATERIAL.C2)
-- verifico se speed esce da minimo e massimo della macchina
@@ -179,20 +241,32 @@ function RunMachParamFromSWCalc.Exec()
dSpeed = dSMax
end
if not bSpeedOk then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / (( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0))), MATERIAL.C2)) * 1000 / ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2))
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / (( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0))), MATERIAL.C2)) * 1000 / ( ( dStrandMean - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2))
dLayerTime = dTotLayerLength / dLayerFeed * 60
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
end
-- calcolo massa dello strato
local dLayerMass = dTotLayerLengthForMass * dSliceStep * dStrand * MATERIAL.Density * 1e-6
local dLayerMass = dTotLayerLengthForMass * dSliceStep * dStrandMean * MATERIAL.Density * 1e-6
if dLayerMass and dLayerMass > 0 then
dPrintMass = dPrintMass + dLayerMass
end
-- scrivo info feed e speed in group toolpath
-- scrivo info feed su tutti i tratti
local dFeedMax = 0
for nWidthIndex = 1, #LengthCrvList do
local CurrWidth = LengthCrvList[nWidthIndex]
local CurrFeed = EgtIf( CurrWidth.Width > 0, dLayerFeed * dStrandMean / CurrWidth.Width, dLayerFeed)
for nCurveIdIndex = 1, #CurrWidth.IdList do
EgtSetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_FEED, CurrFeed)
end
if CurrFeed > dFeedMax then
dFeedMax = CurrFeed
end
end
-- scrivo info speed in group toolpath
nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP) or GDB_ID.NULL
EgtSetInfo( nToolPathId, KEY_FEED, dLayerFeed)
-- EgtSetInfo( nToolPathId, KEY_FEED, dLayerFeed)
EgtSetInfo( nToolPathId, KEY_SPEED, dSpeed)
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end
@@ -206,9 +280,11 @@ function RunMachParamFromSWCalc.Exec()
EgtSetInfo( nLayerResultId, KEY_TMIN, dTMin)
EgtSetInfo( nLayerResultId, KEY_TTRG, dTTrg)
EgtSetInfo( nLayerResultId, KEY_TMAX, dTMax)
EgtSetInfo( nLayerResultId, KEY_FMIN, dFMin)
EgtSetInfo( nLayerResultId, KEY_FTRG, dFTrg)
EgtSetInfo( nLayerResultId, KEY_FMAX, dFMax)
EgtSetInfo( nLayerResultId, KEY_FMAX, dFeedMax)
-- EgtSetInfo( nLayerResultId, KEY_FMIN, dFMin)
-- EgtSetInfo( nLayerResultId, KEY_FTRG, dFTrg)
-- EgtSetInfo( nLayerResultId, KEY_FMAX, dFMax)
EgtSetInfo( nLayerResultId, KEY_TCUR, dLayerTime)
EgtSetInfo( nLayerResultId, KEY_FCUR, dLayerFeed)
EgtSetInfo( nLayerResultId, KEY_LENGTH, dTotLayerLength)
+8 -5
View File
@@ -72,6 +72,13 @@ local function RemoveOldSlices( nPartId)
if nRibsLoopsGrp then
EgtErase( nRibsLoopsGrp)
end
-- rimuovo eventuali gruppi di infill (anche per aux solids)
local nInfillId = EgtGetFirstNameInGroup( nPartId, INFILL_GRP .. '*')
while nInfillId do
EgtErase( nInfillId)
nInfillId = EgtGetFirstNameInGroup( nPartId, INFILL_GRP .. '*')
end
end
---------------------------------------------------------------------
@@ -150,10 +157,6 @@ function RunSlicing.Exec()
EgtRemoveAllOperations()
EgtResetCurrMachGroup()
-- Lettura dati macchina
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local HMax = tonumber( EgtGetStringFromIni( '3dPrinting', 'HMax', 500, sMachIni))
-- Eventuale ripristino posizione originaria
RestoreOriginalPosition( nPartId)
@@ -164,7 +167,7 @@ function RunSlicing.Exec()
RemoveOldTFS()
-- Calcolo delle fette
local bOk = CSLICES.Exec( nPartId, nStmId, HMax)
local bOk = CSLICES.Exec( nPartId, nStmId)
EgtDraw()
-- Calcolo dei percorsi sul centro strand in basso
+2 -2
View File
@@ -1,4 +1,4 @@
-- Version.lua by Egaltech s.r.l. 2023/02/28
-- Version.lua by Egaltech s.r.l. 2023/08/28
-- Gestione della versione di 3dPrinting
VERSION = '2.5d5'
VERSION = '2.5i1'