Cartesian Mesh Editing and Modification Functions

ic_cart_is_loaded

These functions are used to manipulate the cart_file data which is used by the Global mesher. Note that the meshes output by Global global can be cylindrical in addition to purely Cartesian. The positions in X, Y, and Z appear in the cart file, together with information on the coordinate system.

In addition to the explicit stations, one or more ranges can be stored in the cart file. These ranges specify a distribution of stations. When the list of stations is requested for a direction, or the file saved or displayed, these ranges will be evaluated to give the result. Each range contains the following parameters:

  • start: the starting position for the range

  • end: the ending position for the range

  • type: one of the following values:

    • uniform: the stations are uniformly spaced in the region

    • geo_start: the spacing is geometric, from the start point

    • geo_end: the spacing is geometric, from the ending point back towards the start

    • geo_both: the spacing is geometric in both directions. Currently unimplemented

    • explicit: the specific list of stations is given. This option is currently unavailable from the ic_ functions.

  • count: the number of stations for uniform spacing or an explicit list

  • start_h: the starting spacing if the type is geo_start or geo_both

  • start_r: the starting ratio between adjacent stations if the type is geo_start or geo_both.

  • end_r: the ending spacing if the type is geo_end or geo_both.

  • end_r: the ending ratio between adjacent stations if the type is geo_end or geo_both.

  • comb: how to combine this range with other ranges. If comb is 0 then the new stuff will wipe out all the old stuff in the regions where it covers it, if 1 then the old and new stuff gets merged, and if 2 then the new stuff will be used only in regions that are NOT inside a previous range where we also had a value of 2, but the old stuff will be always pulled in. However the new stuff will always contribute its starting and ending points no matter what.

  • max_h: the maximum spacing for the entire range

  • active: 1 if this range is to be used, 0 if it's inactive

Checks if cart file information has been loaded into the program.

ic_cart_is_modified set [""]

Checks if the cart file info has been modified.

ic_cart_get_bbox

Returns the bounding box of the cart file stations. The return value is a list of 2 triples: e.g. {0 0 0} {1 2 3}

ic_cart_unload

Unloads the current cart file data.

ic_cart_load file

Loads cart data from the given file name. It is not initially visible.

ic_cart_save file

Writes out cart data to the given file.

ic_cart_initialize from_proj bbox [""]

Creates an empty cart file with the boundary of the current viewable stuff as the stations. There will be 2 stations in each of the 3 directions which are at the min and max of the visible area. If the from_proj argument is 1, and a tetin file is loaded, then instead the geometry data will be used and a station will be created at each "key point" of the geometry.

ic_cart_stats

Return stats for the cart file. 4 integers are returned: the number of stations in each direction, followed by the number of nodes (i.e. the product of these three values).

ic_cart_visible on

Enables/disables the cart file visibility.

ic_cart_grid_type

Returns the type of the loaded cart file: either cartesian or cylindrical.

ic_cart_set_grid_type type

Set the type of the loaded cart file. type must be either cartesian or cylindrical.

ic_cart_add_screen pt vec

Add one station to the cart file, based on the vector defined by pt and vec. These are the values determined by screen selection.

ic_cart_select_screen pt vec

Select stations in the cart file via the screen, based on the vector defined by pt and vec.

ic_cart_delete_selected

Delete the selected stations in the cart file, which have been previously defined using ic_cart_select_screen.

ic_cart_list_stations dir

List the stations in a direction. dir should be either 0, 1, or 2.

ic_cart_set_stations dir stats

Set the stations in a direction. dir should be either 0, 1, or 2. stats is a list of floating point numbers which are the stations in that direction.

ic_cart_list_ranges dir

List the ranges in a direction. dir should be either 0, 1, or 2. The return value is a list of ranges, where each range has the format:

start end type numpts start_h start_r end_h end_r comb max_h active

The meaning of these parameters is described at the start of this section.

ic_cart_set_ranges dir ranges

Set the ranges in a direction. The ranges argument is a list of ranges as described above.

ic_cart_get_axes

Get the axes for the cart file. This returns a list of 4 triples: origin axis0 axis1 axis2

ic_cart_set_axes origin axis0 axis1 axis2

Set the axes for the cart file. The arguments are the origin and the 3 coordinate axes, each of which is a list of 3 numbers.

ic_cart_is_from_ddn

Checks if the cart file came from DDN. This matters because the cart files from DDN are written out together with the geometry pre-transformed into the given coordinate system, but other cart files are not.