Jump to content
Search Community

radiohead

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by radiohead

  1. I'm repositioning/scaling the shapes so that shouldn't be a problem, however, finding the correct shapeindex could be a headache since I'm actually comparing randomly drawn paths. Still,  looping through and comparing anchor points sounds like its on the right track. I appreciate the insight.

    Here's my current codepen.

    See the Pen aVLBMR by Radiohead (@Radiohead) on CodePen

    Right now its just copying the svg to a canvas and doing an imagedata comparison. Again, not ideal, but maybe itll come in handy for someone else.

     

    • Like 2
  2. First, I want to say thanks for all the hard work put into the greensock tools. It's fantastic.

     

    It might be a stretch, but I was wondering if the MorphSVGPlugin might have some method for calculating the difference between 2 svg paths.

    Essentially, I want to calculate how closely 2 shapes match. Say for example I have a 200x200 square, 300x200 rectangle, and 300x300 star.

    Comparing the square and rectangle would return a higher accuracy value than comparing the square and star, since the square and rectangle paths match more closely, so to speak. Currently, im just comparing the area of the shapes, but it can only get me so far and I feel a path comparison would be more accurate. 

    Perhaps there are methods in the precompiler that I can utilize? Any way to measure the total offset of the path after it morphs?

     

    Any pointers are much appreciated!

     

×
×
  • Create New...