diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 09cd342..0bcd07b 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -7096,11 +7096,11 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId) if not nCapIdLeftSide then bAllWithEndCap = false end end - if nFirstId then - for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do - EgtErase( nId) - end - end + if nFirstId then + for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do + EgtErase( nId) + end + end end if i > 1 then -- taglio della superficie lato sinistro diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index 527173b..e29ce07 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -352,6 +352,57 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if not bModif and not bOpenBtm then BL.SetOpenSide( AuxId, b3Solid) end + + -- caso speciale feature trimmata diversamente in/out: si ricostruisce la curva non trimmata + -- recupero gruppo per geometria addizionale + local nAddGrpId = BL.GetAddGroup( nPartId) + if not nAddGrpId then + local sErr = 'Error : missing AddGroup' + EgtOutLog( sErr) + return false, sErr + end + -- estrazione loop trimesh: se 1 contorno ha il fondo, se due contorni è passante. + -- se passante si deve discriminare se i due contorni sono uguali (passante standard, trimmata allo stesso modo in/out) oppure se un contorno è diverso dall'altro (e quindi non è trimmata in egual modo in/out) + -- se più di 2 contorni si rimane nel caso standard + local idCurve1, nIdCount = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) + if nIdCount == 2 then + local idCurve2 = idCurve1 + 1 + local dCurveLength1 = EgtCurveLength( idCurve1) + local dCurveLength2 = EgtCurveLength( idCurve2) + if abs( dCurveLength1 - dCurveLength2) > 100 * GEO.EPS_SMALL then + -- riferimento curva ausiliaria + local frAuxId = Frame3d( EgtGP( AuxId, GDB_RT.GLOB), vtExtr) + -- box dei due contorni nel riferimento della faccia di fondo + local b3Curve1 = EgtGetBBoxRef( idCurve1, GDB_BB.STANDARD, frAuxId) + local b3Curve2 = EgtGetBBoxRef( idCurve2, GDB_BB.STANDARD, frAuxId) + -- per creare la curva non trimmata si creerà un piano di intersezione con la trimesh appena sopra al contorno più vicino a AuxId, ossia a ptOffset + local ptOffset = b3Curve1:getMax() + if b3Curve1:getMin():getZ() > b3Curve2:getMin():getZ() + 10 * GEO.EPS_SMALL then + ptOffset = b3Curve2:getMax() + end + -- ptOffset si sposta appena sopra per garantire l'intersezione + ptOffset = ptOffset + Vector3d( 0, 0, 100 * GEO.EPS_SMALL) + local ptOffsetGlob = Point3d( ptOffset) + ptOffsetGlob:toGlob( frAuxId) + EgtErase( { idCurve1, idCurve2} ) + -- intersezione piano a ptOffset con la trimesh: si ottiene la curva originale non trimmata + local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOffsetGlob, frAuxId:getVersZ(), Proc.Id, nAddGrpId, GDB_RT.GLOB) + if nPnt == 0 and nCrv == 1 and nSrf == 0 then + EgtCloseCurveCompo( nFirstId) + local vtMove = -frAuxId:getVersZ() * ptOffset:getZ() + EgtMove( nFirstId, vtMove, GDB_RT.GLOB) + EgtErase( AuxId) + EgtChangeId( nFirstId, AuxId) + else + if nFirstId then + for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do + EgtErase( nId) + end + end + end + end + end + if bOpenBtm then -- creo superficie chiusa local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)