[JS CS5.5] How to get the constructor name of an oval?
I have a mix of rectangles and ovals on the page. The rectangles of course return the constructor.name of "Rectangle". Ovals that were drawn with the Ellipse tool return the constructor.name of "Oval". But a rectangle that has been converted to an oval via Object > Convert Shape still returns the constructor.name "Rectangle". Is there any way around this?
What I need to do is output the vertices of all the rectangles and polygons on the page (which I have working now), and also some sort of meaningful representation of the ovals, such as center point and diameter. I see 2 problems:
1. I can't tell an oval from a rectangle because of what I describe in my first paragraph above
2. Once I determine it is an oval, it appears the only data I can get from it is paths[0].entirePath. I'm sure there is a way to matematically reduce this path data to a simple center point/diameter combination, but it looks tricky. Has anyone done this, or is there another way?
Thanks for any tips anyone can share!
