fix(imports/zones): average z coordinate of non planar polys#716
fix(imports/zones): average z coordinate of non planar polys#716JanBlk wants to merge 1 commit intooverextended:masterfrom
Conversation
|
This function does indeed calculate the average value of all the z-coordinates, and will prevent the error occuring when there is no duplicate z-coords. However, this does produce a different result that the current ox implementation. I created a simple test here. When you provide a list of points without a duplicate z-coord, the current ox implementation breaks. But when a duplicate z-coord is present, it doesn't break, but also doesn't calculate the average. It's either the median value, or some kind of biased average. @thelindat @DokaDoka The implementation in this PR would produce the average z-coord and prevent the code breaking, but I am unsure if average is the desired result. Edit: On further review, it looks like current implementation is just picking the most common z-value. See #723 for alternative fix, which maintains current implementation. Related to this Discord discussion. |
I noticed that when creating a polyzone with points that have very similar, but not equal, z coordinates (so if they all round to the same number), the previous averaging logic threw an error, it was also overcomplicated.