grail.ip.geometry Module

Version: 16.2

Table of Contents

Overview

Provides a script writer with the ability to quickly add a geometry to the current Edit geometry. A geometry is composed by setting specifications within a dictionary and then passing those specifications to the vSetGeometry function.

The ip-label.py illustrates the creation of labels using this module.

Function

vSetGeometry(geometrydict)

Creates a geometry with the specifications outlined in the geometrydict. This function will insert the geometry into an existing Edit Object. If an Edit Object does not exist, a Edit Object Browser will appear asking the user to select the object to make an Edit Object.

vSetGeometry will return 1 if the it successfully added the geometry to a user selected edit object. It will return 0 if the user selected CANCEL when they were presented the Edit Object Browser dialog.

The geometry dictionary should have the following key-value pairs,

Type
Can be either one of the following strings: "Polyline", "Polygon" "Marker", "Label", and "Shell". String value is case sensitive.
PointList

The standard list of point triplets of the form:

[[x0, y0, z0], ..., [xN, yN, zN]]
FaceList

A list of vertex indice triples. In the form:

[[v0_0, v0_1, v0_2], ..., [vN_M, ...]]

where the first each triplet corresponds to a face. The face list definition used above is not the same as the one used in the grail.ag module.

NumFaces
The length of the list supplied to FaceList.
NumPoints
The length of the list supplied to PointList.
Values
If the Type is a "Label", then the list of strings in this location will be used as individual lines for the label.
UpVect

If the Type is a "Label", then the up direction for the label is defined as a three point list of the form,

[xi, zi, yi]

Generally you will use the value: [0., 1., 0.].

RightVect

If the Type is a "Label", then the right direction for the label is defined as a three point list of the form,

[xi, zi, yi]

Generally you use the value: [1., 0., 0.].

Planar
Set to 1 if the geometry is planar, otherwise set to 0.