BoxesΒΆ

Learning targets

  • Construct Boxes as a 3D Primitive

  • Apply rotations

    This example constructs two sets of two boxes. The first two boxes are fused together with one box rotated and translated. A rotation of the fused object can be achieved by using a BooleanOperation with the operator fuse. The remaining boxes are stacked with a slight offset. Due to different priorities the grey box cuts out the part of the red box where both boxes overlap.

_images/boxes_mesh.png

.jcm Input File

The layout.jcm file contains a Layout3D section indicating the use of 3D primitives. The substrate and background are defined first, then the object section with the four boxes follows. The box has three parameters (Length, Width and Height) in addition to the primitives GlobalPosition and Rotation shared with all 3D primitives.

Note

The parameters of the Box define the side lengths along positive coordinate axis. The GlobalPosition thus refers to the lower left corner.

  • layout.jcm [ASCII]

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    Layout3D {
      UnitOfLength = 1.0
      BoundaryConditions {
        Boundary {
          Direction = All 
          Class = Transparent 
        }
      }
      Extrusion {  
        Objects {
          Parallelogram {
            Priority = -1
            DomainId = 101
            
            Height = 8.0
            Width = 8.0
            
            MeshOptions {
              MaximumSideLength = 2.0
            }
          }
        }
        MultiLayer {
          LayerInterface {
            BoundaryClass = Transparent 
            ExteriorDomainId = 10
          }
          Layer {
            Name = "Substrate"					
            Thickness = 1.0 
            DomainIdMapping = [101 10]
          }
          Layer {
            Thickness = 7.0 
            DomainIdMapping = [101 1]
          }
          LayerInterface {
            BoundaryClass = Transparent 
            ExteriorDomainId = 1
          }
        }
      }
      Objects {
        Box  {
          Name = "Box1"
          DomainId = 2
          Priority = 1
          GlobalPosition = [-2.0,-2.0,1.0]
          Height = 2.0
          Length = 2.0
          Width =  2.0
          MeshOptions  {
            MaximumSideLength = 1
          }
        }
        Box {
          Name = "box2"
          DomainId = 2
          Priority = 1
          GlobalPosition = [-1.5,-1.5, 3.5]
          Rotation = [1.0 0.0; 3.0 1.0; 1.0 1.0]
          Height = 2.0
          Length = 2.0
          Width =  2.0
          MeshOptions  {
            MaximumSideLength = 2
          }
        }
        Box  {
          Name = "Box3"
          DomainId = 3
          Priority = 3
          GlobalPosition = [1.0,1.0,1.0]
          Height = 2.0
          Length = 2.0
          Width =  2.0
          MeshOptions {
            MaximumSideLength = 1
          }
        }
        Box  {
          Name = "box4"
          DomainId = 4
          Priority = 1
          GlobalPosition = [1.5, 1.5, 2.5]   
          Height = 2.0
          Length = 2.0
          Width =  2.0
          MeshOptions  {
            MaximumSideLength = .2
          }
        }
      }
    }
    

Note

3D objects are not allowed to touch the computational domain. Hence the Layer Substrate is introduced.