maker.js icon indicating copy to clipboard operation
maker.js copied to clipboard

How to calculate the area?

Open doox911 opened this issue 6 years ago • 4 comments

Hello!) How to calculate the area arch or another figures?

doox911 avatar May 13 '19 05:05 doox911

Hello, I wasn't sure how many people would want/need area calculation, but my thought was to implement something similar to the algorithm here: https://alienryderflex.com/polygon_area/

danmarshall avatar May 13 '19 21:05 danmarshall

It would be great if you added this.

doox911 avatar May 13 '19 21:05 doox911

Hello, is the area feature is introduced in makerjs yet? if not, can you please write a sample code that returns the area of a rectangle? (not length*width)

Thank you

MontassarAbdelhedi avatar Feb 14 '23 12:02 MontassarAbdelhedi

@MontassarAbdelhedi it's not planned and not requested as much as other features. Please check my comment above for a cool algorithm. If your rectangle is not rotated, try makerjs.measure.modelExtents which will give rectangular outer extents.

danmarshall avatar Feb 14 '23 19:02 danmarshall