{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "## Creating a crystal from a CIF & display it in 3D\n", "In this short example you can open a CIF file directly from a filename or an URL, and display it in 3D.\n", "\n", "You can also play with the spacegroup and see how that changes the crystal structure.\n", "\n", "*Note: this requires installing `ipywidgets` and `py3Dmol`*" ] }, { "cell_type": "code", "execution_count": 1, "id": "1", "metadata": { "tags": [] }, "outputs": [], "source": [ "from pyobjcryst.crystal import *\n", "from pyobjcryst.atom import Atom\n", "from pyobjcryst.scatteringpower import ScatteringPowerAtom\n", "from math import pi\n" ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "### From IUCr journals" ] }, { "cell_type": "code", "execution_count": 2, "id": "3", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "C15 Cl H14 N O S\n" ] }, { "data": { "application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.