CSV format#
The .csv (comma separated file) is used to load user provided standard models into DAVE. The CSV format is used because it is a format that can easily be edited by standard text-editors as well as spreadsheets.
The file-format is specified as follows:
Based on .csv so it is easy to edit with excel and such
The .csv may be comma-separated, but tab-delimited is also ok. Or mixed. Basically any , or -tab- is treated as a delimiter.
Multiple delimiters count as one. So 1,,,3 is the same as 1,3 which is the same as 1 -tab- , 3
Everything after a
#
is ignored*Something
starts a “table” with a pre-defined name “Something”@Something
or&Something
starts a section with the name “Something”Tables and sections are technically equal, it is just the output format that is different
It is not required to have the same amount of data on each line, although for tables it would make sense to use them in that way
A table ends with an empty line, where comments # do not count as empty lines!
A table ends when a new table starts
Things outside a table are settings.
Settings take the form:
name, value, value2, etc
and are parsed toname = (value1, value2,...)
orname=value1
if only a single value is presenttrue/false (case-insensitive) are parsed to bool
any number is parsed to float
Note:
name = value
is not valid. It should bename, value
orname -tab- value
@Something
starts a “section” with a name Something TODO: Allow for the use of & instead of @ because @ is not nice in excelA section contains settings
All settings in a section need to have a unique name
All settings outside a section (global settings) need to have a unique name
Remarks:
Make sure numbers are . separated
Do not use , anywhere else (except in comments, there it is ok)
Warning
EXCEL by default exports incompatible .csv files if it is set to a language that uses the comma , as decimal separator.
From excel it is highly recommented to export as Text (Tab delimited)
Example
# This is example data for an island in .csv format (comma separated values)
#
# General settings
# key, value (s)
population, 0
location, imaginary space
best_visited_between, April, November
#
*Visuals
#
# Name , resource, off-x, off-y, off-z, rot-x, rot-y, rot-z, scale-x, scale-y, scale-z,,,
Visual1, res: island.obj,0,0,0,0,0,0,1,1,1,
#
*Buoyancy,,,,,,,,,,,,,
# Name, resource, off-x, off-y, off-z, rot-x, rot-y, rot-z, scale-x, scale-y, scale-z,invert_normals,,
Hull,res: island.obj,0,0,0,0,0,0,1,1,1,false
#
*Weights
# 'Name', 'mass [mT]', 'Cog-x', 'Cog-y', 'Cog-z', 'footprint: elevation', 'footprint: aft', 'footprint: front', 'footprint: sb', 'footprint: ps', 'inertia: rxx', 'inertia: ryy', 'inertia: rzz'
Main chunk, 230, 0 , 0 , 0 , 0 , -5 , 5 , -5 , 5 , 1 , 1 , 1
Second chunk, 3, 2 , 0 , 0 , 0 , -5 , 5 , -5 , 5 , 1 , 1 , 1
#
*Points
# Name, x, y, z
point1, 4, -4 , 4
point2, 8, -4 , 4
point3, 8, -8 , 4
point4, 4, -8 , 4
#
*Attachments
#
# Name, Target, posx, posy, posz, rotx, roty, rotz, attachments
Monkey 1, self , 3 , 3 , 3, , 0 , 0 , 0 , Small monkey, Big monkey
Monkey 2, self , 2 , -3.5 , 5, , 0 ,10 , 0 , Small monkey, Big monkey
Palm tree center, self , 0 , 0 , 2 , 0 , 0 , 0 , Palmtree
Another point, self , 2 , 0 , 2 , 0 , 0 , 0 , Palmtree, Small monkey, Big monkey
Swing, self , 0 , 0 , 0 , 0 , 0 , 0 , Swing
Known errors, self , 2 , 0 , 2 , 0 , 0 , 0 , Error_test
#
# Attachments-types
#
@ATT: Small monkey # This is the NAME of an attachment type, @ATT: signals that this section is an attachment
class, Visual # This is the node-class. In this case the attachment is a "Visual"
path, res: monkey.obj # These are properties of the node. All properties are supported.
scale, 0.5,0.5,0.5, # this evaluates to node.scale = (0.5, 0.5, 0.5)
#
@ATT: Big monkey # This is the NAME of an attachment type, @ATT: signals that this section is an attachment
class, Visual # This is the node-class. In this case the attachment is a "Visual"
path, res: monkey.obj # These are properties of the node. All properties are supported.
scale, 1,1,4
#
#
@ATT: Palmtree # This is the NAME of an attachement type,
class, Visual # This is the node-class. In this case
path, res: palmtree.obj , # These are properties of the node
expose, scale, rotation # expose these
#
@ATT: Swing
class, Suspended4PLoad # Suspended load takes four prongs are required input
prong1, point1, #
prong2, point2, # these four attributes
prong3, point3, # are mandatory
prong4, point4, #
rigging_length, 2 # these are optional
length, 3.5
width, 4
height, 0.2
mass, 0.1
expose, mass, rigging_length, EA, length, width, height, cogx, cogy, cogz
#
@ATT: Error_test # This is the NAME of an attachement type,
class, Visual2 # Invalid name - for testing error messages
path, res: palmtree.obj , # These are properties of the node
expose, scale, rotation # expose these
#
# DATA tables
#
*Bananas
Banana1,sweet, 1, in the tree
Banana2,baked, 1, hidden
And, now, for something, completely, different