Spheres and EllipsoidsΒΆ

Learning targets

  • Construct Spheres and Ellipsoids as 3D Primitives

  • Apply rotations

    This example constructs three different ellipsoids: a Sphere, an Ellipsoid and a SuperEllipsoid. All three are shown in the following figure as seen from the top and the side. The ellipsoid is slightly rotated.

top view

side view

MESH

SIDE

.jcm Input File

The layout.jcm file contains a Layout3D section indicating the use of 3D primitives. The background is defined first, then the object section with the three objects follows. The sphere has a single parameter (Radius) while the Ellipsoid is determined by its radii in all three coordinate directions. The primitives GlobalPosition and Rotation are shared with all 3D primitives. The SuperEllipsoid has additionally exponents to the radii determining its shape (cf. SuperEllipsoid for details).

Note

The parameters of the Sphere and Ellipsoid are self-explanatory . The GlobalPosition refers to the center of the objects.

  • layout.jcm [ASCII]

     1Layout3D {
     2  UnitOfLength = 1.0
     3  BoundaryConditions {
     4    Boundary {
     5      Direction = All 
     6      Class = Transparent 
     7    }
     8  }
     9  Extrusion {
    10    Objects {
    11      Parallelogram {
    12        Priority = -1
    13        DomainId = 101
    14        
    15        Height = 5.0
    16        Width = 10.0
    17        MeshOptions  {
    18          MaximumSideLength = 2.0
    19        }
    20      }
    21    }
    22    MultiLayer {
    23      Layer {
    24        Thickness = 5 
    25        DomainId = 101
    26      }
    27    }
    28  }
    29  Objects {
    30    Ellipsoid {
    31      Name = "Ellipsoid"
    32      DomainId = 4
    33      Priority = 3
    34      RadiusX = 1.0
    35      RadiusY = 2.0
    36      RadiusZ = 1.5
    37      GlobalPosition = [-3.3, 0 , 2.5]
    38      Rotation = [ 0.0 1.0; 
    39                   0.5 1.0 ; 
    40                   1.0 0.0]
    41      MeshOptions  {
    42        MaximumSideLength = 1
    43      }
    44    }
    45  }
    46}