Thread: [Brlcad-users] tree listing without primitives
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: Dwayne K. <dw...@su...> - 2005-12-22 21:58:06
|
Is there a way to get a tree listing without primitives? Any tree listing with many primitives is essentially useless to an analyst or modeler. Another useful addition to the tree command would be to allow a user to direct the output to a text file. D |
From: brlcad <br...@ma...> - 2005-12-23 04:36:50
|
An excellent question and the answer to both is yes. The tree command has a -c option to only list combinations/regions as well as a -o option for writing the tree out to a file. For example, using the moss.g geometry file as an example from the benchmark suite, the tree listing is as shown: mged> tree all.g all.g/ u platform.r/R u platform.s u box.r/R u box.s u cone.r/R u cone.s u ellipse.r/R u ellipse.s u tor.r/R u tor u light.r/R u LIGHT If we only wanted the combinations and regions, we use the -c parameter: mged> tree -c all.g all.g/ u platform.r/R u box.r/R u cone.r/R u ellipse.r/R u tor.r/R u light.r/R If we wanted to safe the tree to a file: mged> tree -o mytree.txt all.g The output of the tree command is now in the simple text file that we named "mytree.txt". One more perhaps useful option to the tree command is the -i option which allows you to specify the indentation level. For example, to use only 2 spaces per indentation level instead of the default tab, and safe to file as well: mged> tree -i 2 -o mytree2.txt platform.r That performs a tree of platform.r using an indentation of 2. We can use the tcl exec command to run commands on the outside of mged and see the file's contents: mged> exec ls -la mytree2.txt -rw-r--r-- 1 sean users 48 22 Dec 23:23 mytree2.txt mged> exec cat mytree2.txt platform.r/R u platform.s Subsequent tree -o commands will append to the file specified if it already exists instead of overwriting it, so you can perform several tree commands and save them all to the same file. Cheers! Sean On Dec 22, 2005, at 16:57, Dwayne Kregel wrote: > Is there a way to get a tree listing without primitives? Any tree > listing with many primitives is essentially useless to an analyst or > modeler. Another useful addition to the tree command would be to allow > a user to direct the output to a text file. > D |