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
indicesoverpositions, with the mouth'srim, or none for a closed vessel. Keeps unmodifiable copies; throws an ArgumentError whenindicesdoes 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
pointcrosses 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 withupas 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 levelvolumestands at in the vessel upright. -
lip(
Vector3 up) → VesselLip? -
Available on VesselShape, provided by the VesselVolumes extension
The lowest point of the rim alongup, 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 · pover 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 alongupat which the plane square to it leavesvolumeunder 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 fromguess, 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 totoleranceof 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;upis 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 tolevel.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited