MeshBuilder class final

Builds a ShapeMesh a vertex and a triangle at a time. Each triangle is wound to face the way its vertices' normals point, whichever order it was given in.

Constructors

MeshBuilder([ShapeUv uv = ShapeUv.natural])
A builder laying textures out by uv.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uv → ShapeUv
How textures are laid out.
final
vertexCount → int
How many vertices so far.
no setter

Methods

box(double x0, double y0, double z0, double x1, double y1, double z1, {bool stretch = false}) → void
The six faces of the box from (x0, y0, z0) to (x1, y1, z1); each face's texture spans it once when stretch.
build() → ShapeMesh
The mesh built so far.
disc(double radius, double y, int segments, {required bool up}) → void
A flat disc of radius at height y facing up (−Y) or down (+Y), in segments steps; its texture spans it once when natural.
face(List<(double, double, double)> corners, double nx, double ny, double nz, {bool stretch = false}) → void
A flat face through corners (x, y, z each, in order round a convex outline) facing (nx, ny, nz); its texture spans it once when stretch and the layout is natural, else by planar.
fitTexture(int from, int to) → void
Rescales the texture coordinates of vertices from to to to span 0..1 each way.
lathe(List<(double, double, double, double, double)> profile, int segments, {required double aroundLength, required double profileLength}) → void
Sweeps profile round the Y axis in segments steps: a surface of revolution. Each profile point is (distance from the axis, y, the normal's outward part, the normal's y part, distance along the profile); the texture wraps once round (aroundLength metres for ShapeUv.metres) and runs down the profile (by its distance, over profileLength when natural).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
planar(double x, double y, double z, double nx, double ny, double nz) → (double, double)
Texture coordinates of a point (x, y, z) on a flat face facing (nx, ny, nz): projected onto the face, in metres (of the world for ShapeUv.metres), right and down as seen from outside it.
quad(int a, int b, int c, int d) → void
Adds the quad a b c d (corners in order round it).
toString() → String
A string representation of this object.
inherited
triangle(int a, int b, int c) → void
Adds a triangle facing the way its vertices' normals point. One with no area is left out.
vertex(double x, double y, double z, double nx, double ny, double nz, double u, double v) → int
Adds a vertex; returns its index.

Operators

operator ==(Object other) → bool
The equality operator.
inherited