adobe-webplatform / Snap.svg

The JavaScript library for modern SVG graphics.
http://snapsvg.io
Apache License 2.0
13.95k stars 1.15k forks source link

How to find the area of given Vector? #590

Closed neelkadia-zz closed 6 years ago

ColemanTO commented 6 years ago

https://youtu.be/G-T_6hCdMQc

neelkadia-zz commented 6 years ago

@ColemanTO If we can have a function like...

area = snap.area(layer/object/vector);

I'll make and submit pull. There are couple of use cases for this. Immagine a shape is like this; and you want to find out the area.

Something like this

If we have a freeform drawing then my code to find area will be lengthy, time consuming to write; just wondering if we can give the function for that.

ColemanTO commented 6 years ago

https://youtu.be/ukPjc3Oyad4

neelkadia-zz commented 6 years ago

Thanks @ColemanTO! Yes I understand that.

But my point was to ask what if we can provide that kind of calculation by in-built methods? This way we go up to A+B but we have a Sum function for that in language, right?

ColemanTO commented 6 years ago

Hi neelkadia, this is probably not the best place to pose your question - it is for issues (bugs) with Snap.svg.

You might get better responses here: Stack Overflow

or here: Adobe Forums

Good luck!

neelkadia-zz commented 6 years ago

Sure. I'll try to find answer on Stackoverflow.

Thanks @ColemanTO