unicorn

Members
  • Content count

    2
  • Joined

  • Last visited

  1. Getting the list of border vertices

    That's a brilliant idea Wingnut. I think there should be a more mathematical workaround for this. One possible approach may be to get the position of normals. Then we convert them to 2D space by ignoring the Y values. We may be able to use convex hull algorithm to get to outer points. The following links may be good starting points. https://en.wikipedia.org/wiki/Gift_wrapping_algorithm https://github.com/indy256/convexhull-js https://github.com/AndriiHeonia/hull https://github.com/mauriciopoppe/quickhull3d However, one delicate issue that is happening here is that essentially I would like to remove all redundant vertices. If you take a look at the playground, the desired result would be that the outer rectangle have only 4 vertices. But now it show them as 8 ( 2 vertices on the left and right edges are redundant as they are on the same path)
  2. Hi all, I am new to the amazing Babylon.js and this is my first post in the forum! Here's my problem. Let's say that I have two meshes (these meshes might be randomly generated irregular polygons but for simplicity I am using two boxes). I merge them using CGS and then I flatten them by scaling the Y to zero (I am not sure if it is the correct way. I basically need to convert the 3D mesh to a 2D irregular polygon). I use a function to show the normals of the generated mesh and it shows me all the vertices. I only need to get the list of border vertices not the ones that falls inside the mesh. Upon getting the list, I would like to calculate the length of each border edges. I created a playground to demonstrate the issue. https://playground.babylonjs.com/#HCH1F4 I appreciate your help.