MeshVessel class final

A vessel whose inside is any closed triangle mesh: its cavity, closed across the mouth, with the triangles wound counter-clockwise seen from outside the cavity, and the rim of the mouth given as points.

The volume below a plane is a surface sum (Gauss): the region below is bounded by the part of the mesh below the plane and by the plane's own cut through it. Summing the signed tetrahedra from a point to every face of that boundary gives its volume; put the point on the plane, and every tetrahedron on the cut is flat and adds nothing. So each triangle is cut to the part below the plane and summed against a point on it, and the cut itself — which for a vessel that is not convex may be several outlines — never has to be found.

Implemented types
Available extensions

Constructors

MeshVessel({required List<Vector3> positions, required List<int> indices, List<Vector3> rim = const []})
The cavity of triangles indices over positions, with the mouth's rim, or none for a closed vessel. Keeps unmodifiable copies; throws an ArgumentError when indices does not come in threes.

Properties

capacity → double

Available on VesselShape, provided by the VesselVolumes extension

The most the vessel holds upright, in cubic metres.
no setter
hashCode → int
The hash code for this object.
no setterinherited
indices → List<int>
Three positions indices per triangle, wound counter-clockwise seen from outside the cavity.
final
positions → List<Vector3>
The mesh's vertices, in metres in the vessel's frame.
final
rim → List<Vector3>
The edge of the mouth, as points round it; empty for a closed vessel, which nothing leaves.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

contains(Vector3 point) → bool
Inside when a ray from point crosses the surface an odd number of times; along a skewed direction, so it does not run along an edge.
override
holds(Vector3 up) → double

Available on VesselShape, provided by the VesselVolumes extension

The most the vessel holds with up as it is before liquid runs over its lip; all of it, for a closed one.
levelFor(double volume) → double

Available on VesselShape, provided by the VesselVolumes extension

The level volume stands at in the vessel upright.
lip(Vector3 up) → VesselLip?

Available on VesselShape, provided by the VesselVolumes extension

The lowest point of the rim along up, and its height: where liquid leaves first. Null for a closed vessel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
span(Vector3 up) → VesselSpan
The least and greatest up · p over the inside: below VesselSpan.low the plane holds nothing, above VesselSpan.high all of it.
override
surfaceFor(Vector3 up, double volume) → double

Available on VesselShape, provided by the VesselVolumes extension

The height along up at which the plane square to it leaves volume under it: where the surface of that much liquid stands.
surfaceNear(Vector3 up, double volume, double guess, {double tolerance = 1e-10}) → double

Available on VesselShape, provided by the VesselVolumes extension

surfaceFor, started from guess, the height it stood at a moment ago: by secants on the volume, whose slope is the area of the cut and changes little over a step, so three or four volumes are enough where halving takes fifty-two. Halving still, if the secants stray out of the vessel or do not settle to tolerance of its height.
toString() → String
A string representation of this object.
inherited
volumeBelow(Vector3 up, double height) → double
The volume inside below the plane up · p = height; up is a unit vector in the vessel's frame.
override
volumeUpTo(double level) → double

Available on VesselShape, provided by the VesselVolumes extension

The volume upright up to level.

Operators

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