From 4ba2bb442fa7097864f2490882f3e1bbee792988 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 11 Jan 2016 14:36:59 +0000 Subject: [PATCH] OmagCUT 1.6l7 : - aggiornamenti per nesting. --- CN_Debug.vb | 8 ++++---- ConstGen.vb | 2 ++ NestPageUC.xaml.vb | 19 +++++++++++++++++-- RawPartPageUC.xaml | 2 +- RawPartPageUC.xaml.vb | 3 +++ 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CN_Debug.vb b/CN_Debug.vb index 8fab98b..8011602 100644 --- a/CN_Debug.vb +++ b/CN_Debug.vb @@ -6,10 +6,10 @@ Public Overrides Function Init() As Boolean ' Assegno valori ad assi per test - d_axis_position(0) = -3740 + 2000 - d_axis_position(1) = -2424 + 363.5 + 800 - d_axis_position(2) = -1379.5 + 45 + 50 + 50 - d_axis_position(8) = 90.0 + d_axis_position(0) = -1500 + d_axis_position(1) = -1300 + d_axis_position(2) = -1240 + d_axis_position(8) = 67.315 d_axis_position(7) = 90.0 Return True diff --git a/ConstGen.vb b/ConstGen.vb index d0271df..818e18a 100644 --- a/ConstGen.vb +++ b/ConstGen.vb @@ -59,6 +59,8 @@ Module ConstGen Public Const NAME_KERF As String = "Kerf" ' Chiave per info di kerf nel grezzo Public Const KEY_KERF As String = "Kerf" + ' Nome della regione fuori kerf nel grezzo + Public Const NAME_OUTKERF As String = "SheetOut" ' Contrassegno di progetto OmagCut Public Const NAME_PROJMARK As String = "OmagCut" diff --git a/NestPageUC.xaml.vb b/NestPageUC.xaml.vb index d613c67..9c70a67 100644 --- a/NestPageUC.xaml.vb +++ b/NestPageUC.xaml.vb @@ -87,6 +87,8 @@ Public Class NestPageUC Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then Return End If + ' Per default no drag + m_bDrag = False ' Verifico se selezionato indicativo di pezzo EgtSetObjFilterForSelect(True, True, True, True, True) Dim nSel As Integer @@ -111,6 +113,8 @@ Public Class NestPageUC m_nPartPos = IIf(bPartInTable, PART_POS.IN_TABLE, PART_POS.OUT_TABLE) End If EgtDraw() + ' Drag possibile + m_bDrag = True Exit While End If nId = EgtGetNextObjInSelWin() @@ -121,7 +125,7 @@ Public Class NestPageUC End If ' Dati per drag m_locPrev = e.Location - m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) + m_bDrag = m_bDrag AndAlso EgtUnProjectPoint(e.Location, m_ptPrev) m_bDragToStart = m_bDrag End Sub @@ -150,12 +154,23 @@ Public Class NestPageUC ' Ricavo il vettore di movimento Dim vtMove As Vector3d = ptCurr - m_ptPrev ' Muovo i pezzi selezionati di quanto possibile - If vtMove.SqLen() > 100 * EPS_SMALL * EPS_SMALL Then + If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then ' annullo deselezione m_nIdToDesel = GDB_ID.NULL ' muovo il pezzo EgtMoveSelectedPartCluster(m_bReducedCut, vtMove, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf, m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf) + ' se movimento risultante nullo + If vtMove.IsSmall() Then + ' se tangente recuperabile di ostacolo lineare + Dim vtTang As Vector3d + If EgtGetObstacleTangent(vtTang) OrElse EgtGetMovingTangent(vtTang) Then + vtMove = ((ptCurr - m_ptPrev) * vtTang) * vtTang + ' riprovo con il movimento corretto + EgtMoveSelectedPartCluster(m_bReducedCut, vtMove, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf, + m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf) + End If + End If EgtDraw() End If ' Aggiorno il punto precedente diff --git a/RawPartPageUC.xaml b/RawPartPageUC.xaml index 602e3e8..abfef5e 100644 --- a/RawPartPageUC.xaml +++ b/RawPartPageUC.xaml @@ -145,7 +145,7 @@ - diff --git a/RawPartPageUC.xaml.vb b/RawPartPageUC.xaml.vb index bfb02a8..e655df0 100644 --- a/RawPartPageUC.xaml.vb +++ b/RawPartPageUC.xaml.vb @@ -373,6 +373,9 @@ Public Class RawPartPageUC ' Cancello eventuale vecchio contorno di kerf Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF) EgtErase(nKerfId) + ' Cancello eventuale vecchia regione fuori kerf per nesting + Dim nOutKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_OUTKERF) + EgtErase(nOutKerfId) ' box grezzo Dim ptMin, ptMax As Point3d GetRawBox(ptMin, ptMax)