Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

making a fast projection of a crytsallographic unit cell

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80779] making a fast projection of a crytsallographic unit cell
  • From: Roger Bagula <rlbagula at sbcglobal.net>
  • Date: Sat, 1 Sep 2007 00:32:47 -0400 (EDT)

The problem is that I want to plot representations of crystallographic 
cells fast in Mathematica.

The face centerd cubic unit cell can be represented in 3d as a set of 
points.
Hermann-Mauguin space groupo notation: Fm3m
Sodium Chloride and many metal crystals use this crystal cell.
(* points for cubic close pack/ face centered cubic*)
p = {{1, 1, 1}, {1, 0, 0}, {2, 1, 0}, {0, 0, 1}, {2, 2, 1}, {1, 2,
   2}, {0, 1, 2}, {0, 1, 0}, {1, 2, 0}, {0, 2, 1}, {2, 0, 1}, {
      2, 1, 2}, {1, 0, 2}};
pieces =
 Complement[
  Flatten[Table[{i, j, k}, {i, 0, 2}, {j, 0, 2}, {k, 0, 2}],
   2], p]
(* showing as points*)
Show[Graphics3D[Table[Point[pieces[[n]]], {
      n, 1, Length[pieces]}]], Boxed -> False]

(* creating the equivalent of a graphic primitive like a Cuboid[] for a 
sphere*)

Clear[sphere]
<< RealTime3D`
(* RealTime3D allows you to drag the graphic around to see from 
different view points*)
sphere[n_]:=ParametricPlot3D[{Sin[t]*Sin[p]/2-pieces[[n]][[
    1]],Cos[t]*Sin[p]/2-pieces[[n]][[2]],Cos[p]/2-pieces[[n]][[3]]},{t,-
      Pi,Pi},{p,0,Pi},Axes\[Rule]False,Boxed\[Rule]False]

(* plotting them at the points them at the points*)
gr=Table[sphere[n],{n,1,Length[pieces]}];

Show[gr]

The problem isn't doing it, but doing it faster.
There are 230 Federov space groups in 3d.
Roger Bagula


  • Prev by Date: Re: Re: problem with parsing InputForm scientific notation (eg. 3.`*^-7)
  • Next by Date: Re: [Mathematica 6] Bug in Labeled, Center align option
  • Previous by thread: Re: problem with parsing InputForm scientific notation (eg. 3.`*^-7)
  • Next by thread: Re: making a fast projection of a crytsallographic unit cell