buildMesh method
Its triangles, textured by uv.
Implementation
@override
ShapeMesh buildMesh([ShapeUv uv = ShapeUv.natural]) {
final r = Primitive3D.size(radius);
final n = Primitive3D.count(rings, 2, 64);
final b = MeshBuilder(uv)
..lathe(
[
for (var j = 0; j <= n; j++)
(
r * math.sin(math.pi * j / n),
-r * math.cos(math.pi * j / n),
math.sin(math.pi * j / n),
-math.cos(math.pi * j / n),
uv.anyway(r * math.pi * j / n),
),
],
Primitive3D.count(segments, 3, 128),
aroundLength: uv.around(r),
profileLength: uv.anyway(r * math.pi),
);
final mesh = b.build();
return smooth ? mesh : mesh.faceted();
}