render_step_components_colored_rpath
Kind: Function
Domain: Assembly
Canonical import: from cadflow.inspect.brep import render_step_components_colored_rpath
Signature
def render_step_components_colored_rpath(step_path: 'str | Path', component_colors: 'Mapping[str, ColorSpec]', output_path: 'str | Path', *, palette: 'Sequence[ColorSpec] | None' = None, with_context: 'bool' = True, title: 'str | None' = None, views: 'Sequence[tuple[float, float, str]]' = ((28.0, -45.0, 'isometric'), (90.0, -90.0, 'top / X-Y'), (0.0, -90.0, 'front / X-Z'), (0.0, 0.0, 'side / Y-Z')), image_size: 'tuple[float, float]' = (18.0, 12.0), dpi: 'int' = 180, linear_deflection: 'float' = 0.12, angular_deflection: 'float' = 0.18, show_legend: 'bool' = True) -> 'Path'
Description
Render multiple STEP components, each in its own color.
Render multiple STEP components, each in its own color.
The recommended, most semantic form maps each component selector directly to a color NAME::
render_step_components_colored_rpath( "assembly.step", {"SPK-2030X4MM": "cyan", "USER_LIBRARY-USB_TYPE_C_PORT__S": "purple"}, "out.png", )
Selectors resolve like render_step_components_rpath (names, paths, or node ids) and multiple occurrences of one name share its color. component_colors values accept a named color from the built-in set (red, crimson, orange, gold, yellow, lime, green, teal, cyan, skyblue, blue, navy, purple, violet, magenta, pink, salmon, brown, tan, olive, gray, silver, black, white), a #RRGGBB / #RGB hex string, an (r, g, b) 0..1 tuple, or an integer palette index (with palette). The result shows every selected solid at once, color-coded, with an optional color legend so the geometry can be matched to per-component text.
Parameters
| Name | Type | Required | Default | Source description |
|---|---|---|---|---|
step_path | 'str | Path' | yes | - | Not explicitly described in the source docstring. |
component_colors | 'Mapping[str, ColorSpec]' | yes | - | Not explicitly described in the source docstring. |
output_path | 'str | Path' | yes | - | Not explicitly described in the source docstring. |
palette | 'Sequence[ColorSpec] | None' | no | None | Not explicitly described in the source docstring. |
with_context | 'bool' | no | True | Not explicitly described in the source docstring. |
title | 'str | None' | no | None | Not explicitly described in the source docstring. |
views | 'Sequence[tuple[float, float, str]]' | no | ((28.0, -45.0, 'isometric'), (90.0, -90.0, 'top / X-Y'), (0.0, -90.0, 'front / X-Z'), (0.0, 0.0, 'side / Y-Z')) | Not explicitly described in the source docstring. |
image_size | 'tuple[float, float]' | no | (18.0, 12.0) | Not explicitly described in the source docstring. |
dpi | 'int' | no | 180 | Not explicitly described in the source docstring. |
linear_deflection | 'float' | no | 0.12 | Not explicitly described in the source docstring. |
angular_deflection | 'float' | no | 0.18 | Not explicitly described in the source docstring. |
show_legend | 'bool' | no | True | Not explicitly described in the source docstring. |
Returns
Type: 'Path'
The source docstring does not declare additional return semantics.
Errors
The source docstring does not declare a narrower exception contract. Invalid types, values, ownership, paths, or backend state may still raise the corresponding public error.
Behavior and constraints
- This operation writes an external artifact. Validate the returned path or output file before delivery.
Import check
from cadflow.inspect.brep import render_step_components_colored_rpath