1

I have four nodes in a 3D space A(x1,y1,z1), B(x2,y2,z2), C(x3,y3,z3) and D(x4,y4,z4)

Now, I want to use these four nodes to form a convex quadrilateral element, so how do you order the nodes as counter-clockwise?

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
Rilin Shen
  • 13
  • 1
  • Or, not care about the clockwise, just make sure that no cross between line AB and line CD – Rilin Shen May 10 '17 at 20:35
  • Search for "segment-segment intersection" or look [here](http://stackoverflow.com/a/563275/1307866) – tiwo May 10 '17 at 21:54
  • Cleaer up grammar (the question is answerable as is) – mmmmmm May 11 '17 at 12:20
  • A general solution in two dimensions is ordering the points according to direction to average. If you are certain the nodes are of a 2D element, you could translate the coordinates to the plane and do that. – Haem May 11 '17 at 12:28
  • Are the four points _guaranteed_ to form a valid quad (given the right order)? That is, are all in the same plane? And are they always convex quads? (I think otherwise the problem is ill-defined) If the answers are yes, I _think_ you can just compute the pairwise distances and make sure that the furthest pair is not contiguous. – jdehesa May 11 '17 at 12:46
  • Thank you all. What I am doing is to constructing plane element for finite element method. For this kind of problem, a more suitable method is to predefine the node order which can be then used to order the new node set. – Rilin Shen May 22 '17 at 19:47

0 Answers0