How would you solve this?

I’m creating a mesh along the spline, the mesh is basically some stairs, the only problem is that when I deform the mesh in a certain way (like displayed below):
6717061--772459--image0.gif
some triangles intersect and overlap with each other in the corner… because of the geometry…
6717061--772462--Screen Shot 2021-01-12 at 11.54.45.png

I think the solution would be identifying those “ears” and remove them from the mesh.triangles to leave a smooth corner but how would I do that… or is there a better solution for this.


How would you solve this?

Broadly this process is called mitering, and the term derives from diagonally cutting wood. You either extend or contract the shared off-axis vertices.

Depending on how you’re generating the geometry, you take different steps to miter it and make it join neatly. You can look at the Unity LineRenderer to see how they handle corners, or try out other vector line rendering packages to see their approaches.

1 Like

How are you generating the geometry?
I’m currently doing something similar and the way I avoid this kind of stuff is by finding the corner points and working from there instead of finding the middle point and orientation. if that makes sense, not sure how to explain.

What do you do after finding the corner points?

I need to maintain the exact shape… I think by doing this you deform mesh… giving me a different shape in that part… which would result to a wrong object.

What else can I do…? I’m trying triangles intersecting each other…

Well I just build the mesh from corner A to corner B and if all segments calculate the correct corner position for all the intersections this issue solves itself, I think we’re not communicating properly, care to elaborate on how you build the mesh?

6717700--772609--Screen Shot 2021-01-12 at 15.03.56.png
First I create this simple mesh… then I use a third party spline mesh tool (SuperSplinesPro) to repeat the mesh along the spline

This shape is fairly simple, why not just create the mesh itself yourself in code?
I’m not familiar with SuperSplinesPro.

I create it from code but save the mesh and replicate it on a spline… so that I can make it curved where I have no problems… but when I make it linear I get the problem I showcase…

What should I do :frowning:

If the spline thing you use doen’t take care of that you gotta use another or make your own.

if you wanna make your own I’m pretty sure this would help you

So I see the problem is not the spline… but the spline mesh… I think :frowning:
I’ll keep looking