3 Replies Latest reply on Sep 9, 2017 8:13 AM by Jacob Corder

    Find minimum concave radius?

    Matt Fisher

      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

                       ...

        • Re: Find minimum concave radius?
          Jacob Corder

          So a concave surface can be a cylinder surface based on the targeting face.

           

          What you will need is to capture faces relative to a surface, so if it's a piece of raw stock one of the 6 block faces.

           

          The reason for this is you will need to determine the axis of cylindrical faces. If they are NOT the same as the targeting face normal, then they are concave. If the axis is in the same direction or opposite direction, then they are cylindrical and can be drilled.

           

          This link has the code determining which faces to analze., But you will need to know the raw stock faces for yours to work, or possibly use the 6 standard view normals (0,0,1),(0,1,0),(1,0,0),(0,0,-1),(0,-1,0),(-1,0,0)

          These are xyz vector directions.

          If you aren't familiar with them, Think of them as the direction ratio that a flat face is pointing to. So (0,0,1) is flat, and is moving away from the origin in the positive  the z axis of the part while (0,0,-1) is moving away from the origin in the negative dimensions in the z axis

           

          Maximum milling drill tool

          Clear as mud?

            • Re: Find minimum concave radius?
              Matt Fisher

              Jacob, thank you for the response. I think we're talking about two different things. I'm looking for the minimum internal/concave radius of a surface for milling purposes not drilling. Most of our CNC'd blocks have surfaces either copied directly, offset, or cut normal to customer supplied part data(automotive). There are few if any true cylindrical surfaces.

               

              I think you are trying to determine if a hole is normal to one of the stock block faces so that you can setup on a 3-axis machine. Is this correct?

                • Re: Find minimum concave radius?
                  Jacob Corder

                  that is the attempt in that link. Yours requires much more complex analysis as most of those surfaces probably are complex. Almost like you would need to create a mesh to detemine imported geometry possibly. 

                   

                  To get points on a surface like those hopefully someone else can help ya out. If you send a model that would be helpful. Pick the worst one of course.