PolygonArea orientation and accuracy - Grasshopper2024-03-29T08:05:28Zhttps://www.grasshopper3d.com/forum/topics/polygonarea-orientation-and-accuracy?groupUrl=kangaroo&commentId=2985220%3AComment%3A1949350&x=1&feed=yes&xn_auth=nowhat a great polygon, you rea…tag:www.grasshopper3d.com,2023-06-14:2985220:Comment:22956032023-06-14T21:59:17.168ZPoulMacleinhttps://www.grasshopper3d.com/profile/PoulMaclein
<p>what a great polygon, you really did it perfect</p>
<p>what a great polygon, you really did it perfect</p> If you're interested in learn…tag:www.grasshopper3d.com,2022-03-18:2985220:Comment:22376492022-03-18T17:46:31.000Znaasakihttps://www.grasshopper3d.com/profile/naasaki
<p><span>If you're interested in learning how to solve equations, there are many ways to learn <a href="https://magnificentrevolution.org/" rel="noopener" target="_blank">math riddles</a>. There are a number of different options, but these three programs have some key features in common. The first is a structured approach. Students can learn the fundamental concepts of each grade level with these courses, which were carefully chosen by a team of experienced teachers. Whether you're looking for…</span></p>
<p><span>If you're interested in learning how to solve equations, there are many ways to learn <a href="https://magnificentrevolution.org/" target="_blank" rel="noopener">math riddles</a>. There are a number of different options, but these three programs have some key features in common. The first is a structured approach. Students can learn the fundamental concepts of each grade level with these courses, which were carefully chosen by a team of experienced teachers. Whether you're looking for a U.S. or Canadian version, these programs should be able to help.</span></p> My above script was doing som…tag:www.grasshopper3d.com,2018-12-08:2985220:Comment:19493502018-12-08T15:51:31.175ZCoryhttps://www.grasshopper3d.com/profile/Cory
<p>My above script was doing some silly things to try to keep the plane from flipping between iterations, and was causing some cases to fail. I think this works better: assure the measured area is positive (we can't really have negative polygon areas, anyway), and if a *=-1 is necessary compute an inverted ZAxis as well when applying pressures. Also input now requires a polyline rather than a list of points.</p>
<p><a href="https://pastebin.com/xv9zapfK" rel="noopener" target="_blank">planefit…</a></p>
<p>My above script was doing some silly things to try to keep the plane from flipping between iterations, and was causing some cases to fail. I think this works better: assure the measured area is positive (we can't really have negative polygon areas, anyway), and if a *=-1 is necessary compute an inverted ZAxis as well when applying pressures. Also input now requires a polyline rather than a list of points.</p>
<p><a href="https://pastebin.com/xv9zapfK" target="_blank" rel="noopener">planefit PolygonArea v2</a></p> Thanks, I think I have a bett…tag:www.grasshopper3d.com,2018-12-06:2985220:Comment:19489852018-12-06T20:22:49.622ZCoryhttps://www.grasshopper3d.com/profile/Cory
<p>Thanks, I think I have a better grasp of the math involved now. I wrote a <a href="https://pastebin.com/P4PqV8MT" rel="noopener" target="_blank">modified version</a> of the goal in python which uses Plane.FitPlaneToPoints and maps the points over before computing in order to get accurate results for any polygon orientation. A non-planar polygon will still be an approximation, of course, but combined with a CoPlanar goal this always seems to produce correct areas.</p>
<p>I'm not sure how much…</p>
<p>Thanks, I think I have a better grasp of the math involved now. I wrote a <a href="https://pastebin.com/P4PqV8MT" target="_blank" rel="noopener">modified version</a> of the goal in python which uses Plane.FitPlaneToPoints and maps the points over before computing in order to get accurate results for any polygon orientation. A non-planar polygon will still be an approximation, of course, but combined with a CoPlanar goal this always seems to produce correct areas.</p>
<p>I'm not sure how much of a performance hit it incurs, but it would need to be ported back to c# to make a good comparison to the stock code to find out.</p> The out-of-plane component of…tag:www.grasshopper3d.com,2018-12-06:2985220:Comment:19487722018-12-06T09:29:16.304ZAndrew Molehttps://www.grasshopper3d.com/profile/26wsey3qk37bg
The out-of-plane component of the cross-product is equal to the area of the parallelogram created from the two vectors (i.e. twice the area of the triangle). If the code is using .Z as being double the area of the triangle, then it must be assuming that the two vectors are in the global XY plane. (Or did I misunderstand your question?)<br />
<br />
<a href="https://mathinsight.org/cross_product" target="_blank">https://mathinsight.org/cross_product</a>
The out-of-plane component of the cross-product is equal to the area of the parallelogram created from the two vectors (i.e. twice the area of the triangle). If the code is using .Z as being double the area of the triangle, then it must be assuming that the two vectors are in the global XY plane. (Or did I misunderstand your question?)<br />
<br />
<a href="https://mathinsight.org/cross_product" target="_blank">https://mathinsight.org/cross_product</a>