3 point plane of contact

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 3 point plane of contact

    How can I create assignments to choose the 3 highest values from a series of points? I know how to get the max of an array. But the second and third highest point are what have me stumped.

  • #2
    The only way i know of is lets say you have 10 points & you want the 3 highest. You would have to create an array for every combination of points you have to come up with the 3 highest. I know it sucks, but thats all i got...sorry
    sigpic.....Its called golf because all the other 4 letter words were taken

    Comment


    • #3
      You could sort the array and then grab the first 3 indexes. SORTUP and SORTDOWN do not work on my version (3.73) maybe they have fixed it maybe not. If it is not fixed this will sort down:

      Code:
      	    ASSIGN/AR_ORIGINAL = ARRAY(.0006, .0002, .0003, -.0002, -.0006, -.0002, .0002, .0004)
                  ASSIGN/AR_SORTED = 0
                  ASSIGN/AR_LENGTH = LEN(AR_ORIGINAL)
                  ASSIGN/AR_MIN = MIN(AR_ORIGINAL)
                  ASSIGN/LOOPCOUNT = 1
                  WHILE/AR_LENGTH > 0
                  ASSIGN/AR_MAXINDX = MAXINDEX(AR_ORIGINAL)
                  ASSIGN/AR_SORTED[LOOPCOUNT] = AR_ORIGINAL[AR_MAXINDX]
                  ASSIGN/AR_ORIGINAL[AR_MAXINDX] = AR_MIN - 1
                  ASSIGN/AR_LENGTH = AR_LENGTH - 1
                  ASSIGN/LOOPCOUNT = LOOPCOUNT + 1
                  END_WHILE/
      Then the first three indexes will be your largest values. You could modify this to loop only 3 times into an array. That's what I'd do. This is just an example of sorting with PCDMIS.
      <internet bumper sticker goes here>

      Comment


      • #4
        Originally posted by craiger_ny View Post
        You could sort the array and then grab the first 3 indexes. SORTUP and SORTDOWN do not work on my version (3.73) maybe they have fixed it maybe not. If it is not fixed this will sort down:

        Code:
        	    ASSIGN/AR_ORIGINAL = ARRAY(.0006, .0002, .0003, -.0002, -.0006, -.0002, .0002, .0004)
                    ASSIGN/AR_SORTED = 0
                    ASSIGN/AR_LENGTH = LEN(AR_ORIGINAL)
                    ASSIGN/AR_MIN = MIN(AR_ORIGINAL)
                    ASSIGN/LOOPCOUNT = 1
                    WHILE/AR_LENGTH > 0
                    ASSIGN/AR_MAXINDX = MAXINDEX(AR_ORIGINAL)
                    ASSIGN/AR_SORTED[LOOPCOUNT] = AR_ORIGINAL[AR_MAXINDX]
                    ASSIGN/AR_ORIGINAL[AR_MAXINDX] = AR_MIN - 1
                    ASSIGN/AR_LENGTH = AR_LENGTH - 1
                    ASSIGN/LOOPCOUNT = LOOPCOUNT + 1
                    END_WHILE/
        Then the first three indexes will be your largest values. You could modify this to loop only 3 times into an array. That's what I'd do. This is just an example of sorting with PCDMIS.

        COOL !!!!!!!!!!!!!!!
        sigpic.....Its called golf because all the other 4 letter words were taken

        Comment


        • #5
          Originally posted by craiger_ny View Post
          You could sort the array and then grab the first 3 indexes. SORTUP and SORTDOWN do not work on my version (3.73) maybe they have fixed it maybe not. If it is not fixed this will sort down:

          Code:
          	    ASSIGN/AR_ORIGINAL = ARRAY(.0006, .0002, .0003, -.0002, -.0006, -.0002, .0002, .0004)
                      ASSIGN/AR_SORTED = 0
                      ASSIGN/AR_LENGTH = LEN(AR_ORIGINAL)
                      ASSIGN/AR_MIN = MIN(AR_ORIGINAL)
                      ASSIGN/LOOPCOUNT = 1
                      WHILE/AR_LENGTH > 0
                      ASSIGN/AR_MAXINDX = MAXINDEX(AR_ORIGINAL)
                      ASSIGN/AR_SORTED[LOOPCOUNT] = AR_ORIGINAL[AR_MAXINDX]
                      ASSIGN/AR_ORIGINAL[AR_MAXINDX] = AR_MIN - 1
                      ASSIGN/AR_LENGTH = AR_LENGTH - 1
                      ASSIGN/LOOPCOUNT = LOOPCOUNT + 1
                      END_WHILE/
          Then the first three indexes will be your largest values. You could modify this to loop only 3 times into an array. That's what I'd do. This is just an example of sorting with PCDMIS.
          I agree, as usual, very clever Craiger.


          Jan.
          ***************************
          PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
          Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

          Comment


          • #6
            I may have put that in the code section. I remember a while back someone brought up SORTUP and SORTDOWN not working. Does anyone know if it works now in the 4+ versions. That would be the best and easiest answer if it does.

            Try SORTDOWN first.
            <internet bumper sticker goes here>

            Comment


            • #7
              The problem still exists as Bob pointed out. The three highest points relative to the current workplane may not be the three highest relative plane points. A loop that constructs a plane from three of the points then confirms that all other points lie below the constructed plane is necessary. Contsructing a bestfit plane to begin with may help but it really depends on the error of any one point. This was an ugly question to begin with. I thought there was a function to find the highest plane(maybe I am thinking of a different software)
              Links to my utilities for PCDMIS

              Comment


              • #8
                If you are using a CAD model try the high point autofeature.
                I used to be high on life but I built up a tolerance.

                Brown & Sharpe Global Advantage
                PCDMIS CAD++ v2011mr2
                PH10MQ/SP600M


                sigpic

                Comment


                • #9
                  Originally posted by cmmguy View Post
                  The problem still exists as Bob pointed out. The three highest points relative to the current workplane may not be the three highest relative plane points. A loop that constructs a plane from three of the points then confirms that all other points lie below the constructed plane is necessary. Contsructing a bestfit plane to begin with may help but it really depends on the error of any one point. This was an ugly question to begin with. I thought there was a function to find the highest plane(maybe I am thinking of a different software)
                  ALSO, what happens if the 3 highest points are on a 'hill' and thus centerd in one very small area of the surface? I would think that the very least, you need to measure all those points, make a plane, level to it, then measure them all again THEN find the 3 highest points, and all the measured point would HAVE to be at the same locaiton both times.

                  I would assume that you are trying to find the 3 'areas' where this part would touch a surfaec plate when sitting on it, well, unless you are scanning 100% of the surface, you will not find those 3 points. This is a REAL big problem and I don't see an easy way to find this answer with a CMM.
                  sigpic
                  Originally posted by AndersI
                  I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

                  Comment


                  • #10
                    Originally posted by Matthew D. Hoedeman View Post
                    ALSO, what happens if the 3 highest points are on a 'hill' and thus centerd in one very small area of the surface? I would think that the very least, you need to measure all those points, make a plane, level to it, then measure them all again THEN find the 3 highest points, and all the measured point would HAVE to be at the same locaiton both times.

                    I would assume that you are trying to find the 3 'areas' where this part would touch a surfaec plate when sitting on it, well, unless you are scanning 100% of the surface, you will not find those 3 points. This is a REAL big problem and I don't see an easy way to find this answer with a CMM.
                    Yes, your right, the center of gravity for the part would need to lie within the three highest points for them to be valid.
                    Links to my utilities for PCDMIS

                    Comment

                    Related Topics

                    Collapse

                    Working...
                    X