Polygon, filling in between points

I need your help with something. There are 4 different points in PG. If I put them in a certain order, I get the result I want to achieve in SS, but what I want to do is to reach a shape like in SS without touching the point order. That is, to fill in between all the points.
In this project I will do, I need the locations because they won’t come to me in order.
What can I do about it? Can you help?


Box Examples | Babylon.js Playground (babylonjs.com)

The points need to be specified in counterclockwise order. Since you won’t able to know the correct order before hand, you could use something like convex hull algorithms to find out: A gentle introduction to the convex hull problem | by Pascal Sommer | Medium


Thanks for your recommendation. The way you recommend could have tired me out a little, both in terms of performance and technically. I used CreateTube as solution. This is how I found a solution to the problem.

Box Examples | Babylon.js Playground (babylonjs.com)