I'm trying to determine what size milling cutters(ball nose) would be required to finish a body in order to estimate machining times. I'm currently using ISurface.FindMinimumRadius, but this does not necessarily return the minimum concave radius. I was wondering if anyone might have any ideas on the matter?
...
vFaces = swBody.GetFaces
For Each vFace In vFaces
Set swFace = vFace
vFaceUV = swFace.GetUVBounds
uBoundArray(0) = vFaceUV(0)
uBoundArray(1) = vFaceUV(1)
vBoundArray(0) = vFaceUV(2)
vBoundArray(1) = vFaceUV(3)
uBoundSuf = uBoundArray
vBoundSuf = vBoundArray
Set swSurf = swFace.GetSurface
numOfRadii = 0 'FindMinimumRadius isn't setting numOfRadii to 0!
If Not IsPartOfHole(swFace) Then
If swSurf.FindMinimumRadius(uBoundSuf, vBoundSuf, numOfRadii, radius, location, uvparameter) Then
If numOfRadii Then
For i = 0 To (numOfRadii - 1)
If swFace.FaceInSurfaceSense Then d = -radius(i) Else d = radius(i) '+ number indicates concave curvature,- number indicates convex curvature
'Debug.Print "Smallest rad for this surface "; Round(d, 5)
If d > 0 Then
If i = 0 Then
Select Case d
Case 0 To 0.0009: FaceArea1mm = FaceArea1mm + swFace.GetArea
Case 0.0009 To 0.0014: FaceArea2mm = FaceArea2mm + swFace.GetArea
Case 0.0014 To 0.0019: FaceArea3mm = FaceArea3mm + swFace.GetArea
Case 0.0019 To 0.0024: FaceArea4mm = FaceArea4mm + swFace.GetArea
Case 0.0024 To 0.0029: FaceArea5mm = FaceArea5mm + swFace.GetArea
Case 0.0029 To 0.0039: FaceArea6mm = FaceArea6mm + swFace.GetArea
Case 0.0039 To 0.0049: FaceArea8mm = FaceArea8mm + swFace.GetArea
Case 0.0049 To 0.0059: FaceArea10mm = FaceArea10mm + swFace.GetArea
Case Else: FaceArea12mm = FaceArea12mm + swFace.GetArea
End Select
End If
If d < SmallestRad Then SmallestRad = d
Else
If i = 0 Then
FaceArea12mm = FaceArea12mm + swFace.GetArea
End If
End If
Next i
End If
End If
End If
Next
...
SolidworksApi macros