3dPrinting :
- slicing multiplanare orizzontale - sistemata distanza su spina per slicing multiplanare 45°.
This commit is contained in:
+13
-9
@@ -94,6 +94,10 @@ local function ComputeMultiplanarSlicingData( dSliceStep, nMaxSlicesNbr, nSlicin
|
||||
|
||||
local vSlicingDir = {}
|
||||
local vSlicingPnt = {}
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
dSliceStep = dSliceStep / ( sqrt( 2) / 2)
|
||||
end
|
||||
|
||||
-- ciclo sulla curva
|
||||
local dCrvLen = EgtCurveLength( nSpineId)
|
||||
for i = 0, nMaxSlicesNbr - 1 do
|
||||
@@ -849,7 +853,7 @@ local function SlicingNoSolid( nRibsLay, nSlicingType, dMaxH, dSliceStep, vSlici
|
||||
local dDeltaZ = EgtIf( i == 1, DELTAZ, 0)
|
||||
local ptSlicing
|
||||
local vtSlicing
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
vtSlicing = vtSlicing[i]
|
||||
ptSlicing = vSlicingVal[i]
|
||||
else
|
||||
@@ -864,7 +868,7 @@ local function SlicingNoSolid( nRibsLay, nSlicingType, dMaxH, dSliceStep, vSlici
|
||||
local nResultLay = SliceStm( vIds, nLayId, vtSlicing, ptSlicing, TYPE.RIB, RIBS_CRV, RIBS_GRP, tabParams)
|
||||
|
||||
-- se slicing multplanare verifico altezza massima
|
||||
if ( nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45) and dMaxH < GEO.INFINITO then
|
||||
if ( nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR) and dMaxH < GEO.INFINITO then
|
||||
local b3Box = EgtGetBBoxGlob( nResultLay, GDB_BB.STANDARD)
|
||||
local ptMax = b3Box:getMax() + dSliceStep * vtSlicing
|
||||
if ptMax:getZ() > dMaxH + GEO.EPS_SMALL then
|
||||
@@ -1007,7 +1011,7 @@ local function SlicingWithSolid( nStmId, nSlicingType, dMaxH, vSlicingVal, vSlic
|
||||
|
||||
-- calcolo delle intersezioni
|
||||
local nLayId, nCnt
|
||||
if nSlicingType ~= SLICING_TYPE.MULTIPLANAR and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType ~= SLICING_TYPE.MULTIPLANAR and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_DEG45 and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
if EgtProcessEvents( 1, 0) == 1 then return false end
|
||||
nLayId, nCnt = EgtParPlanesSurfTmInters( ORIG(), vSlicingDir[1], vSlicingVal, nStmId, s_nPartId, GDB_RT.GLOB, TOLER)
|
||||
if EgtProcessEvents( 100, 0) == 1 then return false end
|
||||
@@ -1032,7 +1036,7 @@ local function SlicingWithSolid( nStmId, nSlicingType, dMaxH, vSlicingVal, vSlic
|
||||
local dDeltaZ = EgtIf( nLayCnt == 1, DELTAZ, 0)
|
||||
local ptSlicing
|
||||
local vtSlicing
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
-- nel caso multiplanare sono i dati di slicing
|
||||
vtSlicing = vSlicingDir[nLayCnt]
|
||||
ptSlicing = vSlicingVal[nLayCnt]
|
||||
@@ -1305,7 +1309,7 @@ local function SlicingWithSolid( nStmId, nSlicingType, dMaxH, vSlicingVal, vSlic
|
||||
local bSpiralVase = EgtGetInfo( s_nPartId, KEY_SPIRAL_VASE, 'b') or false
|
||||
if not bSpiralVase then
|
||||
-- infill
|
||||
if nSlicingType ~= SLICING_TYPE.MULTIPLANAR and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType ~= SLICING_TYPE.MULTIPLANAR and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_DEG45 and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
PrepareInfill( nStmId, vSlicingDir[1])
|
||||
end
|
||||
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + ( nCnt + 6) / nCounterTot * 100, 0) == 1 then return false end
|
||||
@@ -1318,7 +1322,7 @@ local function SlicingWithSolid( nStmId, nSlicingType, dMaxH, vSlicingVal, vSlic
|
||||
-- solidi ausiliari
|
||||
local nAuxSolidsLay = EgtGetFirstNameInGroup( s_nPartId, LAY_AUX_SOLIDS)
|
||||
SlicingExtraObjects( nAuxSolidsLay, TYPE.AUX_SOLID, AUX_SOLIDS_CRV, AUX_SOLIDS_GRP)
|
||||
if nSlicingType ~= SLICING_TYPE.MULTIPLANAR and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType ~= SLICING_TYPE.MULTIPLANAR and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_DEG45 and nSlicingType ~= SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
PrepareAuxSolidsInfill( nAuxSolidsLay, vSlicingDir[1])
|
||||
end
|
||||
if EgtProcessEvents( EgtIf( PRINT, 100, 0) + ( nCnt + 12) / nCounterTot * 100, 0) == 1 then return false end
|
||||
@@ -1356,7 +1360,7 @@ local function SlicingWithSolid( nStmId, nSlicingType, dMaxH, vSlicingVal, vSlic
|
||||
end
|
||||
|
||||
-- se multiplanare verifico strand massimo e minimo
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
if not VerifyMultiPlanarStrand() then
|
||||
return false
|
||||
end
|
||||
@@ -1385,7 +1389,7 @@ function CalcSlices.Exec( nPartId, nStmId)
|
||||
vtSlicing = VectorFromSpherical( 1, 45, dHorAng)
|
||||
elseif nSlicingType == SLICING_TYPE.HORIZONTAL then
|
||||
vtSlicing = X_AX()
|
||||
elseif nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
elseif nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
-- la direzione può cambiare da un piano all'altro
|
||||
vtSlicing = Z_AX()
|
||||
end
|
||||
@@ -1433,7 +1437,7 @@ function CalcSlices.Exec( nPartId, nStmId)
|
||||
local dMaxH = ComputeMaxH( vRefIds, vtSlicing, dSliceStep)
|
||||
local vSlicingVal = {}
|
||||
local vSlicingDir = {}
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 then
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
vSlicingVal, vSlicingDir = ComputeMultiplanarSlicingData( dSliceStep, nMaxSlicesNbr, nSlicingType)
|
||||
else
|
||||
vSlicingVal, vSlicingDir = ComputeSlicingData( vRefIds, vtSlicing, dSliceStep, dMaxH, nMaxSlicesNbr)
|
||||
|
||||
Reference in New Issue
Block a user