3dPrinting :
- modifiche in CalcSolids per esportazione in 3MF.
This commit is contained in:
@@ -185,6 +185,36 @@ local function CreateSolid( nCrvId, nSolidGrp, LayerParams, dStrand)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CreateDirectionArrow( nCrvId, nSolidGrp, vtSlicing, dStrand, nLayer)
|
||||
|
||||
local ptS = EgtSP( nCrvId, GDB_RT.GLOB)
|
||||
local vtS = EgtSV( nCrvId, GDB_RT.GLOB)
|
||||
local dCrvLen = EgtCurveLength( nCrvId)
|
||||
if dCrvLen > 2 * dStrand then
|
||||
local dPar = EgtCurveParamAtLength( nCrvId, 4/5 * dStrand)
|
||||
ptS = EgtUP( nCrvId, dPar, GDB_RT.GLOB)
|
||||
vtS = EgtUV( nCrvId, dPar, -1, GDB_RT.GLOB)
|
||||
end
|
||||
|
||||
local vt2 = Vector3d( vtS)
|
||||
vt2:rotate( vtSlicing, 90)
|
||||
local dLen = 4/5 * dStrand
|
||||
local pt1 = ptS + 0.5 * dLen * vt2
|
||||
local pt2 = ptS - 0.5 * dLen * vt2
|
||||
local pt3 = ptS + vtS * dLen
|
||||
local nCompo = EgtCurveCompoFromPoints( nSolidGrp, { pt1, pt2, pt3, pt1}, GDB_RT.GLOB)
|
||||
EgtMove( nCompo, 100 * GEO.EPS_SMALL * vtSlicing, GDB_RT.GLOB)
|
||||
local nSrf = EgtSurfFlatRegion( nSolidGrp, { nCompo})
|
||||
EgtErase( nCompo)
|
||||
EgtSetColor( nSrf, RED())
|
||||
EgtSetInfo( nSrf, KEY_SLICE_NBR, nLayer)
|
||||
EgtSetStatus( nSrf, GDB_ST.OFF)
|
||||
EgtSetMode( nSrf, GDB_MD.HIDDEN)
|
||||
EgtSetName( nSrf, DIR_ARROW)
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
|
||||
|
||||
@@ -224,6 +254,12 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams, nLayer)
|
||||
nId = EgtSplitCurve( nCopyId, nParts)
|
||||
end
|
||||
|
||||
-- freccia direzionale
|
||||
local sName = EgtGetName( nCrvId)
|
||||
if nType ~= TYPE.COASTING and nType ~= TYPE.LINK and sName ~= LEAD_IN_CRV and sName ~= LEAD_OUT_CRV and sName ~= LINK_CRV then
|
||||
CreateDirectionArrow( nCrvId, nSolidGrp, LayerParams.vtSlicing, dStrand, nLayer)
|
||||
end
|
||||
|
||||
if nId == GDB_ID.NULL then return false end
|
||||
local bOk = true
|
||||
for nInd = 0, nParts - 1 do
|
||||
@@ -304,6 +340,11 @@ function RunCalcSolids.Exec()
|
||||
|
||||
if bCalcSolid then
|
||||
|
||||
-- recupero il suo frame
|
||||
local nFrameId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nPartId, 'Frame'), 'FramePart')
|
||||
local ptOrig = EgtSP( nFrameId or GDB_ID.NULL, GDB_ID.ROOT)
|
||||
EgtSetInfo( nPartId, KEY_ORIG_REF, ptOrig)
|
||||
|
||||
-- recupero i suoi slice
|
||||
local vLayIds = EgtGetNameInGroup( nPartId, SLICE_LAYER .. '*')
|
||||
if not vLayIds then
|
||||
@@ -339,7 +380,7 @@ function RunCalcSolids.Exec()
|
||||
EgtSetName( nSolidGrpId, SOLID_GRP)
|
||||
EgtSetLevel( nSolidGrpId, GDB_LV.TEMP)
|
||||
-- scorro le curve del percorso utensile
|
||||
local nId = EgtGetFirstInGroup( nTPathGrpId)
|
||||
local nId = EgtGetFirstInGroup( nTPathGrpId)
|
||||
while nId do
|
||||
local bOk = CreateSolidFromCurve( nId, nSolidGrpId, LayerParams, nLayer)
|
||||
nId = EgtGetNext( nId)
|
||||
@@ -389,9 +430,8 @@ function RunCalcSolids.Exec()
|
||||
EgtSetInfo( nViewId, SOLID_GRP, true)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
nPartIndex = nPartIndex + 1
|
||||
nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) or EgtGetNextName( nPartId, PART)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user