## Purpose

Positions a geometric object within the (three-dimensional) canvas of a spectral geometry description. Depending on the sign of the dimension parameters, these objects can be boxes, cylinders, or ellipsoids.

## Options

-c / --center
a,b,c origin of primitive (0.0, 0.0, 0.0)
-d / --dimension
a,b,c extension of hexahedral box; negative values are diameters
-e / --exponent
i,j,k exponents for axes - 0 gives octahedron (|x|^(2^0) + |y|^(2^0) + |z|^(2^0) < 1), 1 gives a sphere (|x|^(2^1) + |y|^(2^1) + |z|^(2^1) < 1), large values produce boxes, negative turns concave.
-f / --fill [ 0 ]
grain index to fill primitive. "0" selects maximum microstructure index + 1
-q / --quaternion
rotation of primitive as quaternion
-a / --angleaxis
angle,x,y,z clockwise rotation of primitive about axis by angle
--degrees [ False ]
angle is given in degrees
--nonperiodic [ True ]
wrap around edges
--realspace [ origin,origin+size] instead of [0,grid ]
-c and -d span coordinates

## Examples

### hexahedral box

> geom_addPrimitive --center 16 16 16 --dimension 8 12 16 --fill 0 < blank32x32x32.geom > hexahedral_inclusion.geom

 Figure 1: Hexahedral inclusion of 8 by 12 by 16 voxels.

This example demonstrates the filling of a hexahedral volume.

• --center 16 16 16 places the center of the affected volume in the center of the 32x32x32 geometry.
• --dimension 8 12 16 spans a hexahedral volume of 8 by 12 by 16 voxels.
• --fill 0 assigns to the affected volume an index one larger than the maximum index found in the original geom file. Here, the maximum microstructure index was 1, hence the new (red) volume is filled with index 2 = 1+1.

### cylinder

> geom_addPrimitive --center 16 16 16 --dimension -8 -12 16 --fill 0 < blank32x32x32.geom > cylinder_inclusion.geom

 Figure 2: Cylindrical inclusion of 8 by 12 by 16 voxels.

This example demonstrates the use of negative dimensions to indicate diameters resulting in ellipsoidal (here cylindrical) volumes.

• --dimension -8 -12 16 produces an elliptical cross-section with diameters of 8 by 12 and an extruded length of 16 along the z direction.

### ellipsoid

> geom_addPrimitive --center 16 16 16 --dimension -8 -12 -16 --fill 2 < blank32x32x32.geom > ellipsoid_inclusion.geom

 Figure 3: Ellipsoidal inclusion of 8 by 12 by 16 voxels.

This example sets all three dimensions to negative values.

• --dimension -8 -12 -16 produces an ellipsoidal volume with diameters of 8 by 12 by 16.
• --fill 2 set the microstructure index of the ellipsoidal volume to a value of 2.

### complex assembly

> geom_addPrimitive --center 16 16 16 --dimension 8 12 16 --fill 2 < blank32x32x32.geom |  geom_addPrimitive --origin 16 16 8 --dimension 32 32 1 --fill 2 | geom_addPrimitive --origin 16 16 24 --dimension 8 -8 -8 --fill 1 > complex_assembly.geom

 Figure 4: A more complex assembly out of three primitives (hexahedral boxes and a cylinder).

This example combines multiple primitives to produce a more complex shape.

Topic attachments
I Attachment Action Size Date Who Comment
geom blank32x32x32.geom manage 134 bytes 01 Apr 2015 - 15:01 MartinDiehl 32x32x32 geometry of microstructure index 1
png geom_addPrimitive_box.png manage 229 K 04 Mar 2014 - 02:43 PhilipEisenlohr hxahedral inclusion of 8x12x16 voxels
png geom_addPrimitive_complex.png manage 248 K 04 Mar 2014 - 03:54 PhilipEisenlohr a more involved assembly of primitives
png geom_addPrimitive_cylinder.png manage 229 K 04 Mar 2014 - 02:43 PhilipEisenlohr cylindrical inclusion of 8x12 with length 16 voxels
png geom_addPrimitive_ellipsoid.png manage 228 K 04 Mar 2014 - 02:44 PhilipEisenlohr ellipsoidal inclusion of 8x12x16 voxels
This topic: Documentation > Processing > PreProcessing > GeomAddPrimitive
Topic revision: 15 Feb 2019, MartinDiehl
Copyright by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding DAMASK? Send feedback
§ Imprint § Data Protection