diff --git a/DirectCuts/FlatteningCut.xaml.vb b/DirectCuts/FlatteningCut.xaml.vb index 10819cb..b6350df 100644 --- a/DirectCuts/FlatteningCut.xaml.vb +++ b/DirectCuts/FlatteningCut.xaml.vb @@ -1,4 +1,5 @@ -Imports EgtUILib +Imports System.Reflection +Imports EgtUILib Imports EgtUILib.EgtInterface Public Class FlatteningCut @@ -731,6 +732,13 @@ Public Class FlatteningCut End Function Private Function MultiplyCut(nLayerId As Integer, nCutId As Integer) As Boolean + 'If (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0) Then + ' EgtSetInfo(nCutId, INFO_WIDTH, GetFootPrintTool) + 'End If + + Dim CutsList As New List(Of Integer) + CutsList.Add(nCutId) + ' Recupero spessore della lama (utensile) correntemente attiva Dim dThick As Double = GetFootPrintTool() If dThick = 0 Then Return False @@ -775,7 +783,36 @@ Public Class FlatteningCut EgtSetInfo(nCut2Id, INFO_DIR, 1) End If EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB) + + ' ----------------------- CONACTENO CURVE ----------------------- + CutsList.Add(nCut2Id) + ' ----------------------- CONACTENO CURVE ----------------------- + Next + + ' Decidere se accorciare i tagli del valore del raggio utensile! + For Index As Integer = 0 To CutsList.Count - 2 + If Index Mod 2 = 0 Then + ' Costruisco la linea di collegamento tra due curve adiacenti + Dim PtStart_1 As Point3d + EgtStartPoint(CutsList(Index), GDB_RT.GLOB, PtStart_1) + Dim PtStart_2 As Point3d + EgtStartPoint(CutsList(Index + 1), GDB_RT.GLOB, PtStart_2) + CutsList.Add(EgtCreateLine(nLayerId, PtStart_1, PtStart_2)) + Else + ' Costruisco la linea di collegamento tra due curve adiacenti + Dim PtStart_1 As Point3d + EgtEndPoint(CutsList(Index), GDB_RT.GLOB, PtStart_1) + Dim PtStart_2 As Point3d + EgtEndPoint(CutsList(Index + 1), GDB_RT.GLOB, PtStart_2) + CutsList.Add(EgtCreateLine(nLayerId, PtStart_1, PtStart_2)) + End If + Next + Dim ptNear As Point3d + EgtStartPoint(CutsList(0), ptNear) + Dim x As Integer = EgtCreateCurveCompoByChain(nLayerId, CutsList.ToArray, ptNear, True) + EgtSetInfo(x, INFO_WIDTH, dThick) + Return True End Function