Hello!
You have three options how to connect thick lines:
const points1 =
[
-5, 7, 0,
5, 7, 0,
5, 13, 0
]
This will distort long lines because the line shares vertices at the ‘elbow’ of the line. (see the image below)
const points2 = BABYLON.GreasedLineTools.SegmentizeLineBySegmentLength(
BABYLON.GreasedLineTools.ToVector3Array( [
-5, 0, 0,
5, 0, 0,
5, 6, 0
])
, 0.1)
You can split the line into smaller segments.
const points3 =
[
[
-5, -7, 0,
5, -7, 0,
],
[
5, -7, 0,
5, -1, 0
]
]
You can define [] []
points so it doesn’t share vertices. You can modify the points position so the line will overlap better. In our case thw width of the line is 1, so subtract 0.5 (half of the width) from the x position [4.5, -7, 0, 4.5, -1, 0]
Or you can combine these approaches together. (segmentize only the portion of the line close to the elbow or draw an extra line which connects the elbowed two line segments manually)