diff --git a/StrategyLibs/BLADETOWASTE.lua b/StrategyLibs/BLADETOWASTE.lua index 9bbb30d..55e2ece 100644 --- a/StrategyLibs/BLADETOWASTE.lua +++ b/StrategyLibs/BLADETOWASTE.lua @@ -791,11 +791,17 @@ local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, Main -- box del cubetto in riferimento feature local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace) - local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace) - b3Surf:Add( b3SurfPerpendicular) + if idPerpendicularTm then + local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace) + b3Surf:Add( b3SurfPerpendicular) + else + -- se non arriva la superficie perpendicolare รจ un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo + local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5) + b3Surf:Add( ptDeltaZ) + end -- estensione box per non avere problemi nella sottrazione booleana - if OtherFace then + if OtherFace and idPerpendicularTm then local vtY = vtZ ^ vtX local ptDeltaX = b3Surf:getMax() + vtX * 1 local ptDeltaZ = b3Surf:getMax() + vtZ * 1