id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
222,700
vtkiorg/vtki
vtki/filters.py
DataSetFilters.slice
def slice(dataset, normal='x', origin=None, generate_triangles=False, contour=False): """Slice a dataset by a plane at the specified origin and normal vector orientation. If no origin is specified, the center of the input dataset will be used. Parameters ----------...
python
def slice(dataset, normal='x', origin=None, generate_triangles=False, contour=False): """Slice a dataset by a plane at the specified origin and normal vector orientation. If no origin is specified, the center of the input dataset will be used. Parameters ----------...
[ "def", "slice", "(", "dataset", ",", "normal", "=", "'x'", ",", "origin", "=", "None", ",", "generate_triangles", "=", "False", ",", "contour", "=", "False", ")", ":", "if", "isinstance", "(", "normal", ",", "str", ")", ":", "normal", "=", "NORMALS", ...
Slice a dataset by a plane at the specified origin and normal vector orientation. If no origin is specified, the center of the input dataset will be used. Parameters ---------- normal : tuple(float) or str Length 3 tuple for the normal vector direction. Can also be ...
[ "Slice", "a", "dataset", "by", "a", "plane", "at", "the", "specified", "origin", "and", "normal", "vector", "orientation", ".", "If", "no", "origin", "is", "specified", "the", "center", "of", "the", "input", "dataset", "will", "be", "used", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L153-L196
222,701
vtkiorg/vtki
vtki/filters.py
DataSetFilters.slice_orthogonal
def slice_orthogonal(dataset, x=None, y=None, z=None, generate_triangles=False, contour=False): """Creates three orthogonal slices through the dataset on the three caresian planes. Yields a MutliBlock dataset of the three slices Parameters ---------- x :...
python
def slice_orthogonal(dataset, x=None, y=None, z=None, generate_triangles=False, contour=False): """Creates three orthogonal slices through the dataset on the three caresian planes. Yields a MutliBlock dataset of the three slices Parameters ---------- x :...
[ "def", "slice_orthogonal", "(", "dataset", ",", "x", "=", "None", ",", "y", "=", "None", ",", "z", "=", "None", ",", "generate_triangles", "=", "False", ",", "contour", "=", "False", ")", ":", "output", "=", "vtki", ".", "MultiBlock", "(", ")", "# Cr...
Creates three orthogonal slices through the dataset on the three caresian planes. Yields a MutliBlock dataset of the three slices Parameters ---------- x : float The X location of the YZ slice y : float The Y location of the XZ slice z : float ...
[ "Creates", "three", "orthogonal", "slices", "through", "the", "dataset", "on", "the", "three", "caresian", "planes", ".", "Yields", "a", "MutliBlock", "dataset", "of", "the", "three", "slices" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L199-L234
222,702
vtkiorg/vtki
vtki/filters.py
DataSetFilters.slice_along_axis
def slice_along_axis(dataset, n=5, axis='x', tolerance=None, generate_triangles=False, contour=False): """Create many slices of the input dataset along a specified axis. Parameters ---------- n : int The number of slices to create axis : str...
python
def slice_along_axis(dataset, n=5, axis='x', tolerance=None, generate_triangles=False, contour=False): """Create many slices of the input dataset along a specified axis. Parameters ---------- n : int The number of slices to create axis : str...
[ "def", "slice_along_axis", "(", "dataset", ",", "n", "=", "5", ",", "axis", "=", "'x'", ",", "tolerance", "=", "None", ",", "generate_triangles", "=", "False", ",", "contour", "=", "False", ")", ":", "axes", "=", "{", "'x'", ":", "0", ",", "'y'", "...
Create many slices of the input dataset along a specified axis. Parameters ---------- n : int The number of slices to create axis : str or int The axis to generate the slices along. Perpendicular to the slices. Can be string name (``'x'``, ``'y'``, o...
[ "Create", "many", "slices", "of", "the", "input", "dataset", "along", "a", "specified", "axis", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L237-L283
222,703
vtkiorg/vtki
vtki/filters.py
DataSetFilters.threshold
def threshold(dataset, value=None, scalars=None, invert=False, continuous=False, preference='cell'): """ This filter will apply a ``vtkThreshold`` filter to the input dataset and return the resulting object. This extracts cells where scalar value in each cell satisfies ...
python
def threshold(dataset, value=None, scalars=None, invert=False, continuous=False, preference='cell'): """ This filter will apply a ``vtkThreshold`` filter to the input dataset and return the resulting object. This extracts cells where scalar value in each cell satisfies ...
[ "def", "threshold", "(", "dataset", ",", "value", "=", "None", ",", "scalars", "=", "None", ",", "invert", "=", "False", ",", "continuous", "=", "False", ",", "preference", "=", "'cell'", ")", ":", "# set the scalaras to threshold on", "if", "scalars", "is",...
This filter will apply a ``vtkThreshold`` filter to the input dataset and return the resulting object. This extracts cells where scalar value in each cell satisfies threshold criterion. If scalars is None, the inputs active_scalar is used. Parameters ---------- value : ...
[ "This", "filter", "will", "apply", "a", "vtkThreshold", "filter", "to", "the", "input", "dataset", "and", "return", "the", "resulting", "object", ".", "This", "extracts", "cells", "where", "scalar", "value", "in", "each", "cell", "satisfies", "threshold", "cri...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L286-L365
222,704
vtkiorg/vtki
vtki/filters.py
DataSetFilters.threshold_percent
def threshold_percent(dataset, percent=0.50, scalars=None, invert=False, continuous=False, preference='cell'): """Thresholds the dataset by a percentage of its range on the active scalar array or as specified Parameters ---------- percent : float or tup...
python
def threshold_percent(dataset, percent=0.50, scalars=None, invert=False, continuous=False, preference='cell'): """Thresholds the dataset by a percentage of its range on the active scalar array or as specified Parameters ---------- percent : float or tup...
[ "def", "threshold_percent", "(", "dataset", ",", "percent", "=", "0.50", ",", "scalars", "=", "None", ",", "invert", "=", "False", ",", "continuous", "=", "False", ",", "preference", "=", "'cell'", ")", ":", "if", "scalars", "is", "None", ":", "_", ","...
Thresholds the dataset by a percentage of its range on the active scalar array or as specified Parameters ---------- percent : float or tuple(float), optional The percentage (0,1) to threshold. If value is out of 0 to 1 range, then it will be divided by 100 and c...
[ "Thresholds", "the", "dataset", "by", "a", "percentage", "of", "its", "range", "on", "the", "active", "scalar", "array", "or", "as", "specified" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L368-L428
222,705
vtkiorg/vtki
vtki/filters.py
DataSetFilters.outline
def outline(dataset, generate_faces=False): """Produces an outline of the full extent for the input dataset. Parameters ---------- generate_faces : bool, optional Generate solid faces for the box. This is off by default """ alg = vtk.vtkOutlineFilter() ...
python
def outline(dataset, generate_faces=False): """Produces an outline of the full extent for the input dataset. Parameters ---------- generate_faces : bool, optional Generate solid faces for the box. This is off by default """ alg = vtk.vtkOutlineFilter() ...
[ "def", "outline", "(", "dataset", ",", "generate_faces", "=", "False", ")", ":", "alg", "=", "vtk", ".", "vtkOutlineFilter", "(", ")", "alg", ".", "SetInputDataObject", "(", "dataset", ")", "alg", ".", "SetGenerateFaces", "(", "generate_faces", ")", "alg", ...
Produces an outline of the full extent for the input dataset. Parameters ---------- generate_faces : bool, optional Generate solid faces for the box. This is off by default
[ "Produces", "an", "outline", "of", "the", "full", "extent", "for", "the", "input", "dataset", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L431-L444
222,706
vtkiorg/vtki
vtki/filters.py
DataSetFilters.outline_corners
def outline_corners(dataset, factor=0.2): """Produces an outline of the corners for the input dataset. Parameters ---------- factor : float, optional controls the relative size of the corners to the length of the corresponding bounds """ alg = vt...
python
def outline_corners(dataset, factor=0.2): """Produces an outline of the corners for the input dataset. Parameters ---------- factor : float, optional controls the relative size of the corners to the length of the corresponding bounds """ alg = vt...
[ "def", "outline_corners", "(", "dataset", ",", "factor", "=", "0.2", ")", ":", "alg", "=", "vtk", ".", "vtkOutlineCornerFilter", "(", ")", "alg", ".", "SetInputDataObject", "(", "dataset", ")", "alg", ".", "SetCornerFactor", "(", "factor", ")", "alg", ".",...
Produces an outline of the corners for the input dataset. Parameters ---------- factor : float, optional controls the relative size of the corners to the length of the corresponding bounds
[ "Produces", "an", "outline", "of", "the", "corners", "for", "the", "input", "dataset", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L446-L460
222,707
vtkiorg/vtki
vtki/filters.py
DataSetFilters.extract_geometry
def extract_geometry(dataset): """Extract the outer surface of a volume or structured grid dataset as PolyData. This will extract all 0D, 1D, and 2D cells producing the boundary faces of the dataset. """ alg = vtk.vtkGeometryFilter() alg.SetInputDataObject(dataset) ...
python
def extract_geometry(dataset): """Extract the outer surface of a volume or structured grid dataset as PolyData. This will extract all 0D, 1D, and 2D cells producing the boundary faces of the dataset. """ alg = vtk.vtkGeometryFilter() alg.SetInputDataObject(dataset) ...
[ "def", "extract_geometry", "(", "dataset", ")", ":", "alg", "=", "vtk", ".", "vtkGeometryFilter", "(", ")", "alg", ".", "SetInputDataObject", "(", "dataset", ")", "alg", ".", "Update", "(", ")", "return", "_get_output", "(", "alg", ")" ]
Extract the outer surface of a volume or structured grid dataset as PolyData. This will extract all 0D, 1D, and 2D cells producing the boundary faces of the dataset.
[ "Extract", "the", "outer", "surface", "of", "a", "volume", "or", "structured", "grid", "dataset", "as", "PolyData", ".", "This", "will", "extract", "all", "0D", "1D", "and", "2D", "cells", "producing", "the", "boundary", "faces", "of", "the", "dataset", "....
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L462-L470
222,708
vtkiorg/vtki
vtki/filters.py
DataSetFilters.elevation
def elevation(dataset, low_point=None, high_point=None, scalar_range=None, preference='point', set_active=True): """Generate scalar values on a dataset. The scalar values lie within a user specified range, and are generated by computing a projection of each dataset point onto ...
python
def elevation(dataset, low_point=None, high_point=None, scalar_range=None, preference='point', set_active=True): """Generate scalar values on a dataset. The scalar values lie within a user specified range, and are generated by computing a projection of each dataset point onto ...
[ "def", "elevation", "(", "dataset", ",", "low_point", "=", "None", ",", "high_point", "=", "None", ",", "scalar_range", "=", "None", ",", "preference", "=", "'point'", ",", "set_active", "=", "True", ")", ":", "# Fix the projection line:", "if", "low_point", ...
Generate scalar values on a dataset. The scalar values lie within a user specified range, and are generated by computing a projection of each dataset point onto a line. The line can be oriented arbitrarily. A typical example is to generate scalars based on elevation or height ab...
[ "Generate", "scalar", "values", "on", "a", "dataset", ".", "The", "scalar", "values", "lie", "within", "a", "user", "specified", "range", "and", "are", "generated", "by", "computing", "a", "projection", "of", "each", "dataset", "point", "onto", "a", "line", ...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L481-L552
222,709
vtkiorg/vtki
vtki/filters.py
DataSetFilters.contour
def contour(dataset, isosurfaces=10, scalars=None, compute_normals=False, compute_gradients=False, compute_scalars=True, rng=None, preference='point'): """Contours an input dataset by an array. ``isosurfaces`` can be an integer specifying the number of isosurfaces in the...
python
def contour(dataset, isosurfaces=10, scalars=None, compute_normals=False, compute_gradients=False, compute_scalars=True, rng=None, preference='point'): """Contours an input dataset by an array. ``isosurfaces`` can be an integer specifying the number of isosurfaces in the...
[ "def", "contour", "(", "dataset", ",", "isosurfaces", "=", "10", ",", "scalars", "=", "None", ",", "compute_normals", "=", "False", ",", "compute_gradients", "=", "False", ",", "compute_scalars", "=", "True", ",", "rng", "=", "None", ",", "preference", "="...
Contours an input dataset by an array. ``isosurfaces`` can be an integer specifying the number of isosurfaces in the data range or an iterable set of values for explicitly setting the isosurfaces. Parameters ---------- isosurfaces : int or iterable Number of isosurfa...
[ "Contours", "an", "input", "dataset", "by", "an", "array", ".", "isosurfaces", "can", "be", "an", "integer", "specifying", "the", "number", "of", "isosurfaces", "in", "the", "data", "range", "or", "an", "iterable", "set", "of", "values", "for", "explicitly",...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L555-L619
222,710
vtkiorg/vtki
vtki/filters.py
DataSetFilters.texture_map_to_plane
def texture_map_to_plane(dataset, origin=None, point_u=None, point_v=None, inplace=False, name='Texture Coordinates'): """Texture map this dataset to a user defined plane. This is often used to define a plane to texture map an image to this dataset. The plane defines...
python
def texture_map_to_plane(dataset, origin=None, point_u=None, point_v=None, inplace=False, name='Texture Coordinates'): """Texture map this dataset to a user defined plane. This is often used to define a plane to texture map an image to this dataset. The plane defines...
[ "def", "texture_map_to_plane", "(", "dataset", ",", "origin", "=", "None", ",", "point_u", "=", "None", ",", "point_v", "=", "None", ",", "inplace", "=", "False", ",", "name", "=", "'Texture Coordinates'", ")", ":", "alg", "=", "vtk", ".", "vtkTextureMapTo...
Texture map this dataset to a user defined plane. This is often used to define a plane to texture map an image to this dataset. The plane defines the spatial reference and extent of that image. Parameters ---------- origin : tuple(float) Length 3 iterable of floats d...
[ "Texture", "map", "this", "dataset", "to", "a", "user", "defined", "plane", ".", "This", "is", "often", "used", "to", "define", "a", "plane", "to", "texture", "map", "an", "image", "to", "this", "dataset", ".", "The", "plane", "defines", "the", "spatial"...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L622-L671
222,711
vtkiorg/vtki
vtki/filters.py
DataSetFilters.warp_by_scalar
def warp_by_scalar(dataset, scalars=None, scale_factor=1.0, normal=None, inplace=False): """ Warp the dataset's points by a point data scalar array's values. This modifies point coordinates by moving points along point normals by the scalar amount times the scale f...
python
def warp_by_scalar(dataset, scalars=None, scale_factor=1.0, normal=None, inplace=False): """ Warp the dataset's points by a point data scalar array's values. This modifies point coordinates by moving points along point normals by the scalar amount times the scale f...
[ "def", "warp_by_scalar", "(", "dataset", ",", "scalars", "=", "None", ",", "scale_factor", "=", "1.0", ",", "normal", "=", "None", ",", "inplace", "=", "False", ")", ":", "if", "scalars", "is", "None", ":", "field", ",", "scalars", "=", "dataset", ".",...
Warp the dataset's points by a point data scalar array's values. This modifies point coordinates by moving points along point normals by the scalar amount times the scale factor. Parameters ---------- scalars : str, optional Name of scalars to warb by. Defaults to cu...
[ "Warp", "the", "dataset", "s", "points", "by", "a", "point", "data", "scalar", "array", "s", "values", ".", "This", "modifies", "point", "coordinates", "by", "moving", "points", "along", "point", "normals", "by", "the", "scalar", "amount", "times", "the", ...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L814-L854
222,712
vtkiorg/vtki
vtki/filters.py
DataSetFilters.delaunay_3d
def delaunay_3d(dataset, alpha=0, tol=0.001, offset=2.5): """Constructs a 3D Delaunay triangulation of the mesh. This helps smooth out a rugged mesh. Parameters ---------- alpha : float, optional Distance value to control output of this filter. For a non-zero ...
python
def delaunay_3d(dataset, alpha=0, tol=0.001, offset=2.5): """Constructs a 3D Delaunay triangulation of the mesh. This helps smooth out a rugged mesh. Parameters ---------- alpha : float, optional Distance value to control output of this filter. For a non-zero ...
[ "def", "delaunay_3d", "(", "dataset", ",", "alpha", "=", "0", ",", "tol", "=", "0.001", ",", "offset", "=", "2.5", ")", ":", "alg", "=", "vtk", ".", "vtkDelaunay3D", "(", ")", "alg", ".", "SetInputData", "(", "dataset", ")", "alg", ".", "SetAlpha", ...
Constructs a 3D Delaunay triangulation of the mesh. This helps smooth out a rugged mesh. Parameters ---------- alpha : float, optional Distance value to control output of this filter. For a non-zero alpha value, only verts, edges, faces, or tetra contained within...
[ "Constructs", "a", "3D", "Delaunay", "triangulation", "of", "the", "mesh", ".", "This", "helps", "smooth", "out", "a", "rugged", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L914-L941
222,713
vtkiorg/vtki
vtki/pointset.py
PolyData._load_file
def _load_file(self, filename): """ Load a surface mesh from a mesh file. Mesh file may be an ASCII or binary ply, stl, or vtk mesh file. Parameters ---------- filename : str Filename of mesh to be loaded. File type is inferred from the extensio...
python
def _load_file(self, filename): """ Load a surface mesh from a mesh file. Mesh file may be an ASCII or binary ply, stl, or vtk mesh file. Parameters ---------- filename : str Filename of mesh to be loaded. File type is inferred from the extensio...
[ "def", "_load_file", "(", "self", ",", "filename", ")", ":", "filename", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "# test if file exists", "if", "not", "os", ".", "path", ".", "isfile...
Load a surface mesh from a mesh file. Mesh file may be an ASCII or binary ply, stl, or vtk mesh file. Parameters ---------- filename : str Filename of mesh to be loaded. File type is inferred from the extension of the filename Notes ----- ...
[ "Load", "a", "surface", "mesh", "from", "a", "mesh", "file", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L110-L156
222,714
vtkiorg/vtki
vtki/pointset.py
PolyData.faces
def faces(self, faces): """ set faces without copying """ if faces.dtype != vtki.ID_TYPE: faces = faces.astype(vtki.ID_TYPE) # get number of faces if faces.ndim == 1: log.debug('efficiency warning') c = 0 nfaces = 0 while c < f...
python
def faces(self, faces): """ set faces without copying """ if faces.dtype != vtki.ID_TYPE: faces = faces.astype(vtki.ID_TYPE) # get number of faces if faces.ndim == 1: log.debug('efficiency warning') c = 0 nfaces = 0 while c < f...
[ "def", "faces", "(", "self", ",", "faces", ")", ":", "if", "faces", ".", "dtype", "!=", "vtki", ".", "ID_TYPE", ":", "faces", "=", "faces", ".", "astype", "(", "vtki", ".", "ID_TYPE", ")", "# get number of faces", "if", "faces", ".", "ndim", "==", "1...
set faces without copying
[ "set", "faces", "without", "copying" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L185-L208
222,715
vtkiorg/vtki
vtki/pointset.py
PolyData._from_arrays
def _from_arrays(self, vertices, faces, deep=True, verts=False): """ Set polygons and points from numpy arrays Parameters ---------- vertices : np.ndarray of dtype=np.float32 or np.float64 Vertex array. 3D points. faces : np.ndarray of dtype=np.int64 ...
python
def _from_arrays(self, vertices, faces, deep=True, verts=False): """ Set polygons and points from numpy arrays Parameters ---------- vertices : np.ndarray of dtype=np.float32 or np.float64 Vertex array. 3D points. faces : np.ndarray of dtype=np.int64 ...
[ "def", "_from_arrays", "(", "self", ",", "vertices", ",", "faces", ",", "deep", "=", "True", ",", "verts", "=", "False", ")", ":", "if", "deep", "or", "verts", ":", "vtkpoints", "=", "vtk", ".", "vtkPoints", "(", ")", "vtkpoints", ".", "SetData", "("...
Set polygons and points from numpy arrays Parameters ---------- vertices : np.ndarray of dtype=np.float32 or np.float64 Vertex array. 3D points. faces : np.ndarray of dtype=np.int64 Face index array. Faces can contain any number of points. Examples ...
[ "Set", "polygons", "and", "points", "from", "numpy", "arrays" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L216-L271
222,716
vtkiorg/vtki
vtki/pointset.py
PolyData.edge_mask
def edge_mask(self, angle): """ Returns a mask of the points of a surface mesh that have a surface angle greater than angle Parameters ---------- angle : float Angle to consider an edge. """ self.point_arrays['point_ind'] = np.arange(self.n_p...
python
def edge_mask(self, angle): """ Returns a mask of the points of a surface mesh that have a surface angle greater than angle Parameters ---------- angle : float Angle to consider an edge. """ self.point_arrays['point_ind'] = np.arange(self.n_p...
[ "def", "edge_mask", "(", "self", ",", "angle", ")", ":", "self", ".", "point_arrays", "[", "'point_ind'", "]", "=", "np", ".", "arange", "(", "self", ".", "n_points", ")", "featureEdges", "=", "vtk", ".", "vtkFeatureEdges", "(", ")", "featureEdges", ".",...
Returns a mask of the points of a surface mesh that have a surface angle greater than angle Parameters ---------- angle : float Angle to consider an edge.
[ "Returns", "a", "mask", "of", "the", "points", "of", "a", "surface", "mesh", "that", "have", "a", "surface", "angle", "greater", "than", "angle" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L273-L297
222,717
vtkiorg/vtki
vtki/pointset.py
PolyData.boolean_cut
def boolean_cut(self, cut, tolerance=1E-5, inplace=False): """ Performs a Boolean cut using another mesh. Parameters ---------- cut : vtki.PolyData Mesh making the cut inplace : bool, optional Updates mesh in-place while returning nothing. ...
python
def boolean_cut(self, cut, tolerance=1E-5, inplace=False): """ Performs a Boolean cut using another mesh. Parameters ---------- cut : vtki.PolyData Mesh making the cut inplace : bool, optional Updates mesh in-place while returning nothing. ...
[ "def", "boolean_cut", "(", "self", ",", "cut", ",", "tolerance", "=", "1E-5", ",", "inplace", "=", "False", ")", ":", "bfilter", "=", "vtk", ".", "vtkBooleanOperationPolyDataFilter", "(", ")", "bfilter", ".", "SetOperationToIntersection", "(", ")", "# bfilter....
Performs a Boolean cut using another mesh. Parameters ---------- cut : vtki.PolyData Mesh making the cut inplace : bool, optional Updates mesh in-place while returning nothing. Returns ------- mesh : vtki.PolyData The cut mes...
[ "Performs", "a", "Boolean", "cut", "using", "another", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L313-L345
222,718
vtkiorg/vtki
vtki/pointset.py
PolyData.boolean_add
def boolean_add(self, mesh, inplace=False): """ Add a mesh to the current mesh. Does not attempt to "join" the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to add. inplace : bool, optional Updates mesh in-place while retur...
python
def boolean_add(self, mesh, inplace=False): """ Add a mesh to the current mesh. Does not attempt to "join" the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to add. inplace : bool, optional Updates mesh in-place while retur...
[ "def", "boolean_add", "(", "self", ",", "mesh", ",", "inplace", "=", "False", ")", ":", "vtkappend", "=", "vtk", ".", "vtkAppendPolyData", "(", ")", "vtkappend", ".", "AddInputData", "(", "self", ")", "vtkappend", ".", "AddInputData", "(", "mesh", ")", "...
Add a mesh to the current mesh. Does not attempt to "join" the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to add. inplace : bool, optional Updates mesh in-place while returning nothing. Returns ------- joinedmes...
[ "Add", "a", "mesh", "to", "the", "current", "mesh", ".", "Does", "not", "attempt", "to", "join", "the", "meshes", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L351-L379
222,719
vtkiorg/vtki
vtki/pointset.py
PolyData.boolean_union
def boolean_union(self, mesh, inplace=False): """ Combines two meshes and attempts to create a manifold mesh. Parameters ---------- mesh : vtki.PolyData The mesh to perform a union against. inplace : bool, optional Updates mesh in-place while ret...
python
def boolean_union(self, mesh, inplace=False): """ Combines two meshes and attempts to create a manifold mesh. Parameters ---------- mesh : vtki.PolyData The mesh to perform a union against. inplace : bool, optional Updates mesh in-place while ret...
[ "def", "boolean_union", "(", "self", ",", "mesh", ",", "inplace", "=", "False", ")", ":", "bfilter", "=", "vtk", ".", "vtkBooleanOperationPolyDataFilter", "(", ")", "bfilter", ".", "SetOperationToUnion", "(", ")", "bfilter", ".", "SetInputData", "(", "1", ",...
Combines two meshes and attempts to create a manifold mesh. Parameters ---------- mesh : vtki.PolyData The mesh to perform a union against. inplace : bool, optional Updates mesh in-place while returning nothing. Returns ------- union : v...
[ "Combines", "two", "meshes", "and", "attempts", "to", "create", "a", "manifold", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L381-L410
222,720
vtkiorg/vtki
vtki/pointset.py
PolyData.boolean_difference
def boolean_difference(self, mesh, inplace=False): """ Combines two meshes and retains only the volume in common between the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to perform a union against. inplace : bool, optional ...
python
def boolean_difference(self, mesh, inplace=False): """ Combines two meshes and retains only the volume in common between the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to perform a union against. inplace : bool, optional ...
[ "def", "boolean_difference", "(", "self", ",", "mesh", ",", "inplace", "=", "False", ")", ":", "bfilter", "=", "vtk", ".", "vtkBooleanOperationPolyDataFilter", "(", ")", "bfilter", ".", "SetOperationToDifference", "(", ")", "bfilter", ".", "SetInputData", "(", ...
Combines two meshes and retains only the volume in common between the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to perform a union against. inplace : bool, optional Updates mesh in-place while returning nothing. Returns ...
[ "Combines", "two", "meshes", "and", "retains", "only", "the", "volume", "in", "common", "between", "the", "meshes", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L412-L442
222,721
vtkiorg/vtki
vtki/pointset.py
PolyData.curvature
def curvature(self, curv_type='mean'): """ Returns the pointwise curvature of a mesh Parameters ---------- mesh : vtk.polydata vtk polydata mesh curvature string, optional One of the following strings Mean Gaussian ...
python
def curvature(self, curv_type='mean'): """ Returns the pointwise curvature of a mesh Parameters ---------- mesh : vtk.polydata vtk polydata mesh curvature string, optional One of the following strings Mean Gaussian ...
[ "def", "curvature", "(", "self", ",", "curv_type", "=", "'mean'", ")", ":", "curv_type", "=", "curv_type", ".", "lower", "(", ")", "# Create curve filter and compute curvature", "curvefilter", "=", "vtk", ".", "vtkCurvatures", "(", ")", "curvefilter", ".", "SetI...
Returns the pointwise curvature of a mesh Parameters ---------- mesh : vtk.polydata vtk polydata mesh curvature string, optional One of the following strings Mean Gaussian Maximum Minimum Returns -...
[ "Returns", "the", "pointwise", "curvature", "of", "a", "mesh" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L444-L486
222,722
vtkiorg/vtki
vtki/pointset.py
PolyData.smooth
def smooth(self, n_iter=20, convergence=0.0, edge_angle=15, feature_angle=45, boundary_smoothing=True, feature_smoothing=False, inplace=False): """Adjust point coordinates using Laplacian smoothing. The effect is to "relax" the mesh, making the cells better shaped and the vertices...
python
def smooth(self, n_iter=20, convergence=0.0, edge_angle=15, feature_angle=45, boundary_smoothing=True, feature_smoothing=False, inplace=False): """Adjust point coordinates using Laplacian smoothing. The effect is to "relax" the mesh, making the cells better shaped and the vertices...
[ "def", "smooth", "(", "self", ",", "n_iter", "=", "20", ",", "convergence", "=", "0.0", ",", "edge_angle", "=", "15", ",", "feature_angle", "=", "45", ",", "boundary_smoothing", "=", "True", ",", "feature_smoothing", "=", "False", ",", "inplace", "=", "F...
Adjust point coordinates using Laplacian smoothing. The effect is to "relax" the mesh, making the cells better shaped and the vertices more evenly distributed. Parameters ---------- n_iter : int Number of iterations for Laplacian smoothing, convergence : flo...
[ "Adjust", "point", "coordinates", "using", "Laplacian", "smoothing", ".", "The", "effect", "is", "to", "relax", "the", "mesh", "making", "the", "cells", "better", "shaped", "and", "the", "vertices", "more", "evenly", "distributed", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L591-L641
222,723
vtkiorg/vtki
vtki/pointset.py
PolyData.decimate_pro
def decimate_pro(self, reduction, feature_angle=45.0, split_angle=75.0, splitting=True, pre_split_mesh=False, preserve_topology=False, inplace=False): """Reduce the number of triangles in a triangular mesh, forming a good approximation to the original geometry. Based on the algorith...
python
def decimate_pro(self, reduction, feature_angle=45.0, split_angle=75.0, splitting=True, pre_split_mesh=False, preserve_topology=False, inplace=False): """Reduce the number of triangles in a triangular mesh, forming a good approximation to the original geometry. Based on the algorith...
[ "def", "decimate_pro", "(", "self", ",", "reduction", ",", "feature_angle", "=", "45.0", ",", "split_angle", "=", "75.0", ",", "splitting", "=", "True", ",", "pre_split_mesh", "=", "False", ",", "preserve_topology", "=", "False", ",", "inplace", "=", "False"...
Reduce the number of triangles in a triangular mesh, forming a good approximation to the original geometry. Based on the algorithm originally described in "Decimation of Triangle Meshes", Proc Siggraph `92. Parameters ---------- reduction : float Reduction factor. A ...
[ "Reduce", "the", "number", "of", "triangles", "in", "a", "triangular", "mesh", "forming", "a", "good", "approximation", "to", "the", "original", "geometry", ".", "Based", "on", "the", "algorithm", "originally", "described", "in", "Decimation", "of", "Triangle", ...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L643-L703
222,724
vtkiorg/vtki
vtki/pointset.py
PolyData.tube
def tube(self, radius=None, scalars=None, capping=True, n_sides=20, radius_factor=10, preference='point', inplace=False): """Generate a tube around each input line. The radius of the tube can be set to linearly vary with a scalar value. Parameters ---------- radius ...
python
def tube(self, radius=None, scalars=None, capping=True, n_sides=20, radius_factor=10, preference='point', inplace=False): """Generate a tube around each input line. The radius of the tube can be set to linearly vary with a scalar value. Parameters ---------- radius ...
[ "def", "tube", "(", "self", ",", "radius", "=", "None", ",", "scalars", "=", "None", ",", "capping", "=", "True", ",", "n_sides", "=", "20", ",", "radius_factor", "=", "10", ",", "preference", "=", "'point'", ",", "inplace", "=", "False", ")", ":", ...
Generate a tube around each input line. The radius of the tube can be set to linearly vary with a scalar value. Parameters ---------- radius : float Minimum tube radius (minimum because the tube radius may vary). scalars : str, optional Scalar array by w...
[ "Generate", "a", "tube", "around", "each", "input", "line", ".", "The", "radius", "of", "the", "tube", "can", "be", "set", "to", "linearly", "vary", "with", "a", "scalar", "value", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L705-L764
222,725
vtkiorg/vtki
vtki/pointset.py
PolyData.subdivide
def subdivide(self, nsub, subfilter='linear', inplace=False): """ Increase the number of triangles in a single, connected triangular mesh. Uses one of the following vtk subdivision filters to subdivide a mesh. vtkButterflySubdivisionFilter vtkLoopSubdivisionFilter ...
python
def subdivide(self, nsub, subfilter='linear', inplace=False): """ Increase the number of triangles in a single, connected triangular mesh. Uses one of the following vtk subdivision filters to subdivide a mesh. vtkButterflySubdivisionFilter vtkLoopSubdivisionFilter ...
[ "def", "subdivide", "(", "self", ",", "nsub", ",", "subfilter", "=", "'linear'", ",", "inplace", "=", "False", ")", ":", "subfilter", "=", "subfilter", ".", "lower", "(", ")", "if", "subfilter", "==", "'linear'", ":", "sfilter", "=", "vtk", ".", "vtkLi...
Increase the number of triangles in a single, connected triangular mesh. Uses one of the following vtk subdivision filters to subdivide a mesh. vtkButterflySubdivisionFilter vtkLoopSubdivisionFilter vtkLinearSubdivisionFilter Linear subdivision results in the fastest me...
[ "Increase", "the", "number", "of", "triangles", "in", "a", "single", "connected", "triangular", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L766-L835
222,726
vtkiorg/vtki
vtki/pointset.py
PolyData.extract_edges
def extract_edges(self, feature_angle=30, boundary_edges=True, non_manifold_edges=True, feature_edges=True, manifold_edges=True, inplace=False): """ Extracts edges from a surface. From vtk documentation, the edges are one of the following 1...
python
def extract_edges(self, feature_angle=30, boundary_edges=True, non_manifold_edges=True, feature_edges=True, manifold_edges=True, inplace=False): """ Extracts edges from a surface. From vtk documentation, the edges are one of the following 1...
[ "def", "extract_edges", "(", "self", ",", "feature_angle", "=", "30", ",", "boundary_edges", "=", "True", ",", "non_manifold_edges", "=", "True", ",", "feature_edges", "=", "True", ",", "manifold_edges", "=", "True", ",", "inplace", "=", "False", ")", ":", ...
Extracts edges from a surface. From vtk documentation, the edges are one of the following 1) boundary (used by one polygon) or a line cell 2) non-manifold (used by three or more polygons) 3) feature edges (edges used by two triangles and whose dihedral angle ...
[ "Extracts", "edges", "from", "a", "surface", ".", "From", "vtk", "documentation", "the", "edges", "are", "one", "of", "the", "following" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L837-L890
222,727
vtkiorg/vtki
vtki/pointset.py
PolyData.decimate
def decimate(self, target_reduction, volume_preservation=False, attribute_error=False, scalars=True, vectors=True, normals=False, tcoords=True, tensors=True, scalars_weight=0.1, vectors_weight=0.1, normals_weight=0.1, tcoords_weight=0.1, tensors_weight...
python
def decimate(self, target_reduction, volume_preservation=False, attribute_error=False, scalars=True, vectors=True, normals=False, tcoords=True, tensors=True, scalars_weight=0.1, vectors_weight=0.1, normals_weight=0.1, tcoords_weight=0.1, tensors_weight...
[ "def", "decimate", "(", "self", ",", "target_reduction", ",", "volume_preservation", "=", "False", ",", "attribute_error", "=", "False", ",", "scalars", "=", "True", ",", "vectors", "=", "True", ",", "normals", "=", "False", ",", "tcoords", "=", "True", ",...
Reduces the number of triangles in a triangular mesh using vtkQuadricDecimation. Parameters ---------- mesh : vtk.PolyData Mesh to decimate target_reduction : float Fraction of the original mesh to remove. TargetReduction is set to 0.9, this ...
[ "Reduces", "the", "number", "of", "triangles", "in", "a", "triangular", "mesh", "using", "vtkQuadricDecimation", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L892-L991
222,728
vtkiorg/vtki
vtki/pointset.py
PolyData.center_of_mass
def center_of_mass(self, scalars_weight=False): """ Returns the coordinates for the center of mass of the mesh. Parameters ---------- scalars_weight : bool, optional Flag for using the mesh scalars as weights. Defaults to False. Return ------ ...
python
def center_of_mass(self, scalars_weight=False): """ Returns the coordinates for the center of mass of the mesh. Parameters ---------- scalars_weight : bool, optional Flag for using the mesh scalars as weights. Defaults to False. Return ------ ...
[ "def", "center_of_mass", "(", "self", ",", "scalars_weight", "=", "False", ")", ":", "comfilter", "=", "vtk", ".", "vtkCenterOfMass", "(", ")", "comfilter", ".", "SetInputData", "(", "self", ")", "comfilter", ".", "SetUseScalarsAsWeights", "(", "scalars_weight",...
Returns the coordinates for the center of mass of the mesh. Parameters ---------- scalars_weight : bool, optional Flag for using the mesh scalars as weights. Defaults to False. Return ------ center : np.ndarray, float Coordinates for the center o...
[ "Returns", "the", "coordinates", "for", "the", "center", "of", "mass", "of", "the", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L993-L1011
222,729
vtkiorg/vtki
vtki/pointset.py
PolyData.clip_with_plane
def clip_with_plane(self, origin, normal, value=0, inplace=False): """ Clip a vtki.PolyData or vtk.vtkPolyData with a plane. Can be used to open a mesh which has been closed along a well-defined plane. Parameters ---------- origin : numpy.ndarray 3D ...
python
def clip_with_plane(self, origin, normal, value=0, inplace=False): """ Clip a vtki.PolyData or vtk.vtkPolyData with a plane. Can be used to open a mesh which has been closed along a well-defined plane. Parameters ---------- origin : numpy.ndarray 3D ...
[ "def", "clip_with_plane", "(", "self", ",", "origin", ",", "normal", ",", "value", "=", "0", ",", "inplace", "=", "False", ")", ":", "plane", "=", "vtk", ".", "vtkPlane", "(", ")", "plane", ".", "SetOrigin", "(", "origin", ")", "plane", ".", "SetNorm...
Clip a vtki.PolyData or vtk.vtkPolyData with a plane. Can be used to open a mesh which has been closed along a well-defined plane. Parameters ---------- origin : numpy.ndarray 3D point through which plane passes. Defines the plane together with normal pa...
[ "Clip", "a", "vtki", ".", "PolyData", "or", "vtk", ".", "vtkPolyData", "with", "a", "plane", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1131-L1181
222,730
vtkiorg/vtki
vtki/pointset.py
PolyData.extract_largest
def extract_largest(self, inplace=False): """ Extract largest connected set in mesh. Can be used to reduce residues obtained when generating an isosurface. Works only if residues are not connected (share at least one point with) the main component of the image. Paramete...
python
def extract_largest(self, inplace=False): """ Extract largest connected set in mesh. Can be used to reduce residues obtained when generating an isosurface. Works only if residues are not connected (share at least one point with) the main component of the image. Paramete...
[ "def", "extract_largest", "(", "self", ",", "inplace", "=", "False", ")", ":", "mesh", "=", "self", ".", "connectivity", "(", "largest", "=", "True", ")", "if", "inplace", ":", "self", ".", "overwrite", "(", "mesh", ")", "else", ":", "return", "mesh" ]
Extract largest connected set in mesh. Can be used to reduce residues obtained when generating an isosurface. Works only if residues are not connected (share at least one point with) the main component of the image. Parameters ---------- inplace : bool, optional ...
[ "Extract", "largest", "connected", "set", "in", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1183-L1206
222,731
vtkiorg/vtki
vtki/pointset.py
PolyData.fill_holes
def fill_holes(self, hole_size, inplace=False): # pragma: no cover """ Fill holes in a vtki.PolyData or vtk.vtkPolyData object. Holes are identified by locating boundary edges, linking them together into loops, and then triangulating the resulting loops. Note that you can speci...
python
def fill_holes(self, hole_size, inplace=False): # pragma: no cover """ Fill holes in a vtki.PolyData or vtk.vtkPolyData object. Holes are identified by locating boundary edges, linking them together into loops, and then triangulating the resulting loops. Note that you can speci...
[ "def", "fill_holes", "(", "self", ",", "hole_size", ",", "inplace", "=", "False", ")", ":", "# pragma: no cover", "logging", ".", "warning", "(", "'vtki.pointset.PolyData.fill_holes is known to segfault. '", "+", "'Use at your own risk'", ")", "fill", "=", "vtk", ".",...
Fill holes in a vtki.PolyData or vtk.vtkPolyData object. Holes are identified by locating boundary edges, linking them together into loops, and then triangulating the resulting loops. Note that you can specify an approximate limit to the size of the hole that can be filled. Par...
[ "Fill", "holes", "in", "a", "vtki", ".", "PolyData", "or", "vtk", ".", "vtkPolyData", "object", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1210-L1247
222,732
vtkiorg/vtki
vtki/pointset.py
PolyData.area
def area(self): """ Mesh surface area Returns ------- area : float Total area of the mesh. """ mprop = vtk.vtkMassProperties() mprop.SetInputData(self) return mprop.GetSurfaceArea()
python
def area(self): """ Mesh surface area Returns ------- area : float Total area of the mesh. """ mprop = vtk.vtkMassProperties() mprop.SetInputData(self) return mprop.GetSurfaceArea()
[ "def", "area", "(", "self", ")", ":", "mprop", "=", "vtk", ".", "vtkMassProperties", "(", ")", "mprop", ".", "SetInputData", "(", "self", ")", "return", "mprop", ".", "GetSurfaceArea", "(", ")" ]
Mesh surface area Returns ------- area : float Total area of the mesh.
[ "Mesh", "surface", "area" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1305-L1317
222,733
vtkiorg/vtki
vtki/pointset.py
PolyData.geodesic
def geodesic(self, start_vertex, end_vertex, inplace=False): """ Calculates the geodesic path betweeen two vertices using Dijkstra's algorithm. Parameters ---------- start_vertex : int Vertex index indicating the start point of the geodesic segment. ...
python
def geodesic(self, start_vertex, end_vertex, inplace=False): """ Calculates the geodesic path betweeen two vertices using Dijkstra's algorithm. Parameters ---------- start_vertex : int Vertex index indicating the start point of the geodesic segment. ...
[ "def", "geodesic", "(", "self", ",", "start_vertex", ",", "end_vertex", ",", "inplace", "=", "False", ")", ":", "if", "start_vertex", "<", "0", "or", "end_vertex", ">", "self", ".", "n_points", "-", "1", ":", "raise", "IndexError", "(", "'Invalid indices.'...
Calculates the geodesic path betweeen two vertices using Dijkstra's algorithm. Parameters ---------- start_vertex : int Vertex index indicating the start point of the geodesic segment. end_vertex : int Vertex index indicating the end point of the geodesi...
[ "Calculates", "the", "geodesic", "path", "betweeen", "two", "vertices", "using", "Dijkstra", "s", "algorithm", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1350-L1384
222,734
vtkiorg/vtki
vtki/pointset.py
PolyData.geodesic_distance
def geodesic_distance(self, start_vertex, end_vertex): """ Calculates the geodesic distance betweeen two vertices using Dijkstra's algorithm. Parameters ---------- start_vertex : int Vertex index indicating the start point of the geodesic segment. en...
python
def geodesic_distance(self, start_vertex, end_vertex): """ Calculates the geodesic distance betweeen two vertices using Dijkstra's algorithm. Parameters ---------- start_vertex : int Vertex index indicating the start point of the geodesic segment. en...
[ "def", "geodesic_distance", "(", "self", ",", "start_vertex", ",", "end_vertex", ")", ":", "length", "=", "self", ".", "geodesic", "(", "start_vertex", ",", "end_vertex", ")", ".", "GetLength", "(", ")", "return", "length" ]
Calculates the geodesic distance betweeen two vertices using Dijkstra's algorithm. Parameters ---------- start_vertex : int Vertex index indicating the start point of the geodesic segment. end_vertex : int Vertex index indicating the end point of the geo...
[ "Calculates", "the", "geodesic", "distance", "betweeen", "two", "vertices", "using", "Dijkstra", "s", "algorithm", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1387-L1407
222,735
vtkiorg/vtki
vtki/pointset.py
PolyData.ray_trace
def ray_trace(self, origin, end_point, first_point=False, plot=False, off_screen=False): """ Performs a single ray trace calculation given a mesh and a line segment defined by an origin and end_point. Parameters ---------- origin : np.ndarray or list ...
python
def ray_trace(self, origin, end_point, first_point=False, plot=False, off_screen=False): """ Performs a single ray trace calculation given a mesh and a line segment defined by an origin and end_point. Parameters ---------- origin : np.ndarray or list ...
[ "def", "ray_trace", "(", "self", ",", "origin", ",", "end_point", ",", "first_point", "=", "False", ",", "plot", "=", "False", ",", "off_screen", "=", "False", ")", ":", "points", "=", "vtk", ".", "vtkPoints", "(", ")", "cell_ids", "=", "vtk", ".", "...
Performs a single ray trace calculation given a mesh and a line segment defined by an origin and end_point. Parameters ---------- origin : np.ndarray or list Start of the line segment. end_point : np.ndarray or list End of the line segment. firs...
[ "Performs", "a", "single", "ray", "trace", "calculation", "given", "a", "mesh", "and", "a", "line", "segment", "defined", "by", "an", "origin", "and", "end_point", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1409-L1474
222,736
vtkiorg/vtki
vtki/pointset.py
PolyData.plot_boundaries
def plot_boundaries(self, **kwargs): """ Plots boundaries of a mesh """ edges = self.extract_edges() plotter = vtki.Plotter(off_screen=kwargs.pop('off_screen', False), notebook=kwargs.pop('notebook', None)) plotter.add_mesh(edges, 'r', style='wireframe', l...
python
def plot_boundaries(self, **kwargs): """ Plots boundaries of a mesh """ edges = self.extract_edges() plotter = vtki.Plotter(off_screen=kwargs.pop('off_screen', False), notebook=kwargs.pop('notebook', None)) plotter.add_mesh(edges, 'r', style='wireframe', l...
[ "def", "plot_boundaries", "(", "self", ",", "*", "*", "kwargs", ")", ":", "edges", "=", "self", ".", "extract_edges", "(", ")", "plotter", "=", "vtki", ".", "Plotter", "(", "off_screen", "=", "kwargs", ".", "pop", "(", "'off_screen'", ",", "False", ")"...
Plots boundaries of a mesh
[ "Plots", "boundaries", "of", "a", "mesh" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1476-L1484
222,737
vtkiorg/vtki
vtki/pointset.py
PolyData.plot_normals
def plot_normals(self, show_mesh=True, mag=1.0, flip=False, use_every=1, **kwargs): """ Plot the point normals of a mesh. """ plotter = vtki.Plotter(off_screen=kwargs.pop('off_screen', False), notebook=kwargs.pop('notebook', None)) ...
python
def plot_normals(self, show_mesh=True, mag=1.0, flip=False, use_every=1, **kwargs): """ Plot the point normals of a mesh. """ plotter = vtki.Plotter(off_screen=kwargs.pop('off_screen', False), notebook=kwargs.pop('notebook', None)) ...
[ "def", "plot_normals", "(", "self", ",", "show_mesh", "=", "True", ",", "mag", "=", "1.0", ",", "flip", "=", "False", ",", "use_every", "=", "1", ",", "*", "*", "kwargs", ")", ":", "plotter", "=", "vtki", ".", "Plotter", "(", "off_screen", "=", "kw...
Plot the point normals of a mesh.
[ "Plot", "the", "point", "normals", "of", "a", "mesh", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1486-L1501
222,738
vtkiorg/vtki
vtki/pointset.py
PolyData.remove_points
def remove_points(self, remove, mode='any', keep_scalars=True, inplace=False): """ Rebuild a mesh by removing points. Only valid for all-triangle meshes. Parameters ---------- remove : np.ndarray If remove is a bool array, points that are True will be ...
python
def remove_points(self, remove, mode='any', keep_scalars=True, inplace=False): """ Rebuild a mesh by removing points. Only valid for all-triangle meshes. Parameters ---------- remove : np.ndarray If remove is a bool array, points that are True will be ...
[ "def", "remove_points", "(", "self", ",", "remove", ",", "mode", "=", "'any'", ",", "keep_scalars", "=", "True", ",", "inplace", "=", "False", ")", ":", "if", "isinstance", "(", "remove", ",", "list", ")", ":", "remove", "=", "np", ".", "asarray", "(...
Rebuild a mesh by removing points. Only valid for all-triangle meshes. Parameters ---------- remove : np.ndarray If remove is a bool array, points that are True will be removed. Otherwise, it is treated as a list of indices. mode : str, optional ...
[ "Rebuild", "a", "mesh", "by", "removing", "points", ".", "Only", "valid", "for", "all", "-", "triangle", "meshes", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1503-L1586
222,739
vtkiorg/vtki
vtki/pointset.py
PolyData.flip_normals
def flip_normals(self): """ Flip normals of a triangular mesh by reversing the point ordering. """ if self.faces.size % 4: raise Exception('Can only flip normals on an all triangular mesh') f = self.faces.reshape((-1, 4)) f[:, 1:] = f[:, 1:][:, ::-1]
python
def flip_normals(self): """ Flip normals of a triangular mesh by reversing the point ordering. """ if self.faces.size % 4: raise Exception('Can only flip normals on an all triangular mesh') f = self.faces.reshape((-1, 4)) f[:, 1:] = f[:, 1:][:, ::-1]
[ "def", "flip_normals", "(", "self", ")", ":", "if", "self", ".", "faces", ".", "size", "%", "4", ":", "raise", "Exception", "(", "'Can only flip normals on an all triangular mesh'", ")", "f", "=", "self", ".", "faces", ".", "reshape", "(", "(", "-", "1", ...
Flip normals of a triangular mesh by reversing the point ordering.
[ "Flip", "normals", "of", "a", "triangular", "mesh", "by", "reversing", "the", "point", "ordering", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1588-L1597
222,740
vtkiorg/vtki
vtki/pointset.py
PolyData.delaunay_2d
def delaunay_2d(self, tol=1e-05, alpha=0.0, offset=1.0, bound=False, inplace=False): """Apply a delaunay 2D filter along the best fitting plane""" alg = vtk.vtkDelaunay2D() alg.SetProjectionPlaneMode(vtk.VTK_BEST_FITTING_PLANE) alg.SetInputDataObject(self) alg.SetTolerance(tol) ...
python
def delaunay_2d(self, tol=1e-05, alpha=0.0, offset=1.0, bound=False, inplace=False): """Apply a delaunay 2D filter along the best fitting plane""" alg = vtk.vtkDelaunay2D() alg.SetProjectionPlaneMode(vtk.VTK_BEST_FITTING_PLANE) alg.SetInputDataObject(self) alg.SetTolerance(tol) ...
[ "def", "delaunay_2d", "(", "self", ",", "tol", "=", "1e-05", ",", "alpha", "=", "0.0", ",", "offset", "=", "1.0", ",", "bound", "=", "False", ",", "inplace", "=", "False", ")", ":", "alg", "=", "vtk", ".", "vtkDelaunay2D", "(", ")", "alg", ".", "...
Apply a delaunay 2D filter along the best fitting plane
[ "Apply", "a", "delaunay", "2D", "filter", "along", "the", "best", "fitting", "plane" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1599-L1614
222,741
vtkiorg/vtki
vtki/pointset.py
PointGrid.plot_curvature
def plot_curvature(self, curv_type='mean', **kwargs): """ Plots the curvature of the external surface of the grid Parameters ---------- curv_type : str, optional One of the following strings indicating curvature types - mean - gaussian ...
python
def plot_curvature(self, curv_type='mean', **kwargs): """ Plots the curvature of the external surface of the grid Parameters ---------- curv_type : str, optional One of the following strings indicating curvature types - mean - gaussian ...
[ "def", "plot_curvature", "(", "self", ",", "curv_type", "=", "'mean'", ",", "*", "*", "kwargs", ")", ":", "trisurf", "=", "self", ".", "extract_surface", "(", ")", ".", "tri_filter", "(", ")", "return", "trisurf", ".", "plot_curvature", "(", "curv_type", ...
Plots the curvature of the external surface of the grid Parameters ---------- curv_type : str, optional One of the following strings indicating curvature types - mean - gaussian - maximum - minimum **kwargs : optional ...
[ "Plots", "the", "curvature", "of", "the", "external", "surface", "of", "the", "grid" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1633-L1658
222,742
vtkiorg/vtki
vtki/pointset.py
PointGrid.extract_surface
def extract_surface(self, pass_pointid=True, pass_cellid=True, inplace=False): """ Extract surface mesh of the grid Parameters ---------- pass_pointid : bool, optional Adds a point scalar "vtkOriginalPointIds" that idenfities which original points these s...
python
def extract_surface(self, pass_pointid=True, pass_cellid=True, inplace=False): """ Extract surface mesh of the grid Parameters ---------- pass_pointid : bool, optional Adds a point scalar "vtkOriginalPointIds" that idenfities which original points these s...
[ "def", "extract_surface", "(", "self", ",", "pass_pointid", "=", "True", ",", "pass_cellid", "=", "True", ",", "inplace", "=", "False", ")", ":", "surf_filter", "=", "vtk", ".", "vtkDataSetSurfaceFilter", "(", ")", "surf_filter", ".", "SetInputData", "(", "s...
Extract surface mesh of the grid Parameters ---------- pass_pointid : bool, optional Adds a point scalar "vtkOriginalPointIds" that idenfities which original points these surface points correspond to pass_cellid : bool, optional Adds a cell scalar "v...
[ "Extract", "surface", "mesh", "of", "the", "grid" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1669-L1703
222,743
vtkiorg/vtki
vtki/pointset.py
UnstructuredGrid._from_arrays
def _from_arrays(self, offset, cells, cell_type, points, deep=True): """ Create VTK unstructured grid from numpy arrays Parameters ---------- offset : np.ndarray dtype=np.int64 Array indicating the start location of each cell in the cells array. ...
python
def _from_arrays(self, offset, cells, cell_type, points, deep=True): """ Create VTK unstructured grid from numpy arrays Parameters ---------- offset : np.ndarray dtype=np.int64 Array indicating the start location of each cell in the cells array. ...
[ "def", "_from_arrays", "(", "self", ",", "offset", ",", "cells", ",", "cell_type", ",", "points", ",", "deep", "=", "True", ")", ":", "if", "offset", ".", "dtype", "!=", "vtki", ".", "ID_TYPE", ":", "offset", "=", "offset", ".", "astype", "(", "vtki"...
Create VTK unstructured grid from numpy arrays Parameters ---------- offset : np.ndarray dtype=np.int64 Array indicating the start location of each cell in the cells array. cells : np.ndarray dtype=np.int64 Array of cells. Each cell contains the num...
[ "Create", "VTK", "unstructured", "grid", "from", "numpy", "arrays" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1839-L1923
222,744
vtkiorg/vtki
vtki/pointset.py
UnstructuredGrid._load_file
def _load_file(self, filename): """ Load an unstructured grid from a file. The file extension will select the type of reader to use. A .vtk extension will use the legacy reader, while .vtu will select the VTK XML reader. Parameters ---------- filename :...
python
def _load_file(self, filename): """ Load an unstructured grid from a file. The file extension will select the type of reader to use. A .vtk extension will use the legacy reader, while .vtu will select the VTK XML reader. Parameters ---------- filename :...
[ "def", "_load_file", "(", "self", ",", "filename", ")", ":", "filename", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "# check file exists", "if", "not", "os", ".", "path", ".", "isfile",...
Load an unstructured grid from a file. The file extension will select the type of reader to use. A .vtk extension will use the legacy reader, while .vtu will select the VTK XML reader. Parameters ---------- filename : str Filename of grid to be loaded.
[ "Load", "an", "unstructured", "grid", "from", "a", "file", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L1925-L1955
222,745
vtkiorg/vtki
vtki/pointset.py
UnstructuredGrid.linear_copy
def linear_copy(self, deep=False): """ Returns a copy of the input unstructured grid containing only linear cells. Converts the following cell types to their linear equivalents. - VTK_QUADRATIC_TETRA --> VTK_TETRA - VTK_QUADRATIC_PYRAMID --> VTK_PYRAMID ...
python
def linear_copy(self, deep=False): """ Returns a copy of the input unstructured grid containing only linear cells. Converts the following cell types to their linear equivalents. - VTK_QUADRATIC_TETRA --> VTK_TETRA - VTK_QUADRATIC_PYRAMID --> VTK_PYRAMID ...
[ "def", "linear_copy", "(", "self", ",", "deep", "=", "False", ")", ":", "lgrid", "=", "self", ".", "copy", "(", "deep", ")", "# grab the vtk object", "vtk_cell_type", "=", "numpy_to_vtk", "(", "self", ".", "GetCellTypesArray", "(", ")", ",", "deep", "=", ...
Returns a copy of the input unstructured grid containing only linear cells. Converts the following cell types to their linear equivalents. - VTK_QUADRATIC_TETRA --> VTK_TETRA - VTK_QUADRATIC_PYRAMID --> VTK_PYRAMID - VTK_QUADRATIC_WEDGE --> VTK_WEDGE - VTK_...
[ "Returns", "a", "copy", "of", "the", "input", "unstructured", "grid", "containing", "only", "linear", "cells", ".", "Converts", "the", "following", "cell", "types", "to", "their", "linear", "equivalents", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2015-L2075
222,746
vtkiorg/vtki
vtki/pointset.py
UnstructuredGrid.extract_cells
def extract_cells(self, ind): """ Returns a subset of the grid Parameters ---------- ind : np.ndarray Numpy array of cell indices to be extracted. Returns ------- subgrid : vtki.UnstructuredGrid Subselected grid """ ...
python
def extract_cells(self, ind): """ Returns a subset of the grid Parameters ---------- ind : np.ndarray Numpy array of cell indices to be extracted. Returns ------- subgrid : vtki.UnstructuredGrid Subselected grid """ ...
[ "def", "extract_cells", "(", "self", ",", "ind", ")", ":", "if", "not", "isinstance", "(", "ind", ",", "np", ".", "ndarray", ")", ":", "ind", "=", "np", ".", "array", "(", "ind", ",", "np", ".", "ndarray", ")", "if", "ind", ".", "dtype", "==", ...
Returns a subset of the grid Parameters ---------- ind : np.ndarray Numpy array of cell indices to be extracted. Returns ------- subgrid : vtki.UnstructuredGrid Subselected grid
[ "Returns", "a", "subset", "of", "the", "grid" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2087-L2137
222,747
vtkiorg/vtki
vtki/pointset.py
UnstructuredGrid.merge
def merge(self, grid=None, merge_points=True, inplace=False, main_has_priority=True): """ Join one or many other grids to this grid. Grid is updated in-place by default. Can be used to merge points of adjcent cells when no grids are input. Parameters ...
python
def merge(self, grid=None, merge_points=True, inplace=False, main_has_priority=True): """ Join one or many other grids to this grid. Grid is updated in-place by default. Can be used to merge points of adjcent cells when no grids are input. Parameters ...
[ "def", "merge", "(", "self", ",", "grid", "=", "None", ",", "merge_points", "=", "True", ",", "inplace", "=", "False", ",", "main_has_priority", "=", "True", ")", ":", "append_filter", "=", "vtk", ".", "vtkAppendFilter", "(", ")", "append_filter", ".", "...
Join one or many other grids to this grid. Grid is updated in-place by default. Can be used to merge points of adjcent cells when no grids are input. Parameters ---------- grid : vtk.UnstructuredGrid or list of vtk.UnstructuredGrids Grids to merge to this g...
[ "Join", "one", "or", "many", "other", "grids", "to", "this", "grid", ".", "Grid", "is", "updated", "in", "-", "place", "by", "default", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2175-L2233
222,748
vtkiorg/vtki
vtki/pointset.py
UnstructuredGrid.delaunay_2d
def delaunay_2d(self, tol=1e-05, alpha=0.0, offset=1.0, bound=False): """Apply a delaunay 2D filter along the best fitting plane. This extracts the grid's points and perfoms the triangulation on those alone. """ return PolyData(self.points).delaunay_2d(tol=tol, alpha=alpha, offset=offset...
python
def delaunay_2d(self, tol=1e-05, alpha=0.0, offset=1.0, bound=False): """Apply a delaunay 2D filter along the best fitting plane. This extracts the grid's points and perfoms the triangulation on those alone. """ return PolyData(self.points).delaunay_2d(tol=tol, alpha=alpha, offset=offset...
[ "def", "delaunay_2d", "(", "self", ",", "tol", "=", "1e-05", ",", "alpha", "=", "0.0", ",", "offset", "=", "1.0", ",", "bound", "=", "False", ")", ":", "return", "PolyData", "(", "self", ".", "points", ")", ".", "delaunay_2d", "(", "tol", "=", "tol...
Apply a delaunay 2D filter along the best fitting plane. This extracts the grid's points and perfoms the triangulation on those alone.
[ "Apply", "a", "delaunay", "2D", "filter", "along", "the", "best", "fitting", "plane", ".", "This", "extracts", "the", "grid", "s", "points", "and", "perfoms", "the", "triangulation", "on", "those", "alone", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2235-L2239
222,749
vtkiorg/vtki
vtki/pointset.py
StructuredGrid._from_arrays
def _from_arrays(self, x, y, z): """ Create VTK structured grid directly from numpy arrays. Parameters ---------- x : np.ndarray Position of the points in x direction. y : np.ndarray Position of the points in y direction. z : np.ndarray ...
python
def _from_arrays(self, x, y, z): """ Create VTK structured grid directly from numpy arrays. Parameters ---------- x : np.ndarray Position of the points in x direction. y : np.ndarray Position of the points in y direction. z : np.ndarray ...
[ "def", "_from_arrays", "(", "self", ",", "x", ",", "y", ",", "z", ")", ":", "if", "not", "(", "x", ".", "shape", "==", "y", ".", "shape", "==", "z", ".", "shape", ")", ":", "raise", "Exception", "(", "'Input point array shapes must match exactly'", ")"...
Create VTK structured grid directly from numpy arrays. Parameters ---------- x : np.ndarray Position of the points in x direction. y : np.ndarray Position of the points in y direction. z : np.ndarray Position of the points in z direction.
[ "Create", "VTK", "structured", "grid", "directly", "from", "numpy", "arrays", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2303-L2334
222,750
vtkiorg/vtki
vtki/pointset.py
StructuredGrid.save
def save(self, filename, binary=True): """ Writes a structured grid to disk. Parameters ---------- filename : str Filename of grid to be written. The file extension will select the type of writer to use. ".vtk" will use the legacy writer, while ...
python
def save(self, filename, binary=True): """ Writes a structured grid to disk. Parameters ---------- filename : str Filename of grid to be written. The file extension will select the type of writer to use. ".vtk" will use the legacy writer, while ...
[ "def", "save", "(", "self", ",", "filename", ",", "binary", "=", "True", ")", ":", "filename", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "# Use legacy writer if vtk is in filename", "if", ...
Writes a structured grid to disk. Parameters ---------- filename : str Filename of grid to be written. The file extension will select the type of writer to use. ".vtk" will use the legacy writer, while ".vts" will select the VTK XML writer. binary ...
[ "Writes", "a", "structured", "grid", "to", "disk", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2376-L2418
222,751
vtkiorg/vtki
vtki/pointset.py
StructuredGrid.dimensions
def dimensions(self, dims): """Sets the dataset dimensions. Pass a length three tuple of integers""" nx, ny, nz = dims[0], dims[1], dims[2] self.SetDimensions(nx, ny, nz) self.Modified()
python
def dimensions(self, dims): """Sets the dataset dimensions. Pass a length three tuple of integers""" nx, ny, nz = dims[0], dims[1], dims[2] self.SetDimensions(nx, ny, nz) self.Modified()
[ "def", "dimensions", "(", "self", ",", "dims", ")", ":", "nx", ",", "ny", ",", "nz", "=", "dims", "[", "0", "]", ",", "dims", "[", "1", "]", ",", "dims", "[", "2", "]", "self", ".", "SetDimensions", "(", "nx", ",", "ny", ",", "nz", ")", "se...
Sets the dataset dimensions. Pass a length three tuple of integers
[ "Sets", "the", "dataset", "dimensions", ".", "Pass", "a", "length", "three", "tuple", "of", "integers" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/pointset.py#L2426-L2430
222,752
vtkiorg/vtki
vtki/grid.py
RectilinearGrid._from_arrays
def _from_arrays(self, x, y, z): """ Create VTK rectilinear grid directly from numpy arrays. Each array gives the uniques coordinates of the mesh along each axial direction. To help ensure you are using this correctly, we take the unique values of each argument. Paramete...
python
def _from_arrays(self, x, y, z): """ Create VTK rectilinear grid directly from numpy arrays. Each array gives the uniques coordinates of the mesh along each axial direction. To help ensure you are using this correctly, we take the unique values of each argument. Paramete...
[ "def", "_from_arrays", "(", "self", ",", "x", ",", "y", ",", "z", ")", ":", "x", "=", "np", ".", "unique", "(", "x", ".", "ravel", "(", ")", ")", "y", "=", "np", ".", "unique", "(", "y", ".", "ravel", "(", ")", ")", "z", "=", "np", ".", ...
Create VTK rectilinear grid directly from numpy arrays. Each array gives the uniques coordinates of the mesh along each axial direction. To help ensure you are using this correctly, we take the unique values of each argument. Parameters ---------- x : np.ndarray ...
[ "Create", "VTK", "rectilinear", "grid", "directly", "from", "numpy", "arrays", ".", "Each", "array", "gives", "the", "uniques", "coordinates", "of", "the", "mesh", "along", "each", "axial", "direction", ".", "To", "help", "ensure", "you", "are", "using", "th...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/grid.py#L108-L133
222,753
vtkiorg/vtki
vtki/grid.py
RectilinearGrid._load_file
def _load_file(self, filename): """ Load a rectilinear grid from a file. The file extension will select the type of reader to use. A .vtk extension will use the legacy reader, while .vtr will select the VTK XML reader. Parameters ---------- filename : s...
python
def _load_file(self, filename): """ Load a rectilinear grid from a file. The file extension will select the type of reader to use. A .vtk extension will use the legacy reader, while .vtr will select the VTK XML reader. Parameters ---------- filename : s...
[ "def", "_load_file", "(", "self", ",", "filename", ")", ":", "filename", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "# check file exists", "if", "not", "os", ".", "path", ".", "isfile",...
Load a rectilinear grid from a file. The file extension will select the type of reader to use. A .vtk extension will use the legacy reader, while .vtr will select the VTK XML reader. Parameters ---------- filename : str Filename of grid to be loaded.
[ "Load", "a", "rectilinear", "grid", "from", "a", "file", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/grid.py#L160-L198
222,754
vtkiorg/vtki
vtki/grid.py
RectilinearGrid.save
def save(self, filename, binary=True): """ Writes a rectilinear grid to disk. Parameters ---------- filename : str Filename of grid to be written. The file extension will select the type of writer to use. ".vtk" will use the legacy writer, while ...
python
def save(self, filename, binary=True): """ Writes a rectilinear grid to disk. Parameters ---------- filename : str Filename of grid to be written. The file extension will select the type of writer to use. ".vtk" will use the legacy writer, while ...
[ "def", "save", "(", "self", ",", "filename", ",", "binary", "=", "True", ")", ":", "filename", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "# Use legacy writer if vtk is in filename", "if", ...
Writes a rectilinear grid to disk. Parameters ---------- filename : str Filename of grid to be written. The file extension will select the type of writer to use. ".vtk" will use the legacy writer, while ".vtr" will select the VTK XML writer. binary...
[ "Writes", "a", "rectilinear", "grid", "to", "disk", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/grid.py#L200-L238
222,755
vtkiorg/vtki
vtki/grid.py
UniformGrid.origin
def origin(self, origin): """Set the origin. Pass a length three tuple of floats""" ox, oy, oz = origin[0], origin[1], origin[2] self.SetOrigin(ox, oy, oz) self.Modified()
python
def origin(self, origin): """Set the origin. Pass a length three tuple of floats""" ox, oy, oz = origin[0], origin[1], origin[2] self.SetOrigin(ox, oy, oz) self.Modified()
[ "def", "origin", "(", "self", ",", "origin", ")", ":", "ox", ",", "oy", ",", "oz", "=", "origin", "[", "0", "]", ",", "origin", "[", "1", "]", ",", "origin", "[", "2", "]", "self", ".", "SetOrigin", "(", "ox", ",", "oy", ",", "oz", ")", "se...
Set the origin. Pass a length three tuple of floats
[ "Set", "the", "origin", ".", "Pass", "a", "length", "three", "tuple", "of", "floats" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/grid.py#L533-L537
222,756
vtkiorg/vtki
vtki/grid.py
UniformGrid.spacing
def spacing(self, spacing): """Set the spacing in each axial direction. Pass a length three tuple of floats""" dx, dy, dz = spacing[0], spacing[1], spacing[2] self.SetSpacing(dx, dy, dz) self.Modified()
python
def spacing(self, spacing): """Set the spacing in each axial direction. Pass a length three tuple of floats""" dx, dy, dz = spacing[0], spacing[1], spacing[2] self.SetSpacing(dx, dy, dz) self.Modified()
[ "def", "spacing", "(", "self", ",", "spacing", ")", ":", "dx", ",", "dy", ",", "dz", "=", "spacing", "[", "0", "]", ",", "spacing", "[", "1", "]", ",", "spacing", "[", "2", "]", "self", ".", "SetSpacing", "(", "dx", ",", "dy", ",", "dz", ")",...
Set the spacing in each axial direction. Pass a length three tuple of floats
[ "Set", "the", "spacing", "in", "each", "axial", "direction", ".", "Pass", "a", "length", "three", "tuple", "of", "floats" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/grid.py#L545-L550
222,757
vtkiorg/vtki
vtki/qt_plotting.py
resample_image
def resample_image(arr, max_size=400): """Resamples a square image to an image of max_size""" dim = np.max(arr.shape[0:2]) if dim < max_size: max_size = dim x, y, _ = arr.shape sx = int(np.ceil(x / max_size)) sy = int(np.ceil(y / max_size)) img = np.zeros((max_size, max_size, 3), dty...
python
def resample_image(arr, max_size=400): """Resamples a square image to an image of max_size""" dim = np.max(arr.shape[0:2]) if dim < max_size: max_size = dim x, y, _ = arr.shape sx = int(np.ceil(x / max_size)) sy = int(np.ceil(y / max_size)) img = np.zeros((max_size, max_size, 3), dty...
[ "def", "resample_image", "(", "arr", ",", "max_size", "=", "400", ")", ":", "dim", "=", "np", ".", "max", "(", "arr", ".", "shape", "[", "0", ":", "2", "]", ")", "if", "dim", "<", "max_size", ":", "max_size", "=", "dim", "x", ",", "y", ",", "...
Resamples a square image to an image of max_size
[ "Resamples", "a", "square", "image", "to", "an", "image", "of", "max_size" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L229-L242
222,758
vtkiorg/vtki
vtki/qt_plotting.py
pad_image
def pad_image(arr, max_size=400): """Pads an image to a square then resamples to max_size""" dim = np.max(arr.shape) img = np.zeros((dim, dim, 3), dtype=arr.dtype) xl = (dim - arr.shape[0]) // 2 yl = (dim - arr.shape[1]) // 2 img[xl:arr.shape[0]+xl, yl:arr.shape[1]+yl, :] = arr return resamp...
python
def pad_image(arr, max_size=400): """Pads an image to a square then resamples to max_size""" dim = np.max(arr.shape) img = np.zeros((dim, dim, 3), dtype=arr.dtype) xl = (dim - arr.shape[0]) // 2 yl = (dim - arr.shape[1]) // 2 img[xl:arr.shape[0]+xl, yl:arr.shape[1]+yl, :] = arr return resamp...
[ "def", "pad_image", "(", "arr", ",", "max_size", "=", "400", ")", ":", "dim", "=", "np", ".", "max", "(", "arr", ".", "shape", ")", "img", "=", "np", ".", "zeros", "(", "(", "dim", ",", "dim", ",", "3", ")", ",", "dtype", "=", "arr", ".", "...
Pads an image to a square then resamples to max_size
[ "Pads", "an", "image", "to", "a", "square", "then", "resamples", "to", "max_size" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L245-L252
222,759
vtkiorg/vtki
vtki/qt_plotting.py
FileDialog.emit_accepted
def emit_accepted(self): """ Sends signal that the file dialog was closed properly. Sends: filename """ if self.result(): filename = self.selectedFiles()[0] if os.path.isdir(os.path.dirname(filename)): self.dlg_accepted.emit(filena...
python
def emit_accepted(self): """ Sends signal that the file dialog was closed properly. Sends: filename """ if self.result(): filename = self.selectedFiles()[0] if os.path.isdir(os.path.dirname(filename)): self.dlg_accepted.emit(filena...
[ "def", "emit_accepted", "(", "self", ")", ":", "if", "self", ".", "result", "(", ")", ":", "filename", "=", "self", ".", "selectedFiles", "(", ")", "[", "0", "]", "if", "os", ".", "path", ".", "isdir", "(", "os", ".", "path", ".", "dirname", "(",...
Sends signal that the file dialog was closed properly. Sends: filename
[ "Sends", "signal", "that", "the", "file", "dialog", "was", "closed", "properly", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L92-L102
222,760
vtkiorg/vtki
vtki/qt_plotting.py
ScaleAxesDialog.update_scale
def update_scale(self, value): """ updates the scale of all actors in the plotter """ self.plotter.set_scale(self.x_slider_group.value, self.y_slider_group.value, self.z_slider_group.value)
python
def update_scale(self, value): """ updates the scale of all actors in the plotter """ self.plotter.set_scale(self.x_slider_group.value, self.y_slider_group.value, self.z_slider_group.value)
[ "def", "update_scale", "(", "self", ",", "value", ")", ":", "self", ".", "plotter", ".", "set_scale", "(", "self", ".", "x_slider_group", ".", "value", ",", "self", ".", "y_slider_group", ".", "value", ",", "self", ".", "z_slider_group", ".", "value", ")...
updates the scale of all actors in the plotter
[ "updates", "the", "scale", "of", "all", "actors", "in", "the", "plotter" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L222-L226
222,761
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter.scale_axes_dialog
def scale_axes_dialog(self, show=True): """ Open scale axes dialog """ return ScaleAxesDialog(self.app_window, self, show=show)
python
def scale_axes_dialog(self, show=True): """ Open scale axes dialog """ return ScaleAxesDialog(self.app_window, self, show=show)
[ "def", "scale_axes_dialog", "(", "self", ",", "show", "=", "True", ")", ":", "return", "ScaleAxesDialog", "(", "self", ".", "app_window", ",", "self", ",", "show", "=", "show", ")" ]
Open scale axes dialog
[ "Open", "scale", "axes", "dialog" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L418-L420
222,762
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter.clear_camera_positions
def clear_camera_positions(self): """ clears all camera positions """ for action in self.saved_camera_menu.actions(): self.saved_camera_menu.removeAction(action)
python
def clear_camera_positions(self): """ clears all camera positions """ for action in self.saved_camera_menu.actions(): self.saved_camera_menu.removeAction(action)
[ "def", "clear_camera_positions", "(", "self", ")", ":", "for", "action", "in", "self", ".", "saved_camera_menu", ".", "actions", "(", ")", ":", "self", ".", "saved_camera_menu", ".", "removeAction", "(", "action", ")" ]
clears all camera positions
[ "clears", "all", "camera", "positions" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L422-L425
222,763
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter.save_camera_position
def save_camera_position(self): """ Saves camera position to saved camera menu for recall """ self.saved_camera_positions.append(self.camera_position) ncam = len(self.saved_camera_positions) camera_position = self.camera_position[:] # py2.7 copy compatibility def load_camera_po...
python
def save_camera_position(self): """ Saves camera position to saved camera menu for recall """ self.saved_camera_positions.append(self.camera_position) ncam = len(self.saved_camera_positions) camera_position = self.camera_position[:] # py2.7 copy compatibility def load_camera_po...
[ "def", "save_camera_position", "(", "self", ")", ":", "self", ".", "saved_camera_positions", ".", "append", "(", "self", ".", "camera_position", ")", "ncam", "=", "len", "(", "self", ".", "saved_camera_positions", ")", "camera_position", "=", "self", ".", "cam...
Saves camera position to saved camera menu for recall
[ "Saves", "camera", "position", "to", "saved", "camera", "menu", "for", "recall" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L427-L437
222,764
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter._spawn_background_rendering
def _spawn_background_rendering(self, rate=5.0): """ Spawns a thread that updates the render window. Sometimes directly modifiying object data doesn't trigger Modified() and upstream objects won't be updated. This ensures the render window stays updated without consuming too ...
python
def _spawn_background_rendering(self, rate=5.0): """ Spawns a thread that updates the render window. Sometimes directly modifiying object data doesn't trigger Modified() and upstream objects won't be updated. This ensures the render window stays updated without consuming too ...
[ "def", "_spawn_background_rendering", "(", "self", ",", "rate", "=", "5.0", ")", ":", "self", ".", "render_trigger", ".", "connect", "(", "self", ".", "ren_win", ".", "Render", ")", "twait", "=", "rate", "**", "-", "1", "def", "render", "(", ")", ":", ...
Spawns a thread that updates the render window. Sometimes directly modifiying object data doesn't trigger Modified() and upstream objects won't be updated. This ensures the render window stays updated without consuming too many resources.
[ "Spawns", "a", "thread", "that", "updates", "the", "render", "window", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L439-L457
222,765
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter.update_app_icon
def update_app_icon(self): """ Update the app icon if the user is not trying to resize the window. """ if os.name == 'nt' or not hasattr(self, '_last_window_size'): # pragma: no cover # DO NOT EVEN ATTEMPT TO UPDATE ICON ON WINDOWS return cur_time = time....
python
def update_app_icon(self): """ Update the app icon if the user is not trying to resize the window. """ if os.name == 'nt' or not hasattr(self, '_last_window_size'): # pragma: no cover # DO NOT EVEN ATTEMPT TO UPDATE ICON ON WINDOWS return cur_time = time....
[ "def", "update_app_icon", "(", "self", ")", ":", "if", "os", ".", "name", "==", "'nt'", "or", "not", "hasattr", "(", "self", ",", "'_last_window_size'", ")", ":", "# pragma: no cover", "# DO NOT EVEN ATTEMPT TO UPDATE ICON ON WINDOWS", "return", "cur_time", "=", "...
Update the app icon if the user is not trying to resize the window.
[ "Update", "the", "app", "icon", "if", "the", "user", "is", "not", "trying", "to", "resize", "the", "window", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L472-L501
222,766
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter._qt_export_vtkjs
def _qt_export_vtkjs(self, show=True): """ Spawn an save file dialog to export a vtkjs file. """ return FileDialog(self.app_window, filefilter=['VTK JS File(*.vtkjs)'], show=show, directory=os.getcwd(), ...
python
def _qt_export_vtkjs(self, show=True): """ Spawn an save file dialog to export a vtkjs file. """ return FileDialog(self.app_window, filefilter=['VTK JS File(*.vtkjs)'], show=show, directory=os.getcwd(), ...
[ "def", "_qt_export_vtkjs", "(", "self", ",", "show", "=", "True", ")", ":", "return", "FileDialog", "(", "self", ".", "app_window", ",", "filefilter", "=", "[", "'VTK JS File(*.vtkjs)'", "]", ",", "show", "=", "show", ",", "directory", "=", "os", ".", "g...
Spawn an save file dialog to export a vtkjs file.
[ "Spawn", "an", "save", "file", "dialog", "to", "export", "a", "vtkjs", "file", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L511-L519
222,767
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter.window_size
def window_size(self): """ returns render window size """ the_size = self.app_window.baseSize() return the_size.width(), the_size.height()
python
def window_size(self): """ returns render window size """ the_size = self.app_window.baseSize() return the_size.width(), the_size.height()
[ "def", "window_size", "(", "self", ")", ":", "the_size", "=", "self", ".", "app_window", ".", "baseSize", "(", ")", "return", "the_size", ".", "width", "(", ")", ",", "the_size", ".", "height", "(", ")" ]
returns render window size
[ "returns", "render", "window", "size" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L532-L535
222,768
vtkiorg/vtki
vtki/qt_plotting.py
BackgroundPlotter.window_size
def window_size(self, window_size): """ set the render window size """ BasePlotter.window_size.fset(self, window_size) self.app_window.setBaseSize(*window_size)
python
def window_size(self, window_size): """ set the render window size """ BasePlotter.window_size.fset(self, window_size) self.app_window.setBaseSize(*window_size)
[ "def", "window_size", "(", "self", ",", "window_size", ")", ":", "BasePlotter", ".", "window_size", ".", "fset", "(", "self", ",", "window_size", ")", "self", ".", "app_window", ".", "setBaseSize", "(", "*", "window_size", ")" ]
set the render window size
[ "set", "the", "render", "window", "size" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/qt_plotting.py#L539-L542
222,769
vtkiorg/vtki
vtki/colors.py
hex_to_rgb
def hex_to_rgb(h): """ Returns 0 to 1 rgb from a hex list or tuple """ h = h.lstrip('#') return tuple(int(h[i:i+2], 16)/255. for i in (0, 2 ,4))
python
def hex_to_rgb(h): """ Returns 0 to 1 rgb from a hex list or tuple """ h = h.lstrip('#') return tuple(int(h[i:i+2], 16)/255. for i in (0, 2 ,4))
[ "def", "hex_to_rgb", "(", "h", ")", ":", "h", "=", "h", ".", "lstrip", "(", "'#'", ")", "return", "tuple", "(", "int", "(", "h", "[", "i", ":", "i", "+", "2", "]", ",", "16", ")", "/", "255.", "for", "i", "in", "(", "0", ",", "2", ",", ...
Returns 0 to 1 rgb from a hex list or tuple
[ "Returns", "0", "to", "1", "rgb", "from", "a", "hex", "list", "or", "tuple" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/colors.py#L321-L324
222,770
vtkiorg/vtki
vtki/errors.py
set_error_output_file
def set_error_output_file(filename): """Sets a file to write out the VTK errors""" filename = os.path.abspath(os.path.expanduser(filename)) fileOutputWindow = vtk.vtkFileOutputWindow() fileOutputWindow.SetFileName(filename) outputWindow = vtk.vtkOutputWindow() outputWindow.SetInstance(fileOutput...
python
def set_error_output_file(filename): """Sets a file to write out the VTK errors""" filename = os.path.abspath(os.path.expanduser(filename)) fileOutputWindow = vtk.vtkFileOutputWindow() fileOutputWindow.SetFileName(filename) outputWindow = vtk.vtkOutputWindow() outputWindow.SetInstance(fileOutput...
[ "def", "set_error_output_file", "(", "filename", ")", ":", "filename", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "filename", ")", ")", "fileOutputWindow", "=", "vtk", ".", "vtkFileOutputWindow", "(", ")", "file...
Sets a file to write out the VTK errors
[ "Sets", "a", "file", "to", "write", "out", "the", "VTK", "errors" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/errors.py#L8-L15
222,771
vtkiorg/vtki
vtki/errors.py
Observer.log_message
def log_message(self, kind, alert): """Parses different event types and passes them to logging""" if kind == 'ERROR': logging.error(alert) else: logging.warning(alert) return
python
def log_message(self, kind, alert): """Parses different event types and passes them to logging""" if kind == 'ERROR': logging.error(alert) else: logging.warning(alert) return
[ "def", "log_message", "(", "self", ",", "kind", ",", "alert", ")", ":", "if", "kind", "==", "'ERROR'", ":", "logging", ".", "error", "(", "alert", ")", "else", ":", "logging", ".", "warning", "(", "alert", ")", "return" ]
Parses different event types and passes them to logging
[ "Parses", "different", "event", "types", "and", "passes", "them", "to", "logging" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/errors.py#L40-L46
222,772
vtkiorg/vtki
vtki/errors.py
Observer.observe
def observe(self, algorithm): """Make this an observer of an algorithm """ if self.__observing: raise RuntimeError('This error observer is already observing an algorithm.') if hasattr(algorithm, 'GetExecutive') and algorithm.GetExecutive() is not None: algorithm.G...
python
def observe(self, algorithm): """Make this an observer of an algorithm """ if self.__observing: raise RuntimeError('This error observer is already observing an algorithm.') if hasattr(algorithm, 'GetExecutive') and algorithm.GetExecutive() is not None: algorithm.G...
[ "def", "observe", "(", "self", ",", "algorithm", ")", ":", "if", "self", ".", "__observing", ":", "raise", "RuntimeError", "(", "'This error observer is already observing an algorithm.'", ")", "if", "hasattr", "(", "algorithm", ",", "'GetExecutive'", ")", "and", "...
Make this an observer of an algorithm
[ "Make", "this", "an", "observer", "of", "an", "algorithm" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/errors.py#L75-L84
222,773
vtkiorg/vtki
vtki/export.py
get_range_info
def get_range_info(array, component): """Get the data range of the array's component""" r = array.GetRange(component) comp_range = {} comp_range['min'] = r[0] comp_range['max'] = r[1] comp_range['component'] = array.GetComponentName(component) return comp_range
python
def get_range_info(array, component): """Get the data range of the array's component""" r = array.GetRange(component) comp_range = {} comp_range['min'] = r[0] comp_range['max'] = r[1] comp_range['component'] = array.GetComponentName(component) return comp_range
[ "def", "get_range_info", "(", "array", ",", "component", ")", ":", "r", "=", "array", ".", "GetRange", "(", "component", ")", "comp_range", "=", "{", "}", "comp_range", "[", "'min'", "]", "=", "r", "[", "0", "]", "comp_range", "[", "'max'", "]", "=",...
Get the data range of the array's component
[ "Get", "the", "data", "range", "of", "the", "array", "s", "component" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L78-L85
222,774
vtkiorg/vtki
vtki/export.py
get_object_id
def get_object_id(obj): """Get object identifier""" try: idx = objIds.index(obj) return idx + 1 except ValueError: objIds.append(obj) return len(objIds)
python
def get_object_id(obj): """Get object identifier""" try: idx = objIds.index(obj) return idx + 1 except ValueError: objIds.append(obj) return len(objIds)
[ "def", "get_object_id", "(", "obj", ")", ":", "try", ":", "idx", "=", "objIds", ".", "index", "(", "obj", ")", "return", "idx", "+", "1", "except", "ValueError", ":", "objIds", ".", "append", "(", "obj", ")", "return", "len", "(", "objIds", ")" ]
Get object identifier
[ "Get", "object", "identifier" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L104-L111
222,775
vtkiorg/vtki
vtki/export.py
dump_data_array
def dump_data_array(dataset_dir, data_dir, array, root=None, compress=True): """Dump vtkjs data arry""" if root is None: root = {} if not array: return None if array.GetDataType() == 12: # IdType need to be converted to Uint32 array_size = array.GetNumberOfTuples() * arr...
python
def dump_data_array(dataset_dir, data_dir, array, root=None, compress=True): """Dump vtkjs data arry""" if root is None: root = {} if not array: return None if array.GetDataType() == 12: # IdType need to be converted to Uint32 array_size = array.GetNumberOfTuples() * arr...
[ "def", "dump_data_array", "(", "dataset_dir", ",", "data_dir", ",", "array", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "if", "not", "array", ":", "return", "None", "if", ...
Dump vtkjs data arry
[ "Dump", "vtkjs", "data", "arry" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L116-L160
222,776
vtkiorg/vtki
vtki/export.py
dump_color_array
def dump_color_array(dataset_dir, data_dir, color_array_info, root=None, compress=True): """Dump vtkjs color array""" if root is None: root = {} root['pointData'] = { 'vtkClass': 'vtkDataSetAttributes', "activeGlobalIds": -1, "activeNormals": -1, "activePedigreeIds": ...
python
def dump_color_array(dataset_dir, data_dir, color_array_info, root=None, compress=True): """Dump vtkjs color array""" if root is None: root = {} root['pointData'] = { 'vtkClass': 'vtkDataSetAttributes', "activeGlobalIds": -1, "activeNormals": -1, "activePedigreeIds": ...
[ "def", "dump_color_array", "(", "dataset_dir", ",", "data_dir", ",", "color_array_info", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "root", "[", "'pointData'", "]", "=", "{"...
Dump vtkjs color array
[ "Dump", "vtkjs", "color", "array" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L165-L212
222,777
vtkiorg/vtki
vtki/export.py
dump_t_coords
def dump_t_coords(dataset_dir, data_dir, dataset, root=None, compress=True): """dump vtkjs texture coordinates""" if root is None: root = {} tcoords = dataset.GetPointData().GetTCoords() if tcoords: dumped_array = dump_data_array(dataset_dir, data_dir, tcoords, {}, compress) root...
python
def dump_t_coords(dataset_dir, data_dir, dataset, root=None, compress=True): """dump vtkjs texture coordinates""" if root is None: root = {} tcoords = dataset.GetPointData().GetTCoords() if tcoords: dumped_array = dump_data_array(dataset_dir, data_dir, tcoords, {}, compress) root...
[ "def", "dump_t_coords", "(", "dataset_dir", ",", "data_dir", ",", "dataset", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "tcoords", "=", "dataset", ".", "GetPointData", "(", ...
dump vtkjs texture coordinates
[ "dump", "vtkjs", "texture", "coordinates" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L217-L225
222,778
vtkiorg/vtki
vtki/export.py
dump_normals
def dump_normals(dataset_dir, data_dir, dataset, root=None, compress=True): """dump vtkjs normal vectors""" if root is None: root = {} normals = dataset.GetPointData().GetNormals() if normals: dumped_array = dump_data_array(dataset_dir, data_dir, normals, {}, compress) root['poin...
python
def dump_normals(dataset_dir, data_dir, dataset, root=None, compress=True): """dump vtkjs normal vectors""" if root is None: root = {} normals = dataset.GetPointData().GetNormals() if normals: dumped_array = dump_data_array(dataset_dir, data_dir, normals, {}, compress) root['poin...
[ "def", "dump_normals", "(", "dataset_dir", ",", "data_dir", ",", "dataset", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "normals", "=", "dataset", ".", "GetPointData", "(", ...
dump vtkjs normal vectors
[ "dump", "vtkjs", "normal", "vectors" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L230-L238
222,779
vtkiorg/vtki
vtki/export.py
dump_all_arrays
def dump_all_arrays(dataset_dir, data_dir, dataset, root=None, compress=True): """Dump all data arrays to vtkjs""" if root is None: root = {} root['pointData'] = { 'vtkClass': 'vtkDataSetAttributes', "activeGlobalIds": -1, "activeNormals": -1, "activePedigreeIds": -1,...
python
def dump_all_arrays(dataset_dir, data_dir, dataset, root=None, compress=True): """Dump all data arrays to vtkjs""" if root is None: root = {} root['pointData'] = { 'vtkClass': 'vtkDataSetAttributes', "activeGlobalIds": -1, "activeNormals": -1, "activePedigreeIds": -1,...
[ "def", "dump_all_arrays", "(", "dataset_dir", ",", "data_dir", ",", "dataset", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "root", "[", "'pointData'", "]", "=", "{", "'vtkC...
Dump all data arrays to vtkjs
[ "Dump", "all", "data", "arrays", "to", "vtkjs" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L243-L303
222,780
vtkiorg/vtki
vtki/export.py
dump_poly_data
def dump_poly_data(dataset_dir, data_dir, dataset, color_array_info, root=None, compress=True): """Dump poly data object to vtkjs""" if root is None: root = {} root['vtkClass'] = 'vtkPolyData' container = root # Points points = dump_data_array(dataset_dir, data_dir, ...
python
def dump_poly_data(dataset_dir, data_dir, dataset, color_array_info, root=None, compress=True): """Dump poly data object to vtkjs""" if root is None: root = {} root['vtkClass'] = 'vtkPolyData' container = root # Points points = dump_data_array(dataset_dir, data_dir, ...
[ "def", "dump_poly_data", "(", "dataset_dir", ",", "data_dir", ",", "dataset", ",", "color_array_info", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "root", "[", "'vtkClass'", ...
Dump poly data object to vtkjs
[ "Dump", "poly", "data", "object", "to", "vtkjs" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L308-L358
222,781
vtkiorg/vtki
vtki/export.py
dump_image_data
def dump_image_data(dataset_dir, data_dir, dataset, color_array_info, root=None, compress=True): """Dump image data object to vtkjs""" if root is None: root = {} root['vtkClass'] = 'vtkImageData' container = root container['spacing'] = dataset.GetSpacing() container['origin'] = dataset....
python
def dump_image_data(dataset_dir, data_dir, dataset, color_array_info, root=None, compress=True): """Dump image data object to vtkjs""" if root is None: root = {} root['vtkClass'] = 'vtkImageData' container = root container['spacing'] = dataset.GetSpacing() container['origin'] = dataset....
[ "def", "dump_image_data", "(", "dataset_dir", ",", "data_dir", ",", "dataset", ",", "color_array_info", ",", "root", "=", "None", ",", "compress", "=", "True", ")", ":", "if", "root", "is", "None", ":", "root", "=", "{", "}", "root", "[", "'vtkClass'", ...
Dump image data object to vtkjs
[ "Dump", "image", "data", "object", "to", "vtkjs" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L366-L379
222,782
vtkiorg/vtki
vtki/export.py
write_data_set
def write_data_set(file_path, dataset, output_dir, color_array_info, new_name=None, compress=True): """write dataset to vtkjs""" fileName = new_name if new_name else os.path.basename(file_path) dataset_dir = os.path.join(output_dir, fileName) data_dir = os.path.join(dataset_dir, 'data') if not os.p...
python
def write_data_set(file_path, dataset, output_dir, color_array_info, new_name=None, compress=True): """write dataset to vtkjs""" fileName = new_name if new_name else os.path.basename(file_path) dataset_dir = os.path.join(output_dir, fileName) data_dir = os.path.join(dataset_dir, 'data') if not os.p...
[ "def", "write_data_set", "(", "file_path", ",", "dataset", ",", "output_dir", ",", "color_array_info", ",", "new_name", "=", "None", ",", "compress", "=", "True", ")", ":", "fileName", "=", "new_name", "if", "new_name", "else", "os", ".", "path", ".", "bas...
write dataset to vtkjs
[ "write", "dataset", "to", "vtkjs" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/export.py#L387-L409
222,783
vtkiorg/vtki
vtki/common.py
Common.active_vectors
def active_vectors(self): """The active vectors array""" field, name = self.active_vectors_info if name: if field is POINT_DATA_FIELD: return self.point_arrays[name] if field is CELL_DATA_FIELD: return self.cell_arrays[name]
python
def active_vectors(self): """The active vectors array""" field, name = self.active_vectors_info if name: if field is POINT_DATA_FIELD: return self.point_arrays[name] if field is CELL_DATA_FIELD: return self.cell_arrays[name]
[ "def", "active_vectors", "(", "self", ")", ":", "field", ",", "name", "=", "self", ".", "active_vectors_info", "if", "name", ":", "if", "field", "is", "POINT_DATA_FIELD", ":", "return", "self", ".", "point_arrays", "[", "name", "]", "if", "field", "is", ...
The active vectors array
[ "The", "active", "vectors", "array" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L81-L88
222,784
vtkiorg/vtki
vtki/common.py
Common.arrows
def arrows(self): """ Returns a glyph representation of the active vector data as arrows. Arrows will be located at the points of the mesh and their size will be dependent on the length of the vector. Their direction will be the "direction" of the vector Returns ...
python
def arrows(self): """ Returns a glyph representation of the active vector data as arrows. Arrows will be located at the points of the mesh and their size will be dependent on the length of the vector. Their direction will be the "direction" of the vector Returns ...
[ "def", "arrows", "(", "self", ")", ":", "if", "self", ".", "active_vectors", "is", "None", ":", "return", "arrow", "=", "vtk", ".", "vtkArrowSource", "(", ")", "arrow", ".", "Update", "(", ")", "alg", "=", "vtk", ".", "vtkGlyph3D", "(", ")", "alg", ...
Returns a glyph representation of the active vector data as arrows. Arrows will be located at the points of the mesh and their size will be dependent on the length of the vector. Their direction will be the "direction" of the vector Returns ------- arrows : vtki.PolyDat...
[ "Returns", "a", "glyph", "representation", "of", "the", "active", "vector", "data", "as", "arrows", ".", "Arrows", "will", "be", "located", "at", "the", "points", "of", "the", "mesh", "and", "their", "size", "will", "be", "dependent", "on", "the", "length"...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L128-L153
222,785
vtkiorg/vtki
vtki/common.py
Common.vectors
def vectors(self, array): """ Sets the active vector """ if array.ndim != 2: raise AssertionError('vector array must be a 2-dimensional array') elif array.shape[1] != 3: raise RuntimeError('vector array must be 3D') elif array.shape[0] != self.n_points: ...
python
def vectors(self, array): """ Sets the active vector """ if array.ndim != 2: raise AssertionError('vector array must be a 2-dimensional array') elif array.shape[1] != 3: raise RuntimeError('vector array must be 3D') elif array.shape[0] != self.n_points: ...
[ "def", "vectors", "(", "self", ",", "array", ")", ":", "if", "array", ".", "ndim", "!=", "2", ":", "raise", "AssertionError", "(", "'vector array must be a 2-dimensional array'", ")", "elif", "array", ".", "shape", "[", "1", "]", "!=", "3", ":", "raise", ...
Sets the active vector
[ "Sets", "the", "active", "vector" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L161-L171
222,786
vtkiorg/vtki
vtki/common.py
Common.t_coords
def t_coords(self, t_coords): """Set the array to use as the texture coordinates""" if not isinstance(t_coords, np.ndarray): raise TypeError('Texture coordinates must be a numpy array') if t_coords.ndim != 2: raise AssertionError('Texture coordinates must be a 2-dimension...
python
def t_coords(self, t_coords): """Set the array to use as the texture coordinates""" if not isinstance(t_coords, np.ndarray): raise TypeError('Texture coordinates must be a numpy array') if t_coords.ndim != 2: raise AssertionError('Texture coordinates must be a 2-dimension...
[ "def", "t_coords", "(", "self", ",", "t_coords", ")", ":", "if", "not", "isinstance", "(", "t_coords", ",", "np", ".", "ndarray", ")", ":", "raise", "TypeError", "(", "'Texture coordinates must be a numpy array'", ")", "if", "t_coords", ".", "ndim", "!=", "2...
Set the array to use as the texture coordinates
[ "Set", "the", "array", "to", "use", "as", "the", "texture", "coordinates" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L181-L198
222,787
vtkiorg/vtki
vtki/common.py
Common._activate_texture
def _activate_texture(mesh, name): """Grab a texture and update the active texture coordinates. This makes sure to not destroy old texture coordinates Parameters ---------- name : str The name of the texture and texture coordinates to activate Return ...
python
def _activate_texture(mesh, name): """Grab a texture and update the active texture coordinates. This makes sure to not destroy old texture coordinates Parameters ---------- name : str The name of the texture and texture coordinates to activate Return ...
[ "def", "_activate_texture", "(", "mesh", ",", "name", ")", ":", "if", "name", "==", "True", "or", "isinstance", "(", "name", ",", "int", ")", ":", "keys", "=", "list", "(", "mesh", ".", "textures", ".", "keys", "(", ")", ")", "# Grab the first name ava...
Grab a texture and update the active texture coordinates. This makes sure to not destroy old texture coordinates Parameters ---------- name : str The name of the texture and texture coordinates to activate Return ------ vtk.vtkTexture : The active te...
[ "Grab", "a", "texture", "and", "update", "the", "active", "texture", "coordinates", ".", "This", "makes", "sure", "to", "not", "destroy", "old", "texture", "coordinates" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L210-L248
222,788
vtkiorg/vtki
vtki/common.py
Common.set_active_scalar
def set_active_scalar(self, name, preference='cell'): """Finds the scalar by name and appropriately sets it as active""" _, field = get_scalar(self, name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.GetPointData().SetActiveScalars(name) elif field == ...
python
def set_active_scalar(self, name, preference='cell'): """Finds the scalar by name and appropriately sets it as active""" _, field = get_scalar(self, name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.GetPointData().SetActiveScalars(name) elif field == ...
[ "def", "set_active_scalar", "(", "self", ",", "name", ",", "preference", "=", "'cell'", ")", ":", "_", ",", "field", "=", "get_scalar", "(", "self", ",", "name", ",", "preference", "=", "preference", ",", "info", "=", "True", ")", "if", "field", "==", ...
Finds the scalar by name and appropriately sets it as active
[ "Finds", "the", "scalar", "by", "name", "and", "appropriately", "sets", "it", "as", "active" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L250-L259
222,789
vtkiorg/vtki
vtki/common.py
Common.set_active_vectors
def set_active_vectors(self, name, preference='cell'): """Finds the vectors by name and appropriately sets it as active""" _, field = get_scalar(self, name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.GetPointData().SetActiveVectors(name) elif field =...
python
def set_active_vectors(self, name, preference='cell'): """Finds the vectors by name and appropriately sets it as active""" _, field = get_scalar(self, name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.GetPointData().SetActiveVectors(name) elif field =...
[ "def", "set_active_vectors", "(", "self", ",", "name", ",", "preference", "=", "'cell'", ")", ":", "_", ",", "field", "=", "get_scalar", "(", "self", ",", "name", ",", "preference", "=", "preference", ",", "info", "=", "True", ")", "if", "field", "==",...
Finds the vectors by name and appropriately sets it as active
[ "Finds", "the", "vectors", "by", "name", "and", "appropriately", "sets", "it", "as", "active" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L261-L270
222,790
vtkiorg/vtki
vtki/common.py
Common.rename_scalar
def rename_scalar(self, old_name, new_name, preference='cell'): """Changes array name by searching for the array then renaming it""" _, field = get_scalar(self, old_name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.point_arrays[new_name] = self.point_arrays.p...
python
def rename_scalar(self, old_name, new_name, preference='cell'): """Changes array name by searching for the array then renaming it""" _, field = get_scalar(self, old_name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.point_arrays[new_name] = self.point_arrays.p...
[ "def", "rename_scalar", "(", "self", ",", "old_name", ",", "new_name", ",", "preference", "=", "'cell'", ")", ":", "_", ",", "field", "=", "get_scalar", "(", "self", ",", "old_name", ",", "preference", "=", "preference", ",", "info", "=", "True", ")", ...
Changes array name by searching for the array then renaming it
[ "Changes", "array", "name", "by", "searching", "for", "the", "array", "then", "renaming", "it" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L272-L282
222,791
vtkiorg/vtki
vtki/common.py
Common.active_scalar
def active_scalar(self): """Returns the active scalar as an array""" field, name = self.active_scalar_info if name is None: return None if field == POINT_DATA_FIELD: return self._point_scalar(name) elif field == CELL_DATA_FIELD: return self._ce...
python
def active_scalar(self): """Returns the active scalar as an array""" field, name = self.active_scalar_info if name is None: return None if field == POINT_DATA_FIELD: return self._point_scalar(name) elif field == CELL_DATA_FIELD: return self._ce...
[ "def", "active_scalar", "(", "self", ")", ":", "field", ",", "name", "=", "self", ".", "active_scalar_info", "if", "name", "is", "None", ":", "return", "None", "if", "field", "==", "POINT_DATA_FIELD", ":", "return", "self", ".", "_point_scalar", "(", "name...
Returns the active scalar as an array
[ "Returns", "the", "active", "scalar", "as", "an", "array" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L285-L293
222,792
vtkiorg/vtki
vtki/common.py
Common._add_point_scalar
def _add_point_scalar(self, scalars, name, set_active=False, deep=True): """ Adds point scalars to the mesh Parameters ---------- scalars : numpy.ndarray Numpy array of scalars. Must match number of points. name : str Name of point scalars to ad...
python
def _add_point_scalar(self, scalars, name, set_active=False, deep=True): """ Adds point scalars to the mesh Parameters ---------- scalars : numpy.ndarray Numpy array of scalars. Must match number of points. name : str Name of point scalars to ad...
[ "def", "_add_point_scalar", "(", "self", ",", "scalars", ",", "name", ",", "set_active", "=", "False", ",", "deep", "=", "True", ")", ":", "if", "not", "isinstance", "(", "scalars", ",", "np", ".", "ndarray", ")", ":", "raise", "TypeError", "(", "'Inpu...
Adds point scalars to the mesh Parameters ---------- scalars : numpy.ndarray Numpy array of scalars. Must match number of points. name : str Name of point scalars to add. set_active : bool, optional Sets the scalars to the active plotting s...
[ "Adds", "point", "scalars", "to", "the", "mesh" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L330-L372
222,793
vtkiorg/vtki
vtki/common.py
Common.points_to_double
def points_to_double(self): """ Makes points double precision """ if self.points.dtype != np.double: self.points = self.points.astype(np.double)
python
def points_to_double(self): """ Makes points double precision """ if self.points.dtype != np.double: self.points = self.points.astype(np.double)
[ "def", "points_to_double", "(", "self", ")", ":", "if", "self", ".", "points", ".", "dtype", "!=", "np", ".", "double", ":", "self", ".", "points", "=", "self", ".", "points", ".", "astype", "(", "np", ".", "double", ")" ]
Makes points double precision
[ "Makes", "points", "double", "precision" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L374-L377
222,794
vtkiorg/vtki
vtki/common.py
Common.rotate_x
def rotate_x(self, angle): """ Rotates mesh about the x-axis. Parameters ---------- angle : float Angle in degrees to rotate about the x-axis. """ axis_rotation(self.points, angle, inplace=True, axis='x')
python
def rotate_x(self, angle): """ Rotates mesh about the x-axis. Parameters ---------- angle : float Angle in degrees to rotate about the x-axis. """ axis_rotation(self.points, angle, inplace=True, axis='x')
[ "def", "rotate_x", "(", "self", ",", "angle", ")", ":", "axis_rotation", "(", "self", ".", "points", ",", "angle", ",", "inplace", "=", "True", ",", "axis", "=", "'x'", ")" ]
Rotates mesh about the x-axis. Parameters ---------- angle : float Angle in degrees to rotate about the x-axis.
[ "Rotates", "mesh", "about", "the", "x", "-", "axis", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L379-L389
222,795
vtkiorg/vtki
vtki/common.py
Common.rotate_y
def rotate_y(self, angle): """ Rotates mesh about the y-axis. Parameters ---------- angle : float Angle in degrees to rotate about the y-axis. """ axis_rotation(self.points, angle, inplace=True, axis='y')
python
def rotate_y(self, angle): """ Rotates mesh about the y-axis. Parameters ---------- angle : float Angle in degrees to rotate about the y-axis. """ axis_rotation(self.points, angle, inplace=True, axis='y')
[ "def", "rotate_y", "(", "self", ",", "angle", ")", ":", "axis_rotation", "(", "self", ".", "points", ",", "angle", ",", "inplace", "=", "True", ",", "axis", "=", "'y'", ")" ]
Rotates mesh about the y-axis. Parameters ---------- angle : float Angle in degrees to rotate about the y-axis.
[ "Rotates", "mesh", "about", "the", "y", "-", "axis", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L391-L401
222,796
vtkiorg/vtki
vtki/common.py
Common.rotate_z
def rotate_z(self, angle): """ Rotates mesh about the z-axis. Parameters ---------- angle : float Angle in degrees to rotate about the z-axis. """ axis_rotation(self.points, angle, inplace=True, axis='z')
python
def rotate_z(self, angle): """ Rotates mesh about the z-axis. Parameters ---------- angle : float Angle in degrees to rotate about the z-axis. """ axis_rotation(self.points, angle, inplace=True, axis='z')
[ "def", "rotate_z", "(", "self", ",", "angle", ")", ":", "axis_rotation", "(", "self", ".", "points", ",", "angle", ",", "inplace", "=", "True", ",", "axis", "=", "'z'", ")" ]
Rotates mesh about the z-axis. Parameters ---------- angle : float Angle in degrees to rotate about the z-axis.
[ "Rotates", "mesh", "about", "the", "z", "-", "axis", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L403-L413
222,797
vtkiorg/vtki
vtki/common.py
Common.transform
def transform(self, trans): """ Compute a transformation in place using a 4x4 transform. Parameters ---------- trans : vtk.vtkMatrix4x4, vtk.vtkTransform, or np.ndarray Accepts a vtk transformation object or a 4x4 transformation matrix. """ if isinst...
python
def transform(self, trans): """ Compute a transformation in place using a 4x4 transform. Parameters ---------- trans : vtk.vtkMatrix4x4, vtk.vtkTransform, or np.ndarray Accepts a vtk transformation object or a 4x4 transformation matrix. """ if isinst...
[ "def", "transform", "(", "self", ",", "trans", ")", ":", "if", "isinstance", "(", "trans", ",", "vtk", ".", "vtkMatrix4x4", ")", ":", "t", "=", "vtki", ".", "trans_from_matrix", "(", "trans", ")", "elif", "isinstance", "(", "trans", ",", "vtk", ".", ...
Compute a transformation in place using a 4x4 transform. Parameters ---------- trans : vtk.vtkMatrix4x4, vtk.vtkTransform, or np.ndarray Accepts a vtk transformation object or a 4x4 transformation matrix.
[ "Compute", "a", "transformation", "in", "place", "using", "a", "4x4", "transform", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L427-L458
222,798
vtkiorg/vtki
vtki/common.py
Common._cell_scalar
def _cell_scalar(self, name=None): """ Returns the cell scalars of a vtk object Parameters ---------- name : str Name of cell scalars to retrive. Returns ------- scalars : np.ndarray Numpy array of scalars """ if ...
python
def _cell_scalar(self, name=None): """ Returns the cell scalars of a vtk object Parameters ---------- name : str Name of cell scalars to retrive. Returns ------- scalars : np.ndarray Numpy array of scalars """ if ...
[ "def", "_cell_scalar", "(", "self", ",", "name", "=", "None", ")", ":", "if", "name", "is", "None", ":", "# use active scalar array", "field", ",", "name", "=", "self", ".", "active_scalar_info", "if", "field", "!=", "CELL_DATA_FIELD", ":", "raise", "Runtime...
Returns the cell scalars of a vtk object Parameters ---------- name : str Name of cell scalars to retrive. Returns ------- scalars : np.ndarray Numpy array of scalars
[ "Returns", "the", "cell", "scalars", "of", "a", "vtk", "object" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L460-L494
222,799
vtkiorg/vtki
vtki/common.py
Common._add_cell_scalar
def _add_cell_scalar(self, scalars, name, set_active=False, deep=True): """ Adds cell scalars to the vtk object. Parameters ---------- scalars : numpy.ndarray Numpy array of scalars. Must match number of points. name : str Name of point scalars ...
python
def _add_cell_scalar(self, scalars, name, set_active=False, deep=True): """ Adds cell scalars to the vtk object. Parameters ---------- scalars : numpy.ndarray Numpy array of scalars. Must match number of points. name : str Name of point scalars ...
[ "def", "_add_cell_scalar", "(", "self", ",", "scalars", ",", "name", ",", "set_active", "=", "False", ",", "deep", "=", "True", ")", ":", "if", "not", "isinstance", "(", "scalars", ",", "np", ".", "ndarray", ")", ":", "raise", "TypeError", "(", "'Input...
Adds cell scalars to the vtk object. Parameters ---------- scalars : numpy.ndarray Numpy array of scalars. Must match number of points. name : str Name of point scalars to add. set_active : bool, optional Sets the scalars to the active plot...
[ "Adds", "cell", "scalars", "to", "the", "vtk", "object", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L496-L534