UnionΒΆ

Learning targets

  • Use Boolean operation to form union of two objects

This example unites two circles by means of the Boolean union operator.

_images/ex2d_union_mesh.png

Surely, we could also create this geometry by a simple overlay. However, a Boolean operation allows to apply shape manipulating operations such as corner rounding to the resulting shape.

.jcm Input File

  • layout.jcm [ASCII]

     1Layout2D {  
     2  UnitOfLength = 1  
     3  Objects {
     4    Parallelogram {
     5      Priority = ComputationalDomain
     6      DomainId = 1
     7      BoundingBox {
     8        Offset = [1 1 1 1]
     9      }
    10    }
    11    
    12    BooleanOperation {
    13      DomainId = 2 
    14      Operator = Union
    15      A { 
    16        Circle {
    17          Radius = 6
    18          GlobalPosition = [-4.0 0.0]
    19          RefineAll = 2
    20        }
    21      }
    22      
    23      B {
    24        Circle {
    25          Radius = 4
    26          GlobalPosition = [1.75 0.0]
    27          RefineAll = 2
    28        }
    29      }
    30    }
    31  }  
    32}
    

To apply a corner rounding we add the following definitions

BooleanOperation {
  A {
    ...
  }
  B {
    ...
  }
  CornerRounding {
    Radius = 0.5
    MaxAngle = 140
    NPoints = 5
  }
}

which yields the following geometry

_images/ex2d_union_mesh_rounded.png