Hi all,
I have 4 different layers of vectors that I created from Illustrator. My plan is to get a percentage area for each layer. The total would be all 4 of them combine.
Thanks in advance.
Peiming
Hi all,
I have 4 different layers of vectors that I created from Illustrator. My plan is to get a percentage area for each layer. The total would be all 4 of them combine.
Thanks in advance.
Peiming
Calculate the area of all shapes per layer. So you have four lists of numbers (a_0, a_1, ...)(b_0, b_1, ...)(c_0, c_1, ...)(d_0, d_1, ...)
Flatten these four lists into a single list: (a_0, a_1, ..., b_0, b_1, ..., c_0, c_1, ..., d_0, d_1, ...).
Use Mass Addition on this flat list to calculate the total area A_{total}.
Use mass addition to calculate the totals per layer. Divide one by the other and multiply by 100.
You are. What’s the error message?
It saids “Curve must be closed for area calculation”. So I put a closed curve on it and it shows this
The error is because the “Closed Curve” component is returning a boolean (true/false) value that indicates if the curve is closed or not, (not closing the curve).
But, you can easily use that, in conjunction with the “Sift” and “Combine data” component to separate out the open curves, close them, then put the list back together. Something like this:
I followed your instruction and there is now error. But the final number(Total Area) isn’t quite right. It gives me 7501, so I measure one of the big curves in rhino and it gives me half of that number.
hrmm, I didn’t consider that the start and end point might not be close to each other. Can you post an example of the curves?
Thanks for looking into this. layer percentage calculation.3dm (4.7 MB) layer Percentages.gh (39.3 KB)
okay, I see what was happening. during the sifting process, the nulls were getting cleaned out, (which are needed for the combine component to know how to reassemble the list).
Boom. Thanks for providing suggestions and solutions! Just out of curious. why there is a deviation in the total value?
I guess the right way to do it is to work with VB… I am not to skilled in VB yet
For calculating percentages use - (https://w3percentagecalculator.com/)