# Crystal class

Namespace: [Grasshopper2.UI.Crystallography](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.crystallography.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public class Crystal : PreviewShape
```

Immutable collection of faces and edges of a material thumbnail gem.

## Constructors

- [Crystal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/ctor.md): (2 overloads) Deserialize a shape from an archive.

## Properties

- [CrystalNames](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/crystalnames.md): (static) 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.
- [EdgeCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/edgecount.md): Gets the number of edges in this crystal.
- [Edges](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/edges.md): Enumerate over all edges in this crystal.
- [FaceCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/facecount.md): Gets the number of faces in this crystal.
- [Faces](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/faces.md): Enumerate over all faces in this crystal.
- [Info](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/info.md): Gets some information about this crystal.
- [Name](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/name.md): Gets the name of this crystal.

## Methods

- [LoadFromBrep](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/loadfrombrep.md): (static) Create a new shape from a brep.
- [LoadFromFile](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/loadfromfile.md): (static) 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.
- [Render](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/render.md): Render this crystal to a graphics context.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/store.md): Serialize this shape.
- [ToBrep](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/tobrep.md): Create a Brep from this crystal.
- [Transform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/transform.md): Transform this crystal.
- [TryLoadCrystal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.crystal/tryloadcrystal.md): (static) Try and load a crystal from the resource folder by name.

## Inherited Members

- From [PreviewShape](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.previewshape.md): [Bounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.previewshape/bounds.md), [CreateAngleTransform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.previewshape/createangletransform.md), [CreateCameraTransform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.crystallography.previewshape/createcameratransform.md)
