| |
 |  |  |
 | Command |  | Argument |  | Datatype |  | Default |
 | Min |
 | Max |  |  |
 | Format: |
 | ShowCone |
| BottomRadius = Radius of cone bottom in Å, |  | FLOAT |  | 10.0 |  | - |  | - |
 |
 | |  | | | TopRadius = Radius of cone top in Å
, |  | FLOAT |  | Bottom |  | - |  | - |  |
 | |  | | | Height = Height of cone in
Å, |  | FLOAT |
 | 10.0 |  | - |  | - |  |  | |
 | | | Edges
= Number of edges at top and bottom, |  | INT |  | 12 |
 | - |
 | - |  |  | |
 | | | BottomCol
= Color of cone bottom, |  |
RGBCOLOR |  | Red |
 | - |
 | - |  |  | |
 | | | TopCol
= Color of cone top, |  |
RGBCOLOR |  | BottomCol |
 | - |
 | - |  |  | |
 | | | SideCol
= Color of cone side, |  |
RGBCOLOR |  | TopCol |
 | - |
 | - |  |  | |
 | | | Smooth
= Yes | No |  | STRING |
 | Yes |
 | - |  | - |  |
 |  | Python: |  | result = ShowCone(bottomradius=None,topradius=None,height=None,edges=None,bottomcol=None,topcol=None,sidecol=None,smooth=None) |
 |  |  | Menu: |  | Effects > Show solid > Cone, pyramid, cylinder & prism |
 |  |  | Related: |  | ShowSphere, ShowBox, ShowTorus
, MoveMesh |  |  |  | Required: |
 |  |
 |  |
The ShowCone
command creates a cone, cylinder, pyramid or prism, depending on the chosen parameters:
- If 'BottomRadius' is the same as 'TopRadius', the result is a cylinder (Smooth=Yes) or prism (Smooth=No).
- If either 'BottomRadius' or 'TopRadius' is zero, the result is a cone (Smooth=Yes) or pyramid (Smooth=No).
- If 'BottomRadius' differs from 'TopRadius', the result is a truncated cone (Smooth=Yes) or truncated pyramid (Smooth=No).
- If the 'BottomCol' or 'TopCol' is set to 'None', the corresponding side will be open.
- The Edges parameter sets the number of edges that are used to approximate the bottom and top faces. The minimum number of three results in a tetrahedron or three-sided prism, four gives a four-sided pyramid or prism, and values >12 should be chosen to create a truly round shape, i.e. a cone or cylinder. In this case, 'Smooth' should also be set to 'Yes', so that the surface normals are adjusted to define a smooth, continuous face.
The created cone rotates around the origin of its local coordinate system
, which is at the center of the cone. Use the MoveMesh
command to shift the origin.
Example 1:
ShowCone BottomRadius=10,TopRadius=0,Height=15,Edges=4,BottomCol=Blue,SideCol=Red,Smooth=No
Show a 15 A high red four-sided pyramid with a blue base (20 A in diameter).
Example 2:
ShowCone BottomRadius=12,Height=50,Edges=20,BottomCol=Green,TopCol=Red,SideCol=Yellow
Show a cylinder with 24 A diameter, 50 A high, colored green,
yellow and red.
Example macro:
# EXAMPLE ShowCone
# Requires YASARA Model
Clear
ColorBG 3030ff,a0a0e0,5050ff,c0c0ff
ColorFog c0c0ff
# Create the island
islandheight=20.
islandradius=200
ShowCone BottomRadius=(islandradius*1.5),TopRadius=(0.998*islandradius),Height=(islandheight),Edges=26,
BottomCol=None,TopCol=c5a885,SideCol=c5a885
MoveObj Cone,Y=(-islandheight/2)
# Add the water
obj = ShowBox Width=1000,Height=2,Depth=1000,LeftCol=None,TopCol=4040ff,FrontCol=None
MoveObj (obj),Y=-10
# Create the floating matrass
matsegments=5
matsegradius=4.0
matlength=60
matcol='Green'
for i=0 to matsegments-1
obj = ShowCone BottomRadius=(matsegradius),Height=(matlength),Edges=12,
BottomCol=None,SideCol=(matcol)
dx=(1.50*matsegradius*((-0.5*(matsegments-1))+i))
MoveMesh (obj),X=(dx)
RotateObj (obj),X=90
RenameObj (obj),Matrass
for j=-1 to 1 step 2
obj = ShowSphere Radius=(matsegradius),Color=(matcol),Level=2
MoveMesh (obj),X=(dx),Z=(0.5*j*matlength)
RenameObj (obj),Matrass
obj = ShowSphere Radius=(0.75*matsegradius*matsegments),Color=(matcol),Level=2,ScaleY=0.5,ScaleZ=0.5
MoveMesh (obj),Y=(1.50*matsegradius),Z=(0.5*matlength)
RenameObj (obj),Matrass
matshift=200
MoveObj Matrass,X=(matshift),Y=-10,Z=(-matshift)
AutoRotateObj Matrass,Y=0.5
# Define the look of a palm tree
stamheight=12.
stamradius=3.
stamsegments=8
crown=stamsegments
leafs=5
treeheight=stamheight*stamsegments
treeobjects=stamsegments+leafs
# Define the positions of the palm trees on the island
treeposx=00, -110, 70, -90, -180, 130, 100
treeposz=40, 80, -60, -120, 0, 130, 0
trees=count treeposx
# Grow the palm trees
for i=1 to trees
# Create the palm stam
for j=0 to stamsegments-1
obj = ShowCone BottomRadius=(stamradius),TopRadius=(stamradius*2.0),Height=(stamheight),Edges=12,
BottomCol=None,TopCol=3a200a,SideCol=986c34
MoveMesh (obj),Y=(stamheight*j)
RenameObj (obj),Tree(i)(j)
# Create the palm crown
for j=1 to leafs
obj = ShowSphere Radius=(stamradius*2.0),Color=3aae35,Level=2,ScaleY=0.8,ScaleZ=5
RotateObj (obj),X=8,Y=(j*360/leafs)
MoveMesh (obj),Y=(treeheight-0.5*stamheight)
RenameObj (obj),Tree(i)(crown)
# Move the tree to the final location
MoveObj Tree(i)?,X=(treeposx(i)),Z=(treeposz(i))
Move -160,-26,300
 | | Figure: Result of the example macro above. |
|