Search code examples
triangulation

Is it possible to set output directory for triangle program from triangle package?


I see no way to set destination directory or file here: http://www.cs.cmu.edu/~quake/triangle.switch.html

Actually, the program places result file in the same directory, even if current directory is different.

Why? Is ti possible to change?


Solution

  • The output files for the program are generated from the input file names. You can see this from the source code on line 3586

    strcpy(b->outnodefilename, b->innodefilename);
    ...
    strcat(b->outnodefilename, ".node");
    strcat(b->outelefilename, ".ele");
    ...
    

    Because of that I don't think there is a way to set the output directory as an option. It seems you will need to manually copy the output files to a different directory

    cp output.node your/output/dir/output.node && rm output.node