public class Crystal : PreviewShape
Immutable collection of faces and edges of a material thumbnail gem.

Constructors

Crystal

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

Crystal

#
Create a new shape.
public Crystal(
name,
Crystal name.
info,
Crystal description, may be null.
edges,
Collection of shape edges.
facets
Collection of shape faces.
)

Properties

Bounds

Gets the bounding box for this shape.
public BoundingBox Bounds { get; }
inherited fromPreviewShape

CrystalNames

#
Enumerate over all defined crystals. Note that the crystals are stored as files on the disk and may thus be deleted or renamed at any time.
public static IEnumerable<string> CrystalNames { get; }

EdgeCount

#
Gets the number of edges in this crystal.
public int EdgeCount { get; }

Edges

#
Enumerate over all edges in this crystal.
public IEnumerable<CrystalEdge> Edges { get; }

FaceCount

#
Gets the number of faces in this crystal.
public int FaceCount { get; }

Faces

#
Enumerate over all faces in this crystal.
public IEnumerable<CrystalFace> Faces { get; }

Info

#
Gets some information about this crystal.
public string Info { get; }

Name

#
Gets the name of this crystal.
public string Name { get; }

Methods

CreateAngleTransform

Set up a transformation from a set of angles and a target.
public Transform CreateAngleTransform(
angleXy,
angleYz,
perspective,
target
)
inherited fromPreviewShape

CreateCameraTransform

Set up a transformation from a camera location and display radius.
public Transform CreateCameraTransform(
camera,
radius
)
inherited fromPreviewShape

LoadFromBrep

#
Create a new shape from a brep.
public static Crystal LoadFromBrep(
name,
Name of crystal.
description,
Description of crystal.
brep
Brep to convert. Brep must be closed and contain only planar faces and straight edges. The brep as a whole must be convex.
)
Thumbnail shape.

LoadFromFile

#
Load a crystal from a 3dm file. This method will throw whenever something's not correct. The file must contain a single Brep object, and that brep must be closed and contain only planar faces and linear edges. Breps that are not fully convex will not show correctly, but they will load.
public static Crystal LoadFromFile(
filePath
File to parse.
)
Loaded crystal.

Render

#
Render this crystal to a graphics context.
public void Render(
Graphics
graphics,
material,
visibleEdges,
hiddenEdges
)

Store

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

ToBrep

#
Create a Brep from this crystal.
public Brep ToBrep()
Brep form.

Transform

#
Transform this crystal.
public Crystal Transform(
Transform
transform
Transform to apply.
)
Transformed crystal.

TryLoadCrystal

#
Try and load a crystal from the resource folder by name.
public static Crystal TryLoadCrystal(
name
Name of crystal.
)
Loaded crystal or null.