geometry - find orthonormal basis for a planar 3D ( possibly degenerate) polygon -


given general planar 3d polygon, there general way find orthonormal basis planar polygon?

the straight forward way assume take first 3 points of polygon, , form 2 vectors each, , these 2 orthonormal basis vectors looking for. problem approach these 3 points may line on same line in polygon, , hence instead of getting 2 orthonormal vectors, one.

another approach find second orthonormal vector loop through polygon , find point forms different orthonormal vector first one, approach susceptible numerical errors (e.g, if second vector same first vector? numerical errors can significant).

is there other better approach?

you can use cross product of 2 lines connected 2 vertices. if cross product low you're in degenerate territory.

you can take centroid (the avg of points, guaranteed lie on same plane) , pick largest of 2 cross products of vectors centroid vertex. accurate normal. please note if largest cross product small, may have inaccurate normal.

if can't find cross product isn't close 0, original poly degenerate , normal hard find. use arbitrary precision or adaptive precision algebra in case, but, of course, round-off error significant in source data, may not help. if possible, remove degenerate polys first, , if have to, sew mesh :).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -