|
[Sponsors] |
February 3, 2015, 16:36 |
STL Utility problem
|
#1 |
New Member
Nejc Brelih
Join Date: Apr 2013
Posts: 5
Rep Power: 13 |
Dear All,
I would like to use the the pyFoamSTLUtility.py to join several stl files in one file. However when I run the command "pyFoamSTLUtility.py cat file1.stl file2.stl" I receive an error message saying: Error in /usr/local/bin/pyFoamSTLUtility.py : FatalError in PyFoam: 'PyFoam FATAL ERROR on line 478 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PyFoamApplication.py: Specify either --to-stdout or --stld-file' in Application-class: STLUtility To me it looks there is a problem with file streams but based on the error code I am not able to debug it. I was also thinking that there may be simply a syntax problem and that the syntax of my command is not right (e.g. some bracket missing etc.). Then since it may be stream related I tried to use it with binary and ascii stl formats but I get the same error message in both cases. Does someone, who has already successfully been using this app tell me if you can see a mistake I am doing? Thanks in advance, Nejc |
|
February 4, 2015, 03:24 |
|
#2 |
Senior Member
|
Hi,
I am not a specialist in pyFoam but if you look at STLUtility.py: Code:
... # Add option groups to parsers for cmd in [joinCmd,removeCmd,mergeCmd]: outOpts=OptionGroup(cmd.parser, "Write Options", "Where the resulting STL is written to") outOpts.add_option("--to-stdout", action="store_true", dest="stdout", default=False, help="Instead of writing to file write to stdout (used for piping into other commands)") outOpts.add_option("--force-write", action="store_true", dest="forceWrite", default=False, help="Force writing if the file already exists") outOpts.add_option("--stl-file", action="store", dest="stlFile", default=None, help="Write to this filename") cmd.parser.add_option_group(outOpts) ... |
|
February 4, 2015, 03:48 |
|
#3 |
Member
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11 |
For a quick fix, you might also just append one (or more) stl files to one another:
Code:
cat file*.stl > combined.stl Peter |
|
February 5, 2015, 08:53 |
|
#4 |
New Member
Nejc Brelih
Join Date: Apr 2013
Posts: 5
Rep Power: 13 |
Thank you, indeed the > fileOut.stl syntax is needed for successful operation.
The problem is solved. |
|
February 7, 2015, 07:17 |
|
#5 |
New Member
Nejc Brelih
Join Date: Apr 2013
Posts: 5
Rep Power: 13 |
Dear All, I was a bit too quick while replying for the first time because I only noticed that there had been no more error thrown in the terminal and that a new file got created if you use "> fileOut.stl" but when I opened the file I found out that it's just the error message that gets flushed to that new file.
Then I experimented a bit and I found out that the following code works well: Code:
pyFoamSTLUtility.py join fileIn1.stl fileIn2.stl fileIn3.stl ... --stl-file fileOut.stl The utility works on ascii stl file but not on the binary version of files. Best regards, Nejc |
|
Tags |
pyfoam, stl file |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem in compiling the makeAxialMesh utility | Belmar | OpenFOAM Programming & Development | 1 | July 18, 2017 16:17 |
[SOWFA] Problem Defining terrainBlockMesherDict, point swl to stl | chusma | OpenFOAM Community Contributions | 0 | April 11, 2017 05:59 |
Sample utility - file name indexing problem | sepponen | OpenFOAM Post-Processing | 0 | July 28, 2016 07:58 |
sample utility problem | And | OpenFOAM Post-Processing | 36 | May 20, 2014 09:50 |
perturbU Utility for cylindrical problem | DaSh | OpenFOAM Pre-Processing | 0 | October 1, 2013 06:48 |