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
partition
stringclasses
1 value
vtkiorg/vtki
vtki/plotting.py
plot
def plot(var_item, off_screen=None, full_screen=False, screenshot=None, interactive=True, cpos=None, window_size=None, show_bounds=False, show_axes=True, notebook=None, background=None, text='', return_img=False, eye_dome_lighting=False, use_panel=None, **kwargs): """ Conveni...
python
def plot(var_item, off_screen=None, full_screen=False, screenshot=None, interactive=True, cpos=None, window_size=None, show_bounds=False, show_axes=True, notebook=None, background=None, text='', return_img=False, eye_dome_lighting=False, use_panel=None, **kwargs): """ Conveni...
[ "def", "plot", "(", "var_item", ",", "off_screen", "=", "None", ",", "full_screen", "=", "False", ",", "screenshot", "=", "None", ",", "interactive", "=", "True", ",", "cpos", "=", "None", ",", "window_size", "=", "None", ",", "show_bounds", "=", "False"...
Convenience plotting function for a vtk or numpy object. Parameters ---------- item : vtk or numpy object VTK object or numpy array to be plotted. off_screen : bool Plots off screen when True. Helpful for saving screenshots without a window popping up. full_screen : bool,...
[ "Convenience", "plotting", "function", "for", "a", "vtk", "or", "numpy", "object", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L140-L260
train
vtkiorg/vtki
vtki/plotting.py
system_supports_plotting
def system_supports_plotting(): """ Check if x server is running Returns ------- system_supports_plotting : bool True when on Linux and running an xserver. Returns None when on a non-linux platform. """ try: if os.environ['ALLOW_PLOTTING'].lower() == 'true': ...
python
def system_supports_plotting(): """ Check if x server is running Returns ------- system_supports_plotting : bool True when on Linux and running an xserver. Returns None when on a non-linux platform. """ try: if os.environ['ALLOW_PLOTTING'].lower() == 'true': ...
[ "def", "system_supports_plotting", "(", ")", ":", "try", ":", "if", "os", ".", "environ", "[", "'ALLOW_PLOTTING'", "]", ".", "lower", "(", ")", "==", "'true'", ":", "return", "True", "except", "KeyError", ":", "pass", "try", ":", "p", "=", "Popen", "("...
Check if x server is running Returns ------- system_supports_plotting : bool True when on Linux and running an xserver. Returns None when on a non-linux platform.
[ "Check", "if", "x", "server", "is", "running" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L287-L308
train
vtkiorg/vtki
vtki/plotting.py
single_triangle
def single_triangle(): """ A single PolyData triangle """ points = np.zeros((3, 3)) points[1] = [1, 0, 0] points[2] = [0.5, 0.707, 0] cells = np.array([[3, 0, 1, 2]], ctypes.c_long) return vtki.PolyData(points, cells)
python
def single_triangle(): """ A single PolyData triangle """ points = np.zeros((3, 3)) points[1] = [1, 0, 0] points[2] = [0.5, 0.707, 0] cells = np.array([[3, 0, 1, 2]], ctypes.c_long) return vtki.PolyData(points, cells)
[ "def", "single_triangle", "(", ")", ":", "points", "=", "np", ".", "zeros", "(", "(", "3", ",", "3", ")", ")", "points", "[", "1", "]", "=", "[", "1", ",", "0", ",", "0", "]", "points", "[", "2", "]", "=", "[", "0.5", ",", "0.707", ",", "...
A single PolyData triangle
[ "A", "single", "PolyData", "triangle" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2970-L2976
train
vtkiorg/vtki
vtki/plotting.py
parse_color
def parse_color(color): """ Parses color into a vtk friendly rgb list """ if color is None: color = rcParams['color'] if isinstance(color, str): return vtki.string_to_rgb(color) elif len(color) == 3: return color else: raise Exception(""" Invalid color input M...
python
def parse_color(color): """ Parses color into a vtk friendly rgb list """ if color is None: color = rcParams['color'] if isinstance(color, str): return vtki.string_to_rgb(color) elif len(color) == 3: return color else: raise Exception(""" Invalid color input M...
[ "def", "parse_color", "(", "color", ")", ":", "if", "color", "is", "None", ":", "color", "=", "rcParams", "[", "'color'", "]", "if", "isinstance", "(", "color", ",", "str", ")", ":", "return", "vtki", ".", "string_to_rgb", "(", "color", ")", "elif", ...
Parses color into a vtk friendly rgb list
[ "Parses", "color", "into", "a", "vtk", "friendly", "rgb", "list" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2979-L2994
train
vtkiorg/vtki
vtki/plotting.py
plot_compare_four
def plot_compare_four(data_a, data_b, data_c, data_d, disply_kwargs=None, plotter_kwargs=None, show_kwargs=None, screenshot=None, camera_position=None, outline=None, outline_color='k', labels=('A', 'B', 'C', 'D')): """Plot a 2 by 2 comparison of data...
python
def plot_compare_four(data_a, data_b, data_c, data_d, disply_kwargs=None, plotter_kwargs=None, show_kwargs=None, screenshot=None, camera_position=None, outline=None, outline_color='k', labels=('A', 'B', 'C', 'D')): """Plot a 2 by 2 comparison of data...
[ "def", "plot_compare_four", "(", "data_a", ",", "data_b", ",", "data_c", ",", "data_d", ",", "disply_kwargs", "=", "None", ",", "plotter_kwargs", "=", "None", ",", "show_kwargs", "=", "None", ",", "screenshot", "=", "None", ",", "camera_position", "=", "None...
Plot a 2 by 2 comparison of data objects. Plotting parameters and camera positions will all be the same.
[ "Plot", "a", "2", "by", "2", "comparison", "of", "data", "objects", ".", "Plotting", "parameters", "and", "camera", "positions", "will", "all", "be", "the", "same", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L3008-L3037
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.set_focus
def set_focus(self, point): """ sets focus to a point """ if isinstance(point, np.ndarray): if point.ndim != 1: point = point.ravel() self.camera.SetFocalPoint(point) self._render()
python
def set_focus(self, point): """ sets focus to a point """ if isinstance(point, np.ndarray): if point.ndim != 1: point = point.ravel() self.camera.SetFocalPoint(point) self._render()
[ "def", "set_focus", "(", "self", ",", "point", ")", ":", "if", "isinstance", "(", "point", ",", "np", ".", "ndarray", ")", ":", "if", "point", ".", "ndim", "!=", "1", ":", "point", "=", "point", ".", "ravel", "(", ")", "self", ".", "camera", ".",...
sets focus to a point
[ "sets", "focus", "to", "a", "point" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L480-L486
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.set_position
def set_position(self, point, reset=False): """ sets camera position to a point """ if isinstance(point, np.ndarray): if point.ndim != 1: point = point.ravel() self.camera.SetPosition(point) if reset: self.reset_camera() self.camera_set = T...
python
def set_position(self, point, reset=False): """ sets camera position to a point """ if isinstance(point, np.ndarray): if point.ndim != 1: point = point.ravel() self.camera.SetPosition(point) if reset: self.reset_camera() self.camera_set = T...
[ "def", "set_position", "(", "self", ",", "point", ",", "reset", "=", "False", ")", ":", "if", "isinstance", "(", "point", ",", "np", ".", "ndarray", ")", ":", "if", "point", ".", "ndim", "!=", "1", ":", "point", "=", "point", ".", "ravel", "(", "...
sets camera position to a point
[ "sets", "camera", "position", "to", "a", "point" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L488-L497
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.set_viewup
def set_viewup(self, vector): """ sets camera viewup vector """ if isinstance(vector, np.ndarray): if vector.ndim != 1: vector = vector.ravel() self.camera.SetViewUp(vector) self._render()
python
def set_viewup(self, vector): """ sets camera viewup vector """ if isinstance(vector, np.ndarray): if vector.ndim != 1: vector = vector.ravel() self.camera.SetViewUp(vector) self._render()
[ "def", "set_viewup", "(", "self", ",", "vector", ")", ":", "if", "isinstance", "(", "vector", ",", "np", ".", "ndarray", ")", ":", "if", "vector", ".", "ndim", "!=", "1", ":", "vector", "=", "vector", ".", "ravel", "(", ")", "self", ".", "camera", ...
sets camera viewup vector
[ "sets", "camera", "viewup", "vector" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L499-L505
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter._render
def _render(self): """ redraws render window if the render window exists """ if hasattr(self, 'ren_win'): if hasattr(self, 'render_trigger'): self.render_trigger.emit() elif not self._first_time: self.render()
python
def _render(self): """ redraws render window if the render window exists """ if hasattr(self, 'ren_win'): if hasattr(self, 'render_trigger'): self.render_trigger.emit() elif not self._first_time: self.render()
[ "def", "_render", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'ren_win'", ")", ":", "if", "hasattr", "(", "self", ",", "'render_trigger'", ")", ":", "self", ".", "render_trigger", ".", "emit", "(", ")", "elif", "not", "self", ".", "_fi...
redraws render window if the render window exists
[ "redraws", "render", "window", "if", "the", "render", "window", "exists" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L507-L513
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_axes
def add_axes(self, interactive=None, color=None): """ Add an interactive axes widget """ if interactive is None: interactive = rcParams['interactive'] if hasattr(self, 'axes_widget'): self.axes_widget.SetInteractive(interactive) self._update_axes_color(color) ...
python
def add_axes(self, interactive=None, color=None): """ Add an interactive axes widget """ if interactive is None: interactive = rcParams['interactive'] if hasattr(self, 'axes_widget'): self.axes_widget.SetInteractive(interactive) self._update_axes_color(color) ...
[ "def", "add_axes", "(", "self", ",", "interactive", "=", "None", ",", "color", "=", "None", ")", ":", "if", "interactive", "is", "None", ":", "interactive", "=", "rcParams", "[", "'interactive'", "]", "if", "hasattr", "(", "self", ",", "'axes_widget'", "...
Add an interactive axes widget
[ "Add", "an", "interactive", "axes", "widget" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L515-L531
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.key_press_event
def key_press_event(self, obj, event): """ Listens for key press event """ key = self.iren.GetKeySym() log.debug('Key %s pressed' % key) if key == 'q': self.q_pressed = True # Grab screenshot right before renderer closes self.last_image = self.screensh...
python
def key_press_event(self, obj, event): """ Listens for key press event """ key = self.iren.GetKeySym() log.debug('Key %s pressed' % key) if key == 'q': self.q_pressed = True # Grab screenshot right before renderer closes self.last_image = self.screensh...
[ "def", "key_press_event", "(", "self", ",", "obj", ",", "event", ")", ":", "key", "=", "self", ".", "iren", ".", "GetKeySym", "(", ")", "log", ".", "debug", "(", "'Key %s pressed'", "%", "key", ")", "if", "key", "==", "'q'", ":", "self", ".", "q_pr...
Listens for key press event
[ "Listens", "for", "key", "press", "event" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L545-L557
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.left_button_down
def left_button_down(self, obj, event_type): """Register the event for a left button down click""" # Get 2D click location on window click_pos = self.iren.GetEventPosition() # Get corresponding click location in the 3D plot picker = vtk.vtkWorldPointPicker() picker.Pick(...
python
def left_button_down(self, obj, event_type): """Register the event for a left button down click""" # Get 2D click location on window click_pos = self.iren.GetEventPosition() # Get corresponding click location in the 3D plot picker = vtk.vtkWorldPointPicker() picker.Pick(...
[ "def", "left_button_down", "(", "self", ",", "obj", ",", "event_type", ")", ":", "# Get 2D click location on window", "click_pos", "=", "self", ".", "iren", ".", "GetEventPosition", "(", ")", "# Get corresponding click location in the 3D plot", "picker", "=", "vtk", "...
Register the event for a left button down click
[ "Register", "the", "event", "for", "a", "left", "button", "down", "click" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L559-L569
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.isometric_view_interactive
def isometric_view_interactive(self): """ sets the current interactive render window to isometric view """ interactor = self.iren.GetInteractorStyle() renderer = interactor.GetCurrentRenderer() renderer.view_isometric()
python
def isometric_view_interactive(self): """ sets the current interactive render window to isometric view """ interactor = self.iren.GetInteractorStyle() renderer = interactor.GetCurrentRenderer() renderer.view_isometric()
[ "def", "isometric_view_interactive", "(", "self", ")", ":", "interactor", "=", "self", ".", "iren", ".", "GetInteractorStyle", "(", ")", "renderer", "=", "interactor", ".", "GetCurrentRenderer", "(", ")", "renderer", ".", "view_isometric", "(", ")" ]
sets the current interactive render window to isometric view
[ "sets", "the", "current", "interactive", "render", "window", "to", "isometric", "view" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L571-L575
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.update
def update(self, stime=1, force_redraw=True): """ Update window, redraw, process messages query Parameters ---------- stime : int, optional Duration of timer that interrupt vtkRenderWindowInteractor in milliseconds. force_redraw : bool, optional ...
python
def update(self, stime=1, force_redraw=True): """ Update window, redraw, process messages query Parameters ---------- stime : int, optional Duration of timer that interrupt vtkRenderWindowInteractor in milliseconds. force_redraw : bool, optional ...
[ "def", "update", "(", "self", ",", "stime", "=", "1", ",", "force_redraw", "=", "True", ")", ":", "if", "stime", "<=", "0", ":", "stime", "=", "1", "curr_time", "=", "time", ".", "time", "(", ")", "if", "Plotter", ".", "last_update_time", ">", "cur...
Update window, redraw, process messages query Parameters ---------- stime : int, optional Duration of timer that interrupt vtkRenderWindowInteractor in milliseconds. force_redraw : bool, optional Call vtkRenderWindowInteractor.Render() immediately.
[ "Update", "window", "redraw", "process", "messages", "query" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L577-L612
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.update_scalar_bar_range
def update_scalar_bar_range(self, clim, name=None): """Update the value range of the active or named scalar bar. Parameters ---------- 2 item list The new range of scalar bar. Example: ``[-1, 2]``. name : str, optional The title of the scalar bar to upda...
python
def update_scalar_bar_range(self, clim, name=None): """Update the value range of the active or named scalar bar. Parameters ---------- 2 item list The new range of scalar bar. Example: ``[-1, 2]``. name : str, optional The title of the scalar bar to upda...
[ "def", "update_scalar_bar_range", "(", "self", ",", "clim", ",", "name", "=", "None", ")", ":", "if", "isinstance", "(", "clim", ",", "float", ")", "or", "isinstance", "(", "clim", ",", "int", ")", ":", "clim", "=", "[", "-", "clim", ",", "clim", "...
Update the value range of the active or named scalar bar. Parameters ---------- 2 item list The new range of scalar bar. Example: ``[-1, 2]``. name : str, optional The title of the scalar bar to update
[ "Update", "the", "value", "range", "of", "the", "active", "or", "named", "scalar", "bar", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1087-L1114
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.clear
def clear(self): """ Clears plot by removing all actors and properties """ for renderer in self.renderers: renderer.RemoveAllViewProps() self._scalar_bar_slots = set(range(MAX_N_COLOR_BARS)) self._scalar_bar_slot_lookup = {} self._scalar_bar_ranges = {} self._...
python
def clear(self): """ Clears plot by removing all actors and properties """ for renderer in self.renderers: renderer.RemoveAllViewProps() self._scalar_bar_slots = set(range(MAX_N_COLOR_BARS)) self._scalar_bar_slot_lookup = {} self._scalar_bar_ranges = {} self._...
[ "def", "clear", "(", "self", ")", ":", "for", "renderer", "in", "self", ".", "renderers", ":", "renderer", ".", "RemoveAllViewProps", "(", ")", "self", ".", "_scalar_bar_slots", "=", "set", "(", "range", "(", "MAX_N_COLOR_BARS", ")", ")", "self", ".", "_...
Clears plot by removing all actors and properties
[ "Clears", "plot", "by", "removing", "all", "actors", "and", "properties" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1150-L1159
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.remove_actor
def remove_actor(self, actor, reset_camera=False): """ Removes an actor from the Plotter. Parameters ---------- actor : vtk.vtkActor Actor that has previously added to the Renderer. reset_camera : bool, optional Resets camera so all actors can be...
python
def remove_actor(self, actor, reset_camera=False): """ Removes an actor from the Plotter. Parameters ---------- actor : vtk.vtkActor Actor that has previously added to the Renderer. reset_camera : bool, optional Resets camera so all actors can be...
[ "def", "remove_actor", "(", "self", ",", "actor", ",", "reset_camera", "=", "False", ")", ":", "for", "renderer", "in", "self", ".", "renderers", ":", "renderer", ".", "remove_actor", "(", "actor", ",", "reset_camera", ")", "return", "True" ]
Removes an actor from the Plotter. Parameters ---------- actor : vtk.vtkActor Actor that has previously added to the Renderer. reset_camera : bool, optional Resets camera so all actors can be seen. Returns ------- success : bool ...
[ "Removes", "an", "actor", "from", "the", "Plotter", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1161-L1181
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.loc_to_index
def loc_to_index(self, loc): """ Return index of the render window given a location index. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. Returns -----...
python
def loc_to_index(self, loc): """ Return index of the render window given a location index. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. Returns -----...
[ "def", "loc_to_index", "(", "self", ",", "loc", ")", ":", "if", "loc", "is", "None", ":", "return", "self", ".", "_active_renderer_index", "elif", "isinstance", "(", "loc", ",", "int", ")", ":", "return", "loc", "elif", "isinstance", "(", "loc", ",", "...
Return index of the render window given a location index. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. Returns ------- idx : int Index of the ren...
[ "Return", "index", "of", "the", "render", "window", "given", "a", "location", "index", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1222-L1244
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.index_to_loc
def index_to_loc(self, index): """Convert a 1D index location to the 2D location on the plotting grid """ sz = int(self.shape[0] * self.shape[1]) idxs = np.array([i for i in range(sz)], dtype=int).reshape(self.shape) args = np.argwhere(idxs == index) if len(args) < 1: ...
python
def index_to_loc(self, index): """Convert a 1D index location to the 2D location on the plotting grid """ sz = int(self.shape[0] * self.shape[1]) idxs = np.array([i for i in range(sz)], dtype=int).reshape(self.shape) args = np.argwhere(idxs == index) if len(args) < 1: ...
[ "def", "index_to_loc", "(", "self", ",", "index", ")", ":", "sz", "=", "int", "(", "self", ".", "shape", "[", "0", "]", "*", "self", ".", "shape", "[", "1", "]", ")", "idxs", "=", "np", ".", "array", "(", "[", "i", "for", "i", "in", "range", ...
Convert a 1D index location to the 2D location on the plotting grid
[ "Convert", "a", "1D", "index", "location", "to", "the", "2D", "location", "on", "the", "plotting", "grid" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1246-L1254
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_axes_at_origin
def add_axes_at_origin(self, loc=None): """ Add axes actor at the origin of a render window. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. When None, defaults to the ...
python
def add_axes_at_origin(self, loc=None): """ Add axes actor at the origin of a render window. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. When None, defaults to the ...
[ "def", "add_axes_at_origin", "(", "self", ",", "loc", "=", "None", ")", ":", "self", ".", "_active_renderer_index", "=", "self", ".", "loc_to_index", "(", "loc", ")", "return", "self", ".", "renderers", "[", "self", ".", "_active_renderer_index", "]", ".", ...
Add axes actor at the origin of a render window. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. When None, defaults to the active render window. Returns -...
[ "Add", "axes", "actor", "at", "the", "origin", "of", "a", "render", "window", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1262-L1279
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.remove_bounding_box
def remove_bounding_box(self, loc=None): """ Removes bounding box from the active renderer. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. If None, selects the last ...
python
def remove_bounding_box(self, loc=None): """ Removes bounding box from the active renderer. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. If None, selects the last ...
[ "def", "remove_bounding_box", "(", "self", ",", "loc", "=", "None", ")", ":", "self", ".", "_active_renderer_index", "=", "self", ".", "loc_to_index", "(", "loc", ")", "renderer", "=", "self", ".", "renderers", "[", "self", ".", "_active_renderer_index", "]"...
Removes bounding box from the active renderer. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. If None, selects the last active Renderer.
[ "Removes", "bounding", "box", "from", "the", "active", "renderer", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1460-L1473
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.remove_bounds_axes
def remove_bounds_axes(self, loc=None): """ Removes bounds axes from the active renderer. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. If None, selects the last ...
python
def remove_bounds_axes(self, loc=None): """ Removes bounds axes from the active renderer. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. If None, selects the last ...
[ "def", "remove_bounds_axes", "(", "self", ",", "loc", "=", "None", ")", ":", "self", ".", "_active_renderer_index", "=", "self", ".", "loc_to_index", "(", "loc", ")", "renderer", "=", "self", ".", "renderers", "[", "self", ".", "_active_renderer_index", "]",...
Removes bounds axes from the active renderer. Parameters ---------- loc : int, tuple, or list Index of the renderer to add the actor to. For example, ``loc=2`` or ``loc=(1, 1)``. If None, selects the last active Renderer.
[ "Removes", "bounds", "axes", "from", "the", "active", "renderer", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1475-L1488
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.subplot
def subplot(self, index_x, index_y): """ Sets the active subplot. Parameters ---------- index_x : int Index of the subplot to activate in the x direction. index_y : int Index of the subplot to activate in the y direction. """ sel...
python
def subplot(self, index_x, index_y): """ Sets the active subplot. Parameters ---------- index_x : int Index of the subplot to activate in the x direction. index_y : int Index of the subplot to activate in the y direction. """ sel...
[ "def", "subplot", "(", "self", ",", "index_x", ",", "index_y", ")", ":", "self", ".", "_active_renderer_index", "=", "self", ".", "loc_to_index", "(", "(", "index_x", ",", "index_y", ")", ")" ]
Sets the active subplot. Parameters ---------- index_x : int Index of the subplot to activate in the x direction. index_y : int Index of the subplot to activate in the y direction.
[ "Sets", "the", "active", "subplot", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1490-L1503
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.show_grid
def show_grid(self, **kwargs): """ A wrapped implementation of ``show_bounds`` to change default behaviour to use gridlines and showing the axes labels on the outer edges. This is intended to be silimar to ``matplotlib``'s ``grid`` function. """ kwargs.setdefault(...
python
def show_grid(self, **kwargs): """ A wrapped implementation of ``show_bounds`` to change default behaviour to use gridlines and showing the axes labels on the outer edges. This is intended to be silimar to ``matplotlib``'s ``grid`` function. """ kwargs.setdefault(...
[ "def", "show_grid", "(", "self", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "'grid'", ",", "'back'", ")", "kwargs", ".", "setdefault", "(", "'location'", ",", "'outer'", ")", "kwargs", ".", "setdefault", "(", "'ticks'", ",", "...
A wrapped implementation of ``show_bounds`` to change default behaviour to use gridlines and showing the axes labels on the outer edges. This is intended to be silimar to ``matplotlib``'s ``grid`` function.
[ "A", "wrapped", "implementation", "of", "show_bounds", "to", "change", "default", "behaviour", "to", "use", "gridlines", "and", "showing", "the", "axes", "labels", "on", "the", "outer", "edges", ".", "This", "is", "intended", "to", "be", "silimar", "to", "ma...
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1505-L1515
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.set_scale
def set_scale(self, xscale=None, yscale=None, zscale=None, reset_camera=True): """ Scale all the datasets in the scene of the active renderer. Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one. Parameters ...
python
def set_scale(self, xscale=None, yscale=None, zscale=None, reset_camera=True): """ Scale all the datasets in the scene of the active renderer. Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one. Parameters ...
[ "def", "set_scale", "(", "self", ",", "xscale", "=", "None", ",", "yscale", "=", "None", ",", "zscale", "=", "None", ",", "reset_camera", "=", "True", ")", ":", "self", ".", "renderer", ".", "set_scale", "(", "xscale", ",", "yscale", ",", "zscale", "...
Scale all the datasets in the scene of the active renderer. Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one. Parameters ---------- xscale : float, optional Scaling of the x axis. Must be greater th...
[ "Scale", "all", "the", "datasets", "in", "the", "scene", "of", "the", "active", "renderer", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1517-L1539
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter._update_axes_color
def _update_axes_color(self, color): """Internal helper to set the axes label color""" prop_x = self.axes_actor.GetXAxisCaptionActor2D().GetCaptionTextProperty() prop_y = self.axes_actor.GetYAxisCaptionActor2D().GetCaptionTextProperty() prop_z = self.axes_actor.GetZAxisCaptionActor2D().G...
python
def _update_axes_color(self, color): """Internal helper to set the axes label color""" prop_x = self.axes_actor.GetXAxisCaptionActor2D().GetCaptionTextProperty() prop_y = self.axes_actor.GetYAxisCaptionActor2D().GetCaptionTextProperty() prop_z = self.axes_actor.GetZAxisCaptionActor2D().G...
[ "def", "_update_axes_color", "(", "self", ",", "color", ")", ":", "prop_x", "=", "self", ".", "axes_actor", ".", "GetXAxisCaptionActor2D", "(", ")", ".", "GetCaptionTextProperty", "(", ")", "prop_y", "=", "self", ".", "axes_actor", ".", "GetYAxisCaptionActor2D",...
Internal helper to set the axes label color
[ "Internal", "helper", "to", "set", "the", "axes", "label", "color" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1546-L1557
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.update_scalars
def update_scalars(self, scalars, mesh=None, render=True): """ Updates scalars of the an object in the plotter. Parameters ---------- scalars : np.ndarray Scalars to replace existing scalars. mesh : vtk.PolyData or vtk.UnstructuredGrid, optional ...
python
def update_scalars(self, scalars, mesh=None, render=True): """ Updates scalars of the an object in the plotter. Parameters ---------- scalars : np.ndarray Scalars to replace existing scalars. mesh : vtk.PolyData or vtk.UnstructuredGrid, optional ...
[ "def", "update_scalars", "(", "self", ",", "scalars", ",", "mesh", "=", "None", ",", "render", "=", "True", ")", ":", "if", "mesh", "is", "None", ":", "mesh", "=", "self", ".", "mesh", "if", "isinstance", "(", "mesh", ",", "(", "collections", ".", ...
Updates scalars of the an object in the plotter. Parameters ---------- scalars : np.ndarray Scalars to replace existing scalars. mesh : vtk.PolyData or vtk.UnstructuredGrid, optional Object that has already been added to the Plotter. If None, uses l...
[ "Updates", "scalars", "of", "the", "an", "object", "in", "the", "plotter", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1809-L1867
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.update_coordinates
def update_coordinates(self, points, mesh=None, render=True): """ Updates the points of the an object in the plotter. Parameters ---------- points : np.ndarray Points to replace existing points. mesh : vtk.PolyData or vtk.UnstructuredGrid, optional ...
python
def update_coordinates(self, points, mesh=None, render=True): """ Updates the points of the an object in the plotter. Parameters ---------- points : np.ndarray Points to replace existing points. mesh : vtk.PolyData or vtk.UnstructuredGrid, optional ...
[ "def", "update_coordinates", "(", "self", ",", "points", ",", "mesh", "=", "None", ",", "render", "=", "True", ")", ":", "if", "mesh", "is", "None", ":", "mesh", "=", "self", ".", "mesh", "mesh", ".", "points", "=", "points", "if", "render", ":", "...
Updates the points of the an object in the plotter. Parameters ---------- points : np.ndarray Points to replace existing points. mesh : vtk.PolyData or vtk.UnstructuredGrid, optional Object that has already been added to the Plotter. If None, uses l...
[ "Updates", "the", "points", "of", "the", "an", "object", "in", "the", "plotter", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1869-L1892
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.close
def close(self): """ closes render window """ # must close out axes marker if hasattr(self, 'axes_widget'): del self.axes_widget # reset scalar bar stuff self._scalar_bar_slots = set(range(MAX_N_COLOR_BARS)) self._scalar_bar_slot_lookup = {} self._sca...
python
def close(self): """ closes render window """ # must close out axes marker if hasattr(self, 'axes_widget'): del self.axes_widget # reset scalar bar stuff self._scalar_bar_slots = set(range(MAX_N_COLOR_BARS)) self._scalar_bar_slot_lookup = {} self._sca...
[ "def", "close", "(", "self", ")", ":", "# must close out axes marker", "if", "hasattr", "(", "self", ",", "'axes_widget'", ")", ":", "del", "self", ".", "axes_widget", "# reset scalar bar stuff", "self", ".", "_scalar_bar_slots", "=", "set", "(", "range", "(", ...
closes render window
[ "closes", "render", "window" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1894-L1925
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_text
def add_text(self, text, position=None, font_size=50, color=None, font=None, shadow=False, name=None, loc=None): """ Adds text to plot object in the top left corner by default Parameters ---------- text : str The text to add the the rendering ...
python
def add_text(self, text, position=None, font_size=50, color=None, font=None, shadow=False, name=None, loc=None): """ Adds text to plot object in the top left corner by default Parameters ---------- text : str The text to add the the rendering ...
[ "def", "add_text", "(", "self", ",", "text", ",", "position", "=", "None", ",", "font_size", "=", "50", ",", "color", "=", "None", ",", "font", "=", "None", ",", "shadow", "=", "False", ",", "name", "=", "None", ",", "loc", "=", "None", ")", ":",...
Adds text to plot object in the top left corner by default Parameters ---------- text : str The text to add the the rendering position : tuple(float) Length 2 tuple of the pixelwise position to place the bottom left corner of the text box. Default is...
[ "Adds", "text", "to", "plot", "object", "in", "the", "top", "left", "corner", "by", "default" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1927-L1984
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.open_movie
def open_movie(self, filename, framerate=24): """ Establishes a connection to the ffmpeg writer Parameters ---------- filename : str Filename of the movie to open. Filename should end in mp4, but other filetypes may be supported. See "imagio.get_writer"...
python
def open_movie(self, filename, framerate=24): """ Establishes a connection to the ffmpeg writer Parameters ---------- filename : str Filename of the movie to open. Filename should end in mp4, but other filetypes may be supported. See "imagio.get_writer"...
[ "def", "open_movie", "(", "self", ",", "filename", ",", "framerate", "=", "24", ")", ":", "if", "isinstance", "(", "vtki", ".", "FIGURE_PATH", ",", "str", ")", "and", "not", "os", ".", "path", ".", "isabs", "(", "filename", ")", ":", "filename", "=",...
Establishes a connection to the ffmpeg writer Parameters ---------- filename : str Filename of the movie to open. Filename should end in mp4, but other filetypes may be supported. See "imagio.get_writer" framerate : int, optional Frames per second.
[ "Establishes", "a", "connection", "to", "the", "ffmpeg", "writer" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L1986-L2002
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.open_gif
def open_gif(self, filename): """ Open a gif file. Parameters ---------- filename : str Filename of the gif to open. Filename must end in gif. """ if filename[-3:] != 'gif': raise Exception('Unsupported filetype. Must end in .gif') ...
python
def open_gif(self, filename): """ Open a gif file. Parameters ---------- filename : str Filename of the gif to open. Filename must end in gif. """ if filename[-3:] != 'gif': raise Exception('Unsupported filetype. Must end in .gif') ...
[ "def", "open_gif", "(", "self", ",", "filename", ")", ":", "if", "filename", "[", "-", "3", ":", "]", "!=", "'gif'", ":", "raise", "Exception", "(", "'Unsupported filetype. Must end in .gif'", ")", "if", "isinstance", "(", "vtki", ".", "FIGURE_PATH", ",", ...
Open a gif file. Parameters ---------- filename : str Filename of the gif to open. Filename must end in gif.
[ "Open", "a", "gif", "file", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2004-L2019
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.write_frame
def write_frame(self): """ Writes a single frame to the movie file """ if not hasattr(self, 'mwriter'): raise AssertionError('This plotter has not opened a movie or GIF file.') self.mwriter.append_data(self.image)
python
def write_frame(self): """ Writes a single frame to the movie file """ if not hasattr(self, 'mwriter'): raise AssertionError('This plotter has not opened a movie or GIF file.') self.mwriter.append_data(self.image)
[ "def", "write_frame", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'mwriter'", ")", ":", "raise", "AssertionError", "(", "'This plotter has not opened a movie or GIF file.'", ")", "self", ".", "mwriter", ".", "append_data", "(", "self", ".",...
Writes a single frame to the movie file
[ "Writes", "a", "single", "frame", "to", "the", "movie", "file" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2021-L2025
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_lines
def add_lines(self, lines, color=(1, 1, 1), width=5, label=None, name=None): """ Adds lines to the plotting object. Parameters ---------- lines : np.ndarray or vtki.PolyData Points representing line segments. For example, two line segments would be repre...
python
def add_lines(self, lines, color=(1, 1, 1), width=5, label=None, name=None): """ Adds lines to the plotting object. Parameters ---------- lines : np.ndarray or vtki.PolyData Points representing line segments. For example, two line segments would be repre...
[ "def", "add_lines", "(", "self", ",", "lines", ",", "color", "=", "(", "1", ",", "1", ",", "1", ")", ",", "width", "=", "5", ",", "label", "=", "None", ",", "name", "=", "None", ")", ":", "if", "not", "isinstance", "(", "lines", ",", "np", "....
Adds lines to the plotting object. Parameters ---------- lines : np.ndarray or vtki.PolyData Points representing line segments. For example, two line segments would be represented as: np.array([[0, 0, 0], [1, 0, 0], [1, 0, 0], [1, 1, 0]]) color : s...
[ "Adds", "lines", "to", "the", "plotting", "object", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2081-L2142
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.remove_scalar_bar
def remove_scalar_bar(self): """ Removes scalar bar """ if hasattr(self, 'scalar_bar'): self.remove_actor(self.scalar_bar, reset_camera=False)
python
def remove_scalar_bar(self): """ Removes scalar bar """ if hasattr(self, 'scalar_bar'): self.remove_actor(self.scalar_bar, reset_camera=False)
[ "def", "remove_scalar_bar", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'scalar_bar'", ")", ":", "self", ".", "remove_actor", "(", "self", ".", "scalar_bar", ",", "reset_camera", "=", "False", ")" ]
Removes scalar bar
[ "Removes", "scalar", "bar" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2144-L2147
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_point_labels
def add_point_labels(self, points, labels, italic=False, bold=True, font_size=None, text_color='k', font_family=None, shadow=False, show_points=True, point_color='k', point_size=5, name=None): """ Creates...
python
def add_point_labels(self, points, labels, italic=False, bold=True, font_size=None, text_color='k', font_family=None, shadow=False, show_points=True, point_color='k', point_size=5, name=None): """ Creates...
[ "def", "add_point_labels", "(", "self", ",", "points", ",", "labels", ",", "italic", "=", "False", ",", "bold", "=", "True", ",", "font_size", "=", "None", ",", "text_color", "=", "'k'", ",", "font_family", "=", "None", ",", "shadow", "=", "False", ","...
Creates a point actor with one label from list labels assigned to each point. Parameters ---------- points : np.ndarray n x 3 numpy array of points. labels : list List of labels. Must be the same length as points. italic : bool, optional ...
[ "Creates", "a", "point", "actor", "with", "one", "label", "from", "list", "labels", "assigned", "to", "each", "point", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2149-L2257
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_arrows
def add_arrows(self, cent, direction, mag=1, **kwargs): """ Adds arrows to plotting object """ direction = direction.copy() if cent.ndim != 2: cent = cent.reshape((-1, 3)) if direction.ndim != 2: direction = direction.reshape((-1, 3)) direction[:,0] *= m...
python
def add_arrows(self, cent, direction, mag=1, **kwargs): """ Adds arrows to plotting object """ direction = direction.copy() if cent.ndim != 2: cent = cent.reshape((-1, 3)) if direction.ndim != 2: direction = direction.reshape((-1, 3)) direction[:,0] *= m...
[ "def", "add_arrows", "(", "self", ",", "cent", ",", "direction", ",", "mag", "=", "1", ",", "*", "*", "kwargs", ")", ":", "direction", "=", "direction", ".", "copy", "(", ")", "if", "cent", ".", "ndim", "!=", "2", ":", "cent", "=", "cent", ".", ...
Adds arrows to plotting object
[ "Adds", "arrows", "to", "plotting", "object" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2264-L2289
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter._save_image
def _save_image(image, filename, return_img=None): """Internal helper for saving a NumPy image array""" if not image.size: raise Exception('Empty image. Have you run plot() first?') # write screenshot to file if isinstance(filename, str): if isinstance(vtki.FIGU...
python
def _save_image(image, filename, return_img=None): """Internal helper for saving a NumPy image array""" if not image.size: raise Exception('Empty image. Have you run plot() first?') # write screenshot to file if isinstance(filename, str): if isinstance(vtki.FIGU...
[ "def", "_save_image", "(", "image", ",", "filename", ",", "return_img", "=", "None", ")", ":", "if", "not", "image", ".", "size", ":", "raise", "Exception", "(", "'Empty image. Have you run plot() first?'", ")", "# write screenshot to file", "if", "isinstance", "...
Internal helper for saving a NumPy image array
[ "Internal", "helper", "for", "saving", "a", "NumPy", "image", "array" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2293-L2306
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.screenshot
def screenshot(self, filename=None, transparent_background=None, return_img=None, window_size=None): """ Takes screenshot at current camera position Parameters ---------- filename : str, optional Location to write image to. If None, no image is wr...
python
def screenshot(self, filename=None, transparent_background=None, return_img=None, window_size=None): """ Takes screenshot at current camera position Parameters ---------- filename : str, optional Location to write image to. If None, no image is wr...
[ "def", "screenshot", "(", "self", ",", "filename", "=", "None", ",", "transparent_background", "=", "None", ",", "return_img", "=", "None", ",", "window_size", "=", "None", ")", ":", "if", "window_size", "is", "not", "None", ":", "self", ".", "window_size"...
Takes screenshot at current camera position Parameters ---------- filename : str, optional Location to write image to. If None, no image is written. transparent_background : bool, optional Makes the background transparent. Default False. return_img : ...
[ "Takes", "screenshot", "at", "current", "camera", "position" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2308-L2369
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.add_legend
def add_legend(self, labels=None, bcolor=(0.5, 0.5, 0.5), border=False, size=None, name=None): """ Adds a legend to render window. Entries must be a list containing one string and color entry for each item. Parameters ---------- labels : list, optiona...
python
def add_legend(self, labels=None, bcolor=(0.5, 0.5, 0.5), border=False, size=None, name=None): """ Adds a legend to render window. Entries must be a list containing one string and color entry for each item. Parameters ---------- labels : list, optiona...
[ "def", "add_legend", "(", "self", ",", "labels", "=", "None", ",", "bcolor", "=", "(", "0.5", ",", "0.5", ",", "0.5", ")", ",", "border", "=", "False", ",", "size", "=", "None", ",", "name", "=", "None", ")", ":", "self", ".", "legend", "=", "v...
Adds a legend to render window. Entries must be a list containing one string and color entry for each item. Parameters ---------- labels : list, optional When set to None, uses existing labels as specified by - add_mesh - add_lines - add...
[ "Adds", "a", "legend", "to", "render", "window", ".", "Entries", "must", "be", "a", "list", "containing", "one", "string", "and", "color", "entry", "for", "each", "item", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2371-L2479
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.set_background
def set_background(self, color, loc='all'): """ Sets background color Parameters ---------- color : string or 3 item list, optional, defaults to white Either a string, rgb list, or hex color string. For example: color='white' color='w...
python
def set_background(self, color, loc='all'): """ Sets background color Parameters ---------- color : string or 3 item list, optional, defaults to white Either a string, rgb list, or hex color string. For example: color='white' color='w...
[ "def", "set_background", "(", "self", ",", "color", ",", "loc", "=", "'all'", ")", ":", "if", "color", "is", "None", ":", "color", "=", "rcParams", "[", "'background'", "]", "if", "isinstance", "(", "color", ",", "str", ")", ":", "if", "color", ".", ...
Sets background color Parameters ---------- color : string or 3 item list, optional, defaults to white Either a string, rgb list, or hex color string. For example: color='white' color='w' color=[1, 1, 1] color='#FFFFFF...
[ "Sets", "background", "color" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2533-L2566
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.remove_legend
def remove_legend(self): """ Removes legend actor """ if hasattr(self, 'legend'): self.remove_actor(self.legend, reset_camera=False) self._render()
python
def remove_legend(self): """ Removes legend actor """ if hasattr(self, 'legend'): self.remove_actor(self.legend, reset_camera=False) self._render()
[ "def", "remove_legend", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'legend'", ")", ":", "self", ".", "remove_actor", "(", "self", ".", "legend", ",", "reset_camera", "=", "False", ")", "self", ".", "_render", "(", ")" ]
Removes legend actor
[ "Removes", "legend", "actor" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2578-L2582
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.enable_cell_picking
def enable_cell_picking(self, mesh=None, callback=None): """ Enables picking of cells. Press r to enable retangle based selection. Press "r" again to turn it off. Selection will be saved to self.picked_cells. Uses last input mesh for input Parameters --------...
python
def enable_cell_picking(self, mesh=None, callback=None): """ Enables picking of cells. Press r to enable retangle based selection. Press "r" again to turn it off. Selection will be saved to self.picked_cells. Uses last input mesh for input Parameters --------...
[ "def", "enable_cell_picking", "(", "self", ",", "mesh", "=", "None", ",", "callback", "=", "None", ")", ":", "if", "mesh", "is", "None", ":", "if", "not", "hasattr", "(", "self", ",", "'mesh'", ")", ":", "raise", "Exception", "(", "'Input a mesh into the...
Enables picking of cells. Press r to enable retangle based selection. Press "r" again to turn it off. Selection will be saved to self.picked_cells. Uses last input mesh for input Parameters ---------- mesh : vtk.UnstructuredGrid, optional UnstructuredGrid...
[ "Enables", "picking", "of", "cells", ".", "Press", "r", "to", "enable", "retangle", "based", "selection", ".", "Press", "r", "again", "to", "turn", "it", "off", ".", "Selection", "will", "be", "saved", "to", "self", ".", "picked_cells", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2584-L2624
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.generate_orbital_path
def generate_orbital_path(self, factor=3., n_points=20, viewup=None, z_shift=None): """Genrates an orbital path around the data scene Parameters ---------- facotr : float A scaling factor when biulding the orbital extent n_points : int number of points o...
python
def generate_orbital_path(self, factor=3., n_points=20, viewup=None, z_shift=None): """Genrates an orbital path around the data scene Parameters ---------- facotr : float A scaling factor when biulding the orbital extent n_points : int number of points o...
[ "def", "generate_orbital_path", "(", "self", ",", "factor", "=", "3.", ",", "n_points", "=", "20", ",", "viewup", "=", "None", ",", "z_shift", "=", "None", ")", ":", "if", "viewup", "is", "None", ":", "viewup", "=", "rcParams", "[", "'camera'", "]", ...
Genrates an orbital path around the data scene Parameters ---------- facotr : float A scaling factor when biulding the orbital extent n_points : int number of points on the orbital path viewup : list(float) the normal to the orbital plane ...
[ "Genrates", "an", "orbital", "path", "around", "the", "data", "scene" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2627-L2655
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.orbit_on_path
def orbit_on_path(self, path=None, focus=None, step=0.5, viewup=None, bkg=True): """Orbit on the given path focusing on the focus point Parameters ---------- path : vtki.PolyData Path of orbital points. The order in the points is the order of travel focu...
python
def orbit_on_path(self, path=None, focus=None, step=0.5, viewup=None, bkg=True): """Orbit on the given path focusing on the focus point Parameters ---------- path : vtki.PolyData Path of orbital points. The order in the points is the order of travel focu...
[ "def", "orbit_on_path", "(", "self", ",", "path", "=", "None", ",", "focus", "=", "None", ",", "step", "=", "0.5", ",", "viewup", "=", "None", ",", "bkg", "=", "True", ")", ":", "if", "focus", "is", "None", ":", "focus", "=", "self", ".", "center...
Orbit on the given path focusing on the focus point Parameters ---------- path : vtki.PolyData Path of orbital points. The order in the points is the order of travel focus : list(float) of length 3, optional The point ot focus the camera. st...
[ "Orbit", "on", "the", "given", "path", "focusing", "on", "the", "focus", "point" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2666-L2708
train
vtkiorg/vtki
vtki/plotting.py
BasePlotter.export_vtkjs
def export_vtkjs(self, filename, compress_arrays=False): """ Export the current rendering scene as a VTKjs scene for rendering in a web browser """ if not hasattr(self, 'ren_win'): raise RuntimeError('Export must be called before showing/closing the scene.') i...
python
def export_vtkjs(self, filename, compress_arrays=False): """ Export the current rendering scene as a VTKjs scene for rendering in a web browser """ if not hasattr(self, 'ren_win'): raise RuntimeError('Export must be called before showing/closing the scene.') i...
[ "def", "export_vtkjs", "(", "self", ",", "filename", ",", "compress_arrays", "=", "False", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'ren_win'", ")", ":", "raise", "RuntimeError", "(", "'Export must be called before showing/closing the scene.'", ")", "i...
Export the current rendering scene as a VTKjs scene for rendering in a web browser
[ "Export", "the", "current", "rendering", "scene", "as", "a", "VTKjs", "scene", "for", "rendering", "in", "a", "web", "browser" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2711-L2720
train
vtkiorg/vtki
vtki/plotting.py
Plotter.show
def show(self, title=None, window_size=None, interactive=True, auto_close=True, interactive_update=False, full_screen=False, screenshot=False, return_img=False, use_panel=None): """ Creates plotting window Parameters ---------- title : string, optional ...
python
def show(self, title=None, window_size=None, interactive=True, auto_close=True, interactive_update=False, full_screen=False, screenshot=False, return_img=False, use_panel=None): """ Creates plotting window Parameters ---------- title : string, optional ...
[ "def", "show", "(", "self", ",", "title", "=", "None", ",", "window_size", "=", "None", ",", "interactive", "=", "True", ",", "auto_close", "=", "True", ",", "interactive_update", "=", "False", ",", "full_screen", "=", "False", ",", "screenshot", "=", "F...
Creates plotting window Parameters ---------- title : string, optional Title of plotting window. window_size : list, optional Window size in pixels. Defaults to [1024, 768] interactive : bool, optional Enabled by default. Allows user to pa...
[ "Creates", "plotting", "window" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/plotting.py#L2834-L2958
train
vtkiorg/vtki
vtki/examples/examples.py
load_structured
def load_structured(): """ Loads a simple StructuredGrid """ x = np.arange(-10, 10, 0.25) y = np.arange(-10, 10, 0.25) x, y = np.meshgrid(x, y) r = np.sqrt(x**2 + y**2) z = np.sin(r) return vtki.StructuredGrid(x, y, z)
python
def load_structured(): """ Loads a simple StructuredGrid """ x = np.arange(-10, 10, 0.25) y = np.arange(-10, 10, 0.25) x, y = np.meshgrid(x, y) r = np.sqrt(x**2 + y**2) z = np.sin(r) return vtki.StructuredGrid(x, y, z)
[ "def", "load_structured", "(", ")", ":", "x", "=", "np", ".", "arange", "(", "-", "10", ",", "10", ",", "0.25", ")", "y", "=", "np", ".", "arange", "(", "-", "10", ",", "10", ",", "0.25", ")", "x", ",", "y", "=", "np", ".", "meshgrid", "(",...
Loads a simple StructuredGrid
[ "Loads", "a", "simple", "StructuredGrid" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/examples/examples.py#L53-L60
train
vtkiorg/vtki
vtki/examples/examples.py
plot_ants_plane
def plot_ants_plane(off_screen=False, notebook=None): """ Demonstrate how to create a plot class to plot multiple meshes while adding scalars and text. Plot two ants and airplane """ # load and shrink airplane airplane = vtki.PolyData(planefile) airplane.points /= 10 # pts = airpla...
python
def plot_ants_plane(off_screen=False, notebook=None): """ Demonstrate how to create a plot class to plot multiple meshes while adding scalars and text. Plot two ants and airplane """ # load and shrink airplane airplane = vtki.PolyData(planefile) airplane.points /= 10 # pts = airpla...
[ "def", "plot_ants_plane", "(", "off_screen", "=", "False", ",", "notebook", "=", "None", ")", ":", "# load and shrink airplane", "airplane", "=", "vtki", ".", "PolyData", "(", "planefile", ")", "airplane", ".", "points", "/=", "10", "# pts = airplane.points # gets...
Demonstrate how to create a plot class to plot multiple meshes while adding scalars and text. Plot two ants and airplane
[ "Demonstrate", "how", "to", "create", "a", "plot", "class", "to", "plot", "multiple", "meshes", "while", "adding", "scalars", "and", "text", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/examples/examples.py#L77-L109
train
vtkiorg/vtki
vtki/examples/examples.py
plot_wave
def plot_wave(fps=30, frequency=1, wavetime=3, interactive=False, off_screen=False, notebook=None): """ Plot a 3D moving wave in a render window. Parameters ---------- fps : int, optional Maximum frames per second to display. Defaults to 30. frequency: float, optional ...
python
def plot_wave(fps=30, frequency=1, wavetime=3, interactive=False, off_screen=False, notebook=None): """ Plot a 3D moving wave in a render window. Parameters ---------- fps : int, optional Maximum frames per second to display. Defaults to 30. frequency: float, optional ...
[ "def", "plot_wave", "(", "fps", "=", "30", ",", "frequency", "=", "1", ",", "wavetime", "=", "3", ",", "interactive", "=", "False", ",", "off_screen", "=", "False", ",", "notebook", "=", "None", ")", ":", "# camera position", "cpos", "=", "[", "(", "...
Plot a 3D moving wave in a render window. Parameters ---------- fps : int, optional Maximum frames per second to display. Defaults to 30. frequency: float, optional Wave cycles per second. Defaults to 1 wavetime : float, optional The desired total display time in seconds...
[ "Plot", "a", "3D", "moving", "wave", "in", "a", "render", "window", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/examples/examples.py#L145-L235
train
vtkiorg/vtki
vtki/filters.py
_get_output
def _get_output(algorithm, iport=0, iconnection=0, oport=0, active_scalar=None, active_scalar_field='point'): """A helper to get the algorithm's output and copy input's vtki meta info""" ido = algorithm.GetInputDataObject(iport, iconnection) data = wrap(algorithm.GetOutputDataObject(oport)) ...
python
def _get_output(algorithm, iport=0, iconnection=0, oport=0, active_scalar=None, active_scalar_field='point'): """A helper to get the algorithm's output and copy input's vtki meta info""" ido = algorithm.GetInputDataObject(iport, iconnection) data = wrap(algorithm.GetOutputDataObject(oport)) ...
[ "def", "_get_output", "(", "algorithm", ",", "iport", "=", "0", ",", "iconnection", "=", "0", ",", "oport", "=", "0", ",", "active_scalar", "=", "None", ",", "active_scalar_field", "=", "'point'", ")", ":", "ido", "=", "algorithm", ".", "GetInputDataObject...
A helper to get the algorithm's output and copy input's vtki meta info
[ "A", "helper", "to", "get", "the", "algorithm", "s", "output", "and", "copy", "input", "s", "vtki", "meta", "info" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L44-L52
train
vtkiorg/vtki
vtki/filters.py
_generate_plane
def _generate_plane(normal, origin): """ Returns a vtk.vtkPlane """ plane = vtk.vtkPlane() plane.SetNormal(normal[0], normal[1], normal[2]) plane.SetOrigin(origin[0], origin[1], origin[2]) return plane
python
def _generate_plane(normal, origin): """ Returns a vtk.vtkPlane """ plane = vtk.vtkPlane() plane.SetNormal(normal[0], normal[1], normal[2]) plane.SetOrigin(origin[0], origin[1], origin[2]) return plane
[ "def", "_generate_plane", "(", "normal", ",", "origin", ")", ":", "plane", "=", "vtk", ".", "vtkPlane", "(", ")", "plane", ".", "SetNormal", "(", "normal", "[", "0", "]", ",", "normal", "[", "1", "]", ",", "normal", "[", "2", "]", ")", "plane", "...
Returns a vtk.vtkPlane
[ "Returns", "a", "vtk", ".", "vtkPlane" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L55-L60
train
vtkiorg/vtki
vtki/filters.py
DataSetFilters.clip
def clip(dataset, normal='x', origin=None, invert=True): """ Clip a dataset by a plane by specifying the origin and normal. If no parameters are given the clip will occur in the center of that dataset Parameters ---------- normal : tuple(float) or str Length ...
python
def clip(dataset, normal='x', origin=None, invert=True): """ Clip a dataset by a plane by specifying the origin and normal. If no parameters are given the clip will occur in the center of that dataset Parameters ---------- normal : tuple(float) or str Length ...
[ "def", "clip", "(", "dataset", ",", "normal", "=", "'x'", ",", "origin", "=", "None", ",", "invert", "=", "True", ")", ":", "if", "isinstance", "(", "normal", ",", "str", ")", ":", "normal", "=", "NORMALS", "[", "normal", ".", "lower", "(", ")", ...
Clip a dataset by a plane by specifying the origin and normal. If no parameters are given the clip will occur in the center of that dataset Parameters ---------- normal : tuple(float) or str Length 3 tuple for the normal vector direction. Can also be specified as...
[ "Clip", "a", "dataset", "by", "a", "plane", "by", "specifying", "the", "origin", "and", "normal", ".", "If", "no", "parameters", "are", "given", "the", "clip", "will", "occur", "in", "the", "center", "of", "that", "dataset" ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L73-L106
train
vtkiorg/vtki
vtki/filters.py
DataSetFilters.clip_box
def clip_box(dataset, bounds=None, invert=True, factor=0.35): """Clips a dataset by a bounding box defined by the bounds. If no bounds are given, a corner of the dataset bounds will be removed. Parameters ---------- bounds : tuple(float) Length 6 iterable of floats: ...
python
def clip_box(dataset, bounds=None, invert=True, factor=0.35): """Clips a dataset by a bounding box defined by the bounds. If no bounds are given, a corner of the dataset bounds will be removed. Parameters ---------- bounds : tuple(float) Length 6 iterable of floats: ...
[ "def", "clip_box", "(", "dataset", ",", "bounds", "=", "None", ",", "invert", "=", "True", ",", "factor", "=", "0.35", ")", ":", "if", "bounds", "is", "None", ":", "def", "_get_quarter", "(", "dmin", ",", "dmax", ")", ":", "\"\"\"internal helper to get a...
Clips a dataset by a bounding box defined by the bounds. If no bounds are given, a corner of the dataset bounds will be removed. Parameters ---------- bounds : tuple(float) Length 6 iterable of floats: (xmin, xmax, ymin, ymax, zmin, zmax) invert : bool F...
[ "Clips", "a", "dataset", "by", "a", "bounding", "box", "defined", "by", "the", "bounds", ".", "If", "no", "bounds", "are", "given", "a", "corner", "of", "the", "dataset", "bounds", "will", "be", "removed", "." ]
5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1
https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/filters.py#L108-L151
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train