About the corner of the pipe

https://www.babylonjs-playground.com/#20OAV9#776
Can we fix the problem of too thin corner

Thank you, but you don’t seem to understand my question

Are you trying to join two pipes with a mitre? If so will the mitre always be 90 degs?

Create Parametric Shapes - Babylon.js Documentation may be the way to go.

I need a pipe, but there was a problem with the size of the corners when I built the pipe using tube

image

yes,always be 90.

To check if it is a perspective problem as @Necips suggests place a horizontal pipe of the same size next to the existing one. If it looks smaller towards the bend and matches the existing one then it is a perspective issue, if not then it is a bend issue.

It’s not a perspective problem, check this: https://www.babylonjs-playground.com/#20OAV9#778

What @zhang is saying is that the radius of the tube is decreasing when we reach the corner.

@zhang it’s not easy to correct because the vertices at the turn would have to be generated on an ellipse and not on a circle as it is currently. You can mitigate the problem by adding additional points on the path before and after the turn, but it won’t be perfect.

See: Babylon.js Playground

You could think it’s ok, but if you move you will see the corner is actually a little larger than the tube section. As said, the vertices at the corner should be generated on an ellipse and not on a circle to be ok.

Maybe you can try with CSG (Constructive Solid Geometry), but I’m not sure it can work.

Does the same thing in ThreeJS >_< can you increase the sub divs along the tube and see if that helps?

actually, the ring located in the pipe corner has exactly the same radius than all the other rings… expect it’s not parallel with the vertical rings, neither with horizontal rings.
[EDIT] : wireframed to understand the geometry https://www.babylonjs-playground.com/#20OAV9#779

You need probably to add more points in the path to get what you expect …not sure it’s obvious with the wanted geometry. A CSG is probably easier to build.

[EDIT2] note that, if you still want to use a single tube, you can pass a radiusFunction to increase the second ring radius in order to compensate its inclination.

@zhang sorry for the delay but it took a while for my old brain to wrap around the issue. The function mitredExtrude currently only works when the shape is a circle. It works with paths with sharp corners. For smooth paths use tube.

Open - Babylon.js Playground

Closed - https://www.babylonjs-playground.com/#376T60#1

2 Likes

Correction. It will work when the shape is not a circle, at least for an open path https://www.babylonjs-playground.com/#376T60#2

For a closed path the final join is twisted https://www.babylonjs-playground.com/#376T60#3

Unless you choose your path carefully https://www.babylonjs-playground.com/#376T60#4

1 Like