parsetofile module

class parsetofile.TParser

Bases: object

Class contains statics methods designed for parsing in-program objects into gprMax commands.

FRONT_2D = 0.0

minimal z coordinate.

PARSE_STRING = ''

string containing lines of the output file.

SOURCE_NAME = 'mysource'

name of the em wave source.

THICKNESS_2D = 0.0

maximal z coordinate, set to lesser value from (dx, dy).

static parse_cylinSector(cylinSector)

Introduce a cylinder sector into the input file.

Parameters:cylinsector (TCylinSector) – examined cylinder sector object.
static parse_cylinder(cylinder)

Introduce a cylinder into the input file.

Parameters:cylinder (TCylin) – examined cylinder object.
static parse_polygon(polygon)

Introduce a polygon into the input file as a series of triangles.

Parameters:polygon (TPolygon) – examined polygon object.
static parse_rectangle(rectangle)

Introduce a rectangle into the input file.

Parameters:rectangle (TRect) – examined rectangle object.
static parse_shapes(materials, shapes, title)

Parses given model to a gprMax compliant file.

Parameters:
Return type:

string

static triangulate(polygon)

Divide an input polygon into triangles using triangulate module.

Parameters:polygon (TPolygon) – examined polygon object.
Return type:list