pyrobopath.toolpath.visualization.matplotlib_backend.visualize_toolpath#
- pyrobopath.toolpath.visualization.matplotlib_backend.visualize_toolpath(toolpath: Toolpath, color_method='tool', color_seq='tab10', show=True)[source]#
Visualize a 3D toolpath using matplotlib.
This function displays a 3D plot of the provided toolpath. Each contour is rendered in space with a color assigned based on a specified color method. Useful for examining path layout, tool usage, or sequencing in a 3D context.
- Parameters:
toolpath (Toolpath) – The toolpath object containing contours to be visualized.
color_method (str, optional) – The strategy used to assign colors to contours. Valid options include ‘tool’, ‘z’, or ‘cycle’. Defaults to ‘tool’.
color_seq (str or list, optional) – The name of the matplotlib colormap or a list of color values to cycle through. Defaults to ‘tab10’.
show (bool, optional) – Whether to immediately display the plot with plt.show(). Defaults to True.
- Returns:
fig (matplotlib.figure.Figure) – The matplotlib figure object containing the plot.
ax (matplotlib.axes._subplots.Axes3DSubplot) – The 3D axes on which the toolpath is drawn.