The format of the cofiguration file is also the format of the clipboard contents if you copy objects there. It is plain text (file or clipboard type is 'TEXT') comprising a list of object descriptions. Each description begins on a new line with a word giving the type of object, followed on the same line by an opening brace. This brace marks the start of a multi-line character string which continues until the matching brace. This character string contains the defining commands for the object. The first command is typically the command which sets the objects name. The layout is as follows:
type {
name {the name}
...further commands...
}
The type should be one of the recognized object types (Current, Loop, Solenoid, Revolved, Wire, Racetrack, Linear, or Planar). If the software does not recognize the type then the text between curly brackets which follows it will simply be ignored. The commands which can be used within the braces depend upon the type of the object, and are described in the next section. The format of a command line is
command param
where command is a valid command word and param is a parameter.
Length parameters can have units (m, mm, cm, ft, in).
Vector position parameters can have units, but only after the entire vector.
String parameters are quoted by braces instead of quotes so that strings can be nested. Multiline strings are possible -- once a string is opened with a left brace, it continues until the matching right brace is found. For instance, the comment command contains the contents of the Notes page of the dialog box:
comment {This text is the user's notes.
Note that in the file left and
right braces are prefaced by a backslash like this: \}
so that the nesting of strings is not messed up if the
user has left or right braces in the text.
}
Special characters in the file or clipboard contents:
| { | opens a (possibly multi-line) string |
| } | closes a string |
| \ | escapes next character, e.g. \{ or \} are not interpreted as string delimeters |
In the following n denotes an integer, x, y, etc. are floating point numbers (possibly with units), v a two or three-dimensional vector (possibly with units at the end), and b is a Boolean value (0 or 1). Commands are not case sensitive (i.e., positionx and positionX are the same command).
| name {the name} | set object name |
| comment {notes...} | the contents of the Notes page |
| positionX x | origin of object coordinate frame |
| positionY y | |
| positionZ z | |
| eulerPhi phi | Euler angles (degrees) |
| eulerPsi psi | |
| eulerTheta theta | |
| visible b | draw object? (b=0 suppresses drawing) |
| supplies {supply table} | see table format section |
| bias 5.7 | bias field in tesla (z direction) |
| currentSupply {name} | current supply name (no embedded blanks) |
| currentScale x | current supply scale factor |
| winding x | number of turns |
| wireDiameter x | wire diameter |
| nPhi n | steps used to draw a circle |
| phi phi0 phi1 | drawing range (degrees) |
| fluxPathStep ds | path stepsize for flux calculations (used by nonaxisymmetric conductors) |
| fluxPhiSteps n | number of azimuthal steps for flux calculations (used by axisymmetric conductors) |
| nZeta n | steps to draw wire circumference |
| loops {loop data table} | see table format section |
| innerRadius x | inner radius of solenoid |
| outerRadius x | outer radius of solenoid |
| length x | full length of solenoid |
| resolution x | used for calculation of loop spacing |
| paraxialR x | near-axis threshold for cubic expansion |
| paraxialEnabled b | enable near-axis approximations |
| drawLoops | show loops used in calculation (2-D) |
| path {2-D path...} | See below for 2-D path commands |
| drawElements | show elements (calculation loops) used in calculation |
| reverse | reverse polygon defined by path} |
| resolution x | loop spacing for later segements | |
| start v | starting position (object coordinate system) | set starting position to v |
| goto v | make segment to position v | |
| center v | center for turn | |
| dtheta theta | used if resolution is zero | |
| turn theta | turn through theta degrees | |
| close | close polygon |
| path {3-D path...} | See below for 3-D path commands |
| reverse | reverse polygon defined by path} |
| resolution x | marker spacing for later segments (only meaningful for Linear) |
| start v | starting position (object coordinates) |
| goto v | line segment to new position |
| axis v1 v2 | define axis for rotations |
| center v | define center |
| normal v | define normal |
| pitch x | pitch, in advance/revolution |
| dtheta theta | stepsize for turns, degrees |
| turn theta | turn through angle theta, degrees |
| turn x t | turn through x turns |
| close | close wire (optional) |
| length x | length of straight section |
| span x | distance between straights |
| width x | width width of conductor (in plane) |
| height x | height (out of plane) |
| resolution x | controls subdivision into wires |
| nturn n | number of segments in end turn |
| path {3-D path...} | See 3-D Path section |
| xRange x1 x2 | set plotting range x1 < x < x2 meters |
| yRange B1 B2 | set plotting range B1 < B < B2 tesla |
| plot yvars vs xvar | yvars is one or more of bx, by, bz, or b |
| xvar is one of x, y, z, or s | |
| macro {macro sequence...} | See macro section |
| grid nU nV | grid mesh is nU by nV |
| uX x | x-component of u |
| uY y | ...etc. |
| uZ z | |
| vX x | |
| vY y | |
| vZ z | |
| plotrange B1 B2 | set plotting range B1 < B < B2 tesla |
| contour x | set contour spacing to x tesla |
| apartWindow b | plot in separate window? |
| drawContour b | draw contour on configuration window? |
| drawGrid b | draw grid on configuration window? |
| drawFrame b | draw frame on configuration window? |
The Loop and Current objects are examples of objects which include a table as part of their definitions. To represent a table we use nested strings. For example, to have two loops, one of 2cm radius at z=1cm carrying 0.3A and one with opposite current of 3cm radius at z=-5mm, we have
Loop {
name {Two loop object}
currentSupply mySupply
loops {
{ {2cm} {1cm} {1} }
{ {3cm} {-5mm} {-1} }
}
}
Current {
supplies {
{ {mySupply} {0.3} }
}
}
The argument of the loops command is a string consists of a set of substrings, one string for each loop. Each of these strings consists, in turn, of three strings, specifying the radius, the alitude, and the number of turns in each loop. This is the general format of a table in BiotSavart files: the table is a string consisting of substrngs which are the rows of the table, each row made up of substrings which are the table entries.
For objects with a path description, e.g., the path of a Wire through space, the path commands are in the string which is the argument of the path command:
Wire {
name {a short wire}
path {
start 0 0 0
goto 1 0 1 cm
}
}