render_step_components_colored_rpath
类型: 函数
领域: 装配
推荐导入: from cadflow.inspect.brep import render_step_components_colored_rpath
签名
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'
功能说明
render_step_components_colored_rpath 是 CadFlow 装配领域的公共函数。
原始 API 说明
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.
参数
| 名称 | 类型 | 必需 | 默认值 | 源码说明 |
|---|---|---|---|---|
step_path | 'str | Path' | 是 | - | 源码 Docstring 未单独说明。 |
component_colors | 'Mapping[str, ColorSpec]' | 是 | - | 源码 Docstring 未单独说明。 |
output_path | 'str | Path' | 是 | - | 源码 Docstring 未单独说明。 |
palette | 'Sequence[ColorSpec] | None' | 否 | None | 源码 Docstring 未单独说明。 |
with_context | 'bool' | 否 | True | 源码 Docstring 未单独说明。 |
title | 'str | None' | 否 | None | 源码 Docstring 未单独说明。 |
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')) | 源码 Docstring 未单独说明。 |
image_size | 'tuple[float, float]' | 否 | (18.0, 12.0) | 源码 Docstring 未单独说明。 |
dpi | 'int' | 否 | 180 | 源码 Docstring 未单独说明。 |
linear_deflection | 'float' | 否 | 0.12 | 源码 Docstring 未单独说明。 |
angular_deflection | 'float' | 否 | 0.18 | 源码 Docstring 未单独说明。 |
show_legend | 'bool' | 否 | True | 源码 Docstring 未单独说明。 |
返回值
类型: 'Path'
源码 Docstring 未声明更多返回语义。
异常
源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。
行为与约束
- 该操作会写入外部产物。交付前应验证返回路径或输出文件。
导入检查
from cadflow.inspect.brep import render_step_components_colored_rpath