You are here: Surpac Concepts > Macros > SCL > SCL Graphics Drawing > SclGraphicsInsertShellFromTrisolation
GEOVIA Surpac

SclGraphicsInsertShellFromTrisolation

Overview

To draw complex three dimensional shapes the underlying graphics system makes use of a graphics primitive known as a shell. A shell is an object comprised of a number of faces where each face may be defined by 3 or more points. The Surpac range of products makes use of this shell primitive to draw trisolations and DTMs. While a shell may accept faces of any number of vertices, usage in Surpac is such that all faces are triangular facets of 3 vertices only.

Since almost all circumstances where a complex three dimensional shape would be drawn will have the shapes originally stored in a Surpac .DTM file, the SclGraphics extension to draw these objects uses a handle to the trisolation directly to draw the shell. This simplifies the process of constructing the slightly complex arrays of points and face definitions.

Synopsis

SclGraphicsInsertShellFromTrisolation $trisolationHandle

Description

This command inserts a shell by sourcing data from the specified trisolation. The shell edge weight, edge pattern, face pattern and colour are determined by other SclGraphics commands.

A shell is a complex arrangement of any number of faces but as a convenience the shell is defined as a Surpac trisolation. Therefore to draw any object as a shell the data must be sourced from a Surpac DTM file and the handle to the trisolation to be drawn must be obtained using appropriate Scl commands.

A shell may have different colours for its faces (the interior of each face) and edges (the perimeter of each face). Other attributes that may be set are edge weight (thickness), edge pattern and face pattern.

Arguments

  • trisolationHandle
  • Pass by value. The handle of the trisolation that is to be drawn using the shell primitive. If the trisolation is outside the screen extents it will not be visible.

Returns

The key to the shell so that it can be selectively deleted using SclGraphicsDeleteByKey.

Examples

#
# Load a DTM file and obtain the handle of the trisolation to be drawn
#
SclCreateSwa SwaHandle "dtm swa"
if {[catch {$SwaHandle SclSwaOpenFile draw1.dtm "load draw styles"}] != 0} {
  # this is how we trap for errors
  puts "Error loading draw1.dtm"
} else {
  # load was successful
  $SwaHandle SclCreateTriobject triobject 1
  $triobject SclCreateTrisolation trisol 1
  #
  # Create a node and insert a trisolation
  #
  SclGraphicsOpen mygraphicsnode
    # insert the shell and remember its key
    set key [SclGraphicsInsertShellFromTrisolation $trisol ]
    # set the rendering attributes
    SclGraphicsSetColour "faces=green, edges=pink"
    SclGraphicsSetVisibility "markers=off,edges=off"
    SclGraphicsSetEdgeWeight 2
    SclGraphicsSetEdgePattern "-.-."
  SclGraphicsClose
  # and now make sure we can see it
  SclGraphicsUpdateDisplay
}

See Also

SclGraphicsSetEdgePattern
SclGraphicsSetEdgeWeight

SclGraphicsSetFacePattern

SclGraphicsSetColour