PyramidsΒΆ
Learning targets
- Construct Pyramids as 3D Primitives
This example constructs four different pyramids. All four are shown in the following figure as seen from the top and the side. The leftmost pyramid is defined to have a sidewall angle of 60 degrees. The seconds is the default four-sided pyramid of a given height. All four corners lie on a circle defined by Radius
. The third pyramid differs just by the number of sides (NEdges
= 7 ) and the rightmost has its apex shifted by ApexShift
.
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 Pyramid
is determined by its Radius
, NEdges
and its Height
. Alternatively the Angle
can be used to determine the height of the pyramid and the apex can be moved by ApexShift
. The primitives GlobalPosition
and Rotation
are shared with all 3D primitives.
Note
The GlobalPosition
refers to the center of the circle containing all corners of the base defined in the xy plane.
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
Layout3D { UnitOfLength = 1.0 BoundaryConditions { Boundary { Direction = All Class = Transparent } } Extrusion { Objects { Parallelogram { Priority = -1 DomainId = 101 Height = 4.0 Width = 12.0 MeshOptions { MaximumSideLength = 2 } } } MultiLayer { Layer { Thickness = 5 DomainId = 101 } } } Objects { Pyramid { Name = "Pyramid1" DomainId = 5 Priority = 1 Radius = 1.0 Height = 3.0 GlobalPosition = [-1.5, 0, 0.5] MeshOptions { MaximumSideLength = .5 } } Pyramid { Name = "Pyramid2" DomainId = 5 Priority = 1 Radius = 1.0 Height = 3.0 NEdges = 7 GlobalPosition = [1.5, 0, 0.5] MeshOptions { MaximumSideLength = .5 } } Pyramid { Name = "Pyramid3" DomainId = 5 Priority = 1 Radius = 1.0 Angle = 60 GlobalPosition = [-4.5, 0, 0.5] MeshOptions{ MaximumSideLength = .5 } } Pyramid { Name = "Pyramid4" DomainId = 5 Priority = 1 Radius = 1.0 Height = 3.0 ApexShift = [0.5 0.5 0] GlobalPosition = [4.5, 0, 0.5] MeshOptions { MaximumSideLength = .5 } } } }