Defining the Domain and Cutting (-T)#

Note

This tutorial presents the -domain and -transform options of the Tessellation Module (-T). Read first: Generating a Voronoi Tessellation (-T). For details on the use of the Visualization Module (-V) in this tutorial, see Visualizing a Tessellation (-V).

To reproduce exactly the images below, add the following line to your $HOME/.neperrc file (or to a local configuration file to be loaded with --rcfile):

neper -V -imagesize 800:400

Defining the Domain (-domain)#

The domain can be defined using -domain (the default value is "cube(1,1,1)" in 3D and "square(1,1)" in 2D). For example, an elongated cuboidal domain of dimensions \(3 \times 1 \times 0.33\) can be obtained as follows:

$ neper -T -n 100 -domain "cube(3,1,0.33)"

This produces a Tessellation File (.tess) named n100-id1.tess.

The tessellation can be visualized using the Visualization Module (-V):

$ neper -V n100-id1.tess -print img1
../../_images/img11.png

Similarly, a cylindrical domain of height 1.5 and diameter 1 can be obtained as follows:

$ neper -T -n 1000 -domain "cylinder(1.5,1)"

This produces a Tessellation File (.tess) named n1000-id1.tess. The domain is exact (curved). A faceted domain can be obtained by providing the number of facets, as in "cylinder(1.5,1,50)".

The tessellation can be visualized as before (each curved cell face is represented as a planar polygon):

$ neper -V n1000-id1.tess -print img2
../../_images/img21.png

A spherical domain of diameter 1, as used to model a powder particle, can be obtained in the same way:

$ neper -T -n 1000 -domain "sphere(1)"

This produces a Tessellation File (.tess) named n1000-id1.tess, which can be visualized as before:

$ neper -V n1000-id1.tess -print img3
../../_images/img31.png

An hourglass domain of height 1.5, end diameter 1 and center diameter 0.6 can be obtained as follows:

$ neper -T -n 1000 -domain "hourglass(1.5,1,0.6)"

This produces a Tessellation File (.tess) named n1000-id1.tess, which can be visualized as before:

$ neper -V n1000-id1.tess -print img4
../../_images/img4.png

Cutting Tessellations (-transform)#

Tessellations can be cut by geometrical primitives once generated, using -transform cut (the region interior to the primitives is removed). For example, a cube with a cylindrical hole of radius 0.25, along y and through its center, can be obtained as follows:

$ neper -T -n 1000 -transform "cut(cylinder(0.5,0,0.5,0,1,0,0.25))"

This produces a Tessellation File (.tess) named n1000-id1.tess, which can be visualized as before:

$ neper -V n1000-id1.tess -print img5
../../_images/img5.png

Several primitives can be combined. For example, a plate of thickness 0.1 drilled with four holes of diameter 0.3 (radius 0.15) along z can be obtained as follows:

$ neper -T -n 200 -domain "cube(1,1,0.1)" -transform "cut(cylinder(0.25,0.25,0,0,0,1,0.15),cylinder(0.25,0.75,0,0,0,1,0.15),cylinder(0.75,0.25,0,0,0,1,0.15),cylinder(0.75,0.75,0,0,0,1,0.15))" -o plate

This produces a Tessellation File (.tess) named plate.tess, which can be visualized as before:

$ neper -V plate.tess -print img6
../../_images/img6.png

Note

Other primitives (sphere, torus, half-space, etc.) are available, see -transform.