EgtCAM5 :

- piccole modifiche ad analisi superfici di Bezier.
This commit is contained in:
Dario Sassi
2026-03-13 13:39:21 +01:00
parent c276398b29
commit 4eac19a2ff
2 changed files with 67 additions and 54 deletions
+18 -16
View File
@@ -1449,7 +1449,7 @@ Public Class ProjectVM
m_Controller.MouseMoveInSelectionPoint(PtP)
End Sub
Private Sub OnMouseAnalyzedEx(sender As Object, nId As Integer, nSub As Integer, ptSel As Point3d) Handles m_ProjectScene.OnMouseAnalyzedEx
Private Sub OnMouseAnalyzedEx(sender As Object, nId As Integer, nSub As Integer, ptSel As Point3d, nModKey As Integer) Handles m_ProjectScene.OnMouseAnalyzedEx
Map.refManageLayerExpanderVM.UpdateObjInObjTree(nId)
Map.refManageLayerExpanderVM.SelectIdInObjTree(nId)
' Cancello geometria e info di eventuale precedente analisi
@@ -1460,19 +1460,17 @@ Public Class ProjectVM
' Visualizzo numerazione
Analyze.CreateAnalyzeGroup()
Analyze.CreateCurveCompoPntNbrs(nId)
' Se superficie trimesh, visualizzo dati faccetta toccata
' Se superficie trimesh, visualizzo dati faccetta toccata
ElseIf EgtGetType(nId) = GDB_TY.SRF_MESH Then
Dim nFac As Integer = EgtSurfTmFacetFromTria(nId, nSub)
If nFac <> -1 Then
If nFac >= 0 Then
' Visualizzo la normale e il contorno della faccia
Analyze.CreateAnalyzeGroup()
Analyze.CreateFacetNormal(nId, nFac)
Analyze.CreateFacetLoops(nId, nFac)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
If nModKey = Scene.MODKEY.SHIFT Then
Analyze.CreateTriaLoop(nId, nSub)
End If
' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d
Dim vtN As Vector3d
@@ -1484,13 +1482,12 @@ Public Class ProjectVM
" : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
If nModKey = Scene.MODKEY.SHIFT Then
sOut &= ", Triangle " + nSub.ToString()
End If
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
' Se Regione, visualizzo dati parte toccata
' Se Regione, visualizzo dati parte toccata
ElseIf EgtGetType(nId) = GDB_TY.SRF_FRGN Then
Dim nChk As Integer = nSub
If nChk >= 0 AndAlso nChk < EgtSurfFrChunkCount(nId) Then
@@ -1511,20 +1508,25 @@ Public Class ProjectVM
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
' Se Superficie di Bezier
ElseIf EgtGetType(nId) = GDB_TY.SRF_BEZ Then
' Visualizzo il punto selezionato, la normale e le tangenti nelle direzioni dei parametri
Analyze.CreateAnalyzeGroup()
Dim dU As Double
Dim dV As Double
If Analyze.CreateSBzPointNormalAndTangents(nId, ptSel, dU, dV) Then
Dim sOut As String = "U = " + dU.ToString("F3") +
"; V = " + dV.ToString("F3")
Dim dU, dV As Double
Dim vtN As Vector3d
If Analyze.CreateSBzPointNormalAndTangents(nId, ptSel, dU, dV, vtN) Then
Dim dLen, dPhi, dTheta As Double
vtN.ToSpherical(dLen, dTheta, dPhi)
' Emetto info sulla barra di stato
Dim sOut As String = "U=" + DoubleToString( dU, 4) + ",V=" + DoubleToString( dV, 4) +
" : P(" + LenToString(ptSel.x, 3) + "," + LenToString(ptSel.y, 3) + "," + LenToString(ptSel.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
If nModKey = Scene.MODKEY.SHIFT Then
Analyze.CreateSBzIsoParam(nId, dU, dV)
End If
End If
End If
' Aggiorno la visualizzazione
EgtDraw()