Best fit routine

Discussion in 'AutoCAD' started by EIEIO, Jul 21, 2004.

  1. EIEIO

    EIEIO Guest

    I have a 30 sided polygon that I want to best fit inside another 30 sided
    polygon that is similiar to the first but not exact. I would like for each
    of the vertices to be as close to each other as possible, other words, the
    minumum average coordinate error. With polygons of this size this may take
    some type of perhaps least squares routine. I need something that will be
    a mathmatical solution.

    Any suggestions or thoughts appreciated.
     
    EIEIO, Jul 21, 2004
    #1
  2. EIEIO

    Paul Turvill Guest

    Are these regular polygons (all sides and angles equal) or what?
    ___
     
    Paul Turvill, Jul 21, 2004
    #2
  3. EIEIO

    EIEIO Guest

    No, they are irregular in shape. They look similiar, but the lengths of
    sides and interior angles are subtly different.
     
    EIEIO, Jul 21, 2004
    #3
  4. EIEIO

    Jimmy Riddle Guest

    If you convert your polyline to a region you can extract the geometric centre (centroid) of the shape as a co-ordinate. Run _massprop on the region and you'll find this info in the text window. You can then match the centroid of each shape, giving a best fit.
     
    Jimmy Riddle, Jul 22, 2004
    #4
  5. EIEIO

    EIEIO Guest

    Wellll... yes, but, that may not actually give the best fit. the polygon
    that is being translated may also need rotated. matching centroid is a
    start, but again that may not really give the best fit in as much as the
    polygon may need to shift centroid away from centroid, or so it seems. I am
    not a math wizard, made c's and it's been awhile. Matching centroids is one
    thing but making the vertices match with least amount of coordinate
    difference may be another.

    Your thoughts?

    centre (centroid) of the shape as a co-ordinate. Run _massprop on the region
    and you'll find this info in the text window. You can then match the
    centroid of each shape, giving a best fit.
     
    EIEIO, Jul 22, 2004
    #5
  6. EIEIO

    EIEIO Guest

    lsp was removed by OE..... who is the OE

     
    EIEIO, Jul 22, 2004
    #6
  7. EIEIO

    Matt Guest

    OE - outlook express.....

    Matt

     
    Matt, Jul 22, 2004
    #7
  8. EIEIO

    EIEIO Guest

    oh,... duh

    Found the Helmert .vlx routine, very cool, may be what I am looking for
     
    EIEIO, Jul 22, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.