| Arc | TCL UTILITIES USER MANUAL | Arc |
|---|
| Arc  |
|
| wnID | - | The iD of the window to output the arc in. |
| X | - | The X coordinate of the center of the arc. |
| Y | - | The Y coordinate of the center of the arc. |
| Z | - | The Z coordinate of the center of the arc. Unused with the TK graphics driver but perhaps not with the VTK driver. |
| R | - | The radius of the arc. |
| bA | - | The beginning angle in degrees of the arc. |
| bE | - | The end angle in degrees of the arc. |
| MkSq | - | Flag indicating that the arc should be drawn as if its being output in a window with a 1:1 aspect ratio. Arc's drawn in rectangular windows are drawn with the aspect of the window (circles become ellipses). Set to X or Y to output as if the window has a 1:1 aspect ratio with the requested radius being measured against the X or Y axis respectively. Set to any other value to draw the circle using the aspect ratio of the window. | MkPie | - | Set to 1 if when drawing an an arc you want lines drawn from end points to the center. Set to 0 for not lines. |
| Res | - | The angular resolution to use when drawing the arc. Set to -1 to get maximum resolution. An N-sided polygons can be created by setting the resolution to 360/N. |
| Tag | - | Optional input variable which allows the arc to have the designated Tag attached to it. Tagged items can be selectively deleted from a canvas. |
# INITIALIZE the default gui settings
GUIprefsRead
# SET a window size
set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500
# START graphics
GraphicsOn TK RainBow SWAP
# ESTABLISH a graphics window coverting the whole canvas
GenWindow 0 0.0 0.0 0.0 1.0 1.0 1.0 -6.0 -6.0 0.0 6.0 6.0 0.0
# DRAW three circle. The white circle is drawn using the aspect ratio
# of the window, the red circle uses a 1:1 aspect ratio with the radial
# length determined from the X axis and the green circle uses a 1:1
# aspect ratio but the radial length determined from the Y.
PlotColor HOLD $GphInfo(White) HOLD
Arc 0 0.0 0.0 0.0 3.0 0.0 360.0 0 0 -1.
PlotColor HOLD $GphInfo(Red) HOLD
Arc 0 0.0 0.0 0.0 3.0 0.0 360.0 X 0 -1.
PlotColor HOLD $GphInfo(Green) HOLD
Arc 0 0.0 0.0 0.0 3.0 0.0 360.0 Y 0 -1.
# DRAW 12 sided polygon in blue by setting Res to 30.0
PlotColor HOLD $GphInfo(Blue) HOLD
Arc 0 0.0 0.0 0.0 2.0 0.0 360.0 Y 0 30.0
# 30 degree pie slices in the same format and colors as the circles
PlotColor HOLD $GphInfo(White) HOLD
Arc 0 2.5 2.5 0.0 2.0 30.0 60.0 0 1 -1.
PlotColor HOLD $GphInfo(Red) HOLD
Arc 0 2.5 2.5 0.0 2.0 30.0 60.0 X 1 -1.
PlotColor HOLD $GphInfo(Green) HOLD
Arc 0 2.5 2.5 0.0 2.0 30.0 60.0 Y 1 -1.
# 30 degree arcs in the same format and colors as the circles
PlotColor HOLD $GphInfo(White) HOLD
Arc 0 -2.5 2.5 0.0 2.0 120.0 150.0 0 0 -1.
PlotColor HOLD $GphInfo(Red) HOLD
Arc 0 -2.5 2.5 0.0 2.0 120.0 150.0 X 0 -1.
PlotColor HOLD $GphInfo(Green) HOLD
Arc 0 -2.5 2.5 0.0 2.0 120.0 150.0 Y 0 -1.
# 60 degree filled arcs arranged in a circle ala color wheel. The
# arcs are drawn with a 1:1 appect ratio.
PlotColor HOLD $GphInfo(Red) $GphInfo(Red)
Arc 0 -3.5 -3.5 0.0 1.0 0.0 60.0 Y 1 -1.
PlotColor HOLD $GphInfo(Yellow) $GphInfo(Yellow)
Arc 0 -3.5 -3.5 0.0 1.0 60.0 120.0 Y 1 -1.
PlotColor HOLD $GphInfo(Green) $GphInfo(Green)
Arc 0 -3.5 -3.5 0.0 1.0 120.0 180.0 Y 1 -1.
PlotColor HOLD $GphInfo(Cyan) $GphInfo(Cyan)
Arc 0 -3.5 -3.5 0.0 1.0 180.0 240.0 Y 1 -1.
PlotColor HOLD $GphInfo(Blue) $GphInfo(Blue)
Arc 0 -3.5 -3.5 0.0 1.0 240.0 300.0 Y 1 -1.
PlotColor HOLD $GphInfo(Purple) $GphInfo(Purple)
Arc 0 -3.5 -3.5 0.0 1.0 300.0 360.0 Y 1 -1.
# Same as above but drawn with the window aspec ratio.
PlotColor HOLD $GphInfo(Red) $GphInfo(Red)
Arc 0 3.5 -3.5 0.0 1.0 0.0 60.0 0 1 -1.
PlotColor HOLD $GphInfo(Yellow) $GphInfo(Yellow)
Arc 0 3.5 -3.5 0.0 1.0 60.0 120.0 0 1 -1.
PlotColor HOLD $GphInfo(Green) $GphInfo(Green)
Arc 0 3.5 -3.5 0.0 1.0 120.0 180.0 0 1 -1.
PlotColor HOLD $GphInfo(Cyan) $GphInfo(Cyan)
Arc 0 3.5 -3.5 0.0 1.0 180.0 240.0 0 1 -1.
PlotColor HOLD $GphInfo(Blue) $GphInfo(Blue)
Arc 0 3.5 -3.5 0.0 1.0 240.0 300.0 0 1 -1.
PlotColor HOLD $GphInfo(Purple) $GphInfo(Purple)
Arc 0 3.5 -3.5 0.0 1.0 300.0 360.0 0 1 -1.
| Feb 22, 2007 |
|---|