# 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

.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]

 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 Layout3D { UnitOfLength = 1.0 BoundaryConditions { Boundary { Direction = All Class = Transparent } } Extrusion { Objects { Parallelogram { Priority = -1 DomainId = 101 Height = 5.0 Width = 10.0 MeshOptions { MaximumSideLength = 2.0 } } } MultiLayer { Layer { Thickness = 5 DomainId = 101 } } } Objects { Ellipsoid { Name = "Ellipsoid" DomainId = 4 Priority = 3 RadiusX = 1.0 RadiusY = 2.0 RadiusZ = 1.5 GlobalPosition = [-3.3, 0 , 2.5] Rotation = [ 0.0 1.0; 0.5 1.0 ; 1.0 0.0] MeshOptions { MaximumSideLength = 1 } } } }