CrystalFace

References
public class CrystalFace : IStorable
Immutable facet of a material thumbnail gem.

Constructors

CrystalFace

#
public CrystalFace(IReader reader)
Deserialize a shape from an archive.
reader (IReader)

CrystalFace

#
public CrystalFace(Locus centre, Locus normal, Locus[] points)
Face constructor. Use the other overload if you want to make sure the face is valid.
centre (Locus)Centre point of face (used for elevation sorting).
normal (Locus)Face normal direction.
points (Locus[])Face corners, ought to be coplanar and convex. This array is not cloned, so don't change it afterwards.

Properties

Centre

#
public Locus Centre { get; }
Gets the average centre point of this face.

Elevation

#
public double Elevation { get; }
Gets the average elevation of this face.

Normal

#
public Locus Normal { get; }
Gets the normal direction of this face.

Points

#
public IEnumerable<Locus> Points { get; }
Enumerates over all points in this facet.

Visibility

#
public CrystalVisibility Visibility { get; }
Gets the visibility of this face.

Methods

Render

#
public void Render(Graphics graphics, DisplayMaterial material)
Render this face to a graphics context.
graphics (Graphics)Graphics object to draw with.
material (DisplayMaterial)Material properties.

Render

#
public void Render(Graphics graphics, Gradient gradient)
Render a face with the colour picked from a gradient based on illumination.
graphics (Graphics)Graphics context.
gradient (Gradient)Gradient with valid values between 0.0 (fully in shade) and 1.0 (fully lit).

Store

#
public void Store(IWriter writer)
Serialize this shape.
writer (IWriter)
Store

Transform

#
public CrystalFace Transform(Transform transform)
Transform this face.
transform (Transform)Tranformation.
Transformed face.