RevolvedVessel class final
A vessel whose inside is a surface of revolution about its Y axis — a test tube, a beaker, a flask: a wall profile in the (radius, height) plane, from the middle of the floor up the side to the mouth.
Cut across its axis it is a disc, and a plane cuts a disc along a chord, so the volume below a plane is a sum of circular segments, slice by slice. Upright it is exact: a straight piece of the profile sweeps a frustum, πΔy(r₀² + r₀r₁ + r₁²)/3.
- Implemented types
- Available extensions
Constructors
-
RevolvedVessel(List<
Vector2> wall, {int slices = 240, int rimPoints = 48}) -
The vessel swept from
wall, summed over 240 slices with 48 rim points unless given. Throws an ArgumentError for a wall of fewer than two points.
Properties
- capacity → double
-
Available on VesselShape, provided by the VesselVolumes extension
The most the vessel holds upright, in cubic metres.no setter - floor → double
-
The height of the inside's lowest point, in metres.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- mouthRadius → double
-
The radius of the mouth: the profile's last point.
no setter
-
rim
→ List<
Vector3> -
The edge of the mouth, as points round it; empty for a closed vessel,
which nothing leaves.
latefinal
- rimPoints → int
-
How many points the rim has.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slices → int
-
How many slices a tilted plane's volume is summed over.
final
- top → double
-
The height of the wall's highest point, in metres.
latefinal
-
wall
→ List<
Vector2> -
The profile, an unmodifiable copy: each point a (radius, height) in
metres, from the middle of the floor up the side to the mouth.
final
- widest → double
-
The widest the inside gets: a radius, in metres.
latefinal
Methods
-
contains(
Vector3 point) → bool -
Whether
pointis inside.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
-
radiusAt(
double height) → double -
The radius of the inside at
height, or nought outside its height. -
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. -
wallDistance(
Vector3 point) → VesselWallDistance? -
How far
point(vessel frame) is from the wall, across it: negative inside, positive in or beyond the glass; and the wall's outward normal there. Measured in the plane through the axis to the nearest piece of the profile, so it holds round a rounded bottom as up a straight side, where the radius at a height says nothing of how near the bottom is. Null above the mouth, where there is no wall.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited