Extract boundary of 2D grids
This project is maintained by ameli
This package has been created to facilitate ParaView users that interact with two dimensional data grids. This package is utilized as a ParaView plugin, so the end users could take advantage of it as a new Filter. The Extract Boundary filter extracts boundaries of a 2D grid. It is robust to concave geometries, unusual cell links in a boundary point and acute and narrow bay-like shapes. Furthermore, user may opt for extracting all inner boundaries, such as lakes. This filter also identifies points with zero velocity. Inward or outward normal vectors are also calculated at each point.
The program accepts various grid types such as structured or unstructured grids. Also it works well with different two dimensional cell types, for instance triangular, polygons, etc. Moreover, multiple file formats as supported. Common file formats are legacy *.vtk
and binary *.vtu
extensions.
User can build the code from source. You can obtain the source code from github repository. Please install git
package:
sudo apt-get install git
Then, create a build directory and download the source code inside the build directory:
$ mkdir /tmp/ExtractBoundary
$ cd /tmp/ExtractBoundary
$ git clone git://github.com/ameli/extract-boundary
Now, build the code:
$ cmake .
$ make
$ sudo make install
$ cd ..
$ rm -r /tmp/ExtractBoundary
Installation is system-wide for all users.
You may use binary package instead of building code from source. Binary installation is available for Ubuntu operating system. Follow these commands in Ubuntu terminal:
$ sudo add-apt-repository ppa:ameli/extractboundary
$ sudo apt-get update
$ sudo apt-get install extractboundary
Filter has the following options:
true
.true
.false
.You can use the program either in terminal or as a ParaView plugin. Here are examples to use it in terminal:
$ extractboundary /input-path/inputfile.vtk /output-path/outputfile.vtk
You can also define only output filename without path. In this case, program writes output file in the same directory of input path.
$ extractboundary /input-path/inputfile.vtk outputfile.vtk
You may not define any path. So it considers the current directory for both input and output path:
$ extractboundary inputfile.vtk outputfile.vtk
If user do not specify output file, it writes output file with the same name as input file name with a -boundary
suffix and the same file extension of input file.
$ extractboundary /input-path/inputfile.vtk
or
$ extractboundary inputfile.vtk
In this case, output file name would be inputfile-boundary.vtk
.
For help, use -h
, for get program information use -i
and for see the license, use -l
options.
$ extractboundary -h
$ extractboundary -i
$ extractboundary -l
A sample vtk output file is similar to the following:
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 55 float
4 14 0 1 12 0 2 11 0
1 10 0 1 9 0 2 8 0
3 6 0 2 5 0 4 2 0
...
VERTICES 55 110
1 0
1 1
1 2
...
POLYGONS 3 30
14 0 1 2 3 4 5 6 7 8 9 10 11 12 13
8 26 27 28 29 30 31 32 33
8 34 35 36 37 38 39 40 41
POINT_DATA 55
NORMALS NormalVectors double
0.0621374 -0.998068 0 0.995133 -0.0985376 0 1 0 0
0.92388 -0.382683 0 0.92388 0.382683 0 0.811242 0.58471 0
0.987087 -0.160182 0 0.995133 -0.0985376 0 0.471858 0.881675 0
...
FIELD FieldData 1
VelocityBoundary 1 55 unsigned_int
0 1 1 1 0 0 0 0 0
0 0 0 0 0 0 0 1 1
1 0 0 0 0 0 0 0 0
...
Figures \ref{png-1} to \ref{png-4} show how to load the plugin and use it. Also Figures \ref{pdf-1} to \ref{pdf-6} illistrate how the filter is implemented on a 2D unstructured grid.
Copyright 2013 Siavash Ameli
This source code is provided as-is, without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for non commercial purpose, to alter it and redistribute it freely, subject to the following restrictions:
Any bug reports and comments are appreciated. You may report bugs in github, Launchpad.
This work was supported by the National Science Foundation, award number 1047963.