Checks color handling for STEP export.
(tmpdir)
| 2508 | |
| 2509 | |
| 2510 | def test_step_color(tmpdir): |
| 2511 | """ |
| 2512 | Checks color handling for STEP export. |
| 2513 | """ |
| 2514 | |
| 2515 | step_color_path = os.path.join(tmpdir, "step_color.step") |
| 2516 | |
| 2517 | # Create a simple assembly with color |
| 2518 | assy = cq.Assembly() |
| 2519 | assy.add(cq.Workplane().box(10, 10, 10), color=cq.Color(0.47, 0.253, 0.18, 1.0)) |
| 2520 | |
| 2521 | success = exportStepMeta(assy, step_color_path) |
| 2522 | assert success |
| 2523 | |
| 2524 | # Read the file as a string and check for the correct colors |
| 2525 | with open(step_color_path, "r") as f: |
| 2526 | step_content = f.readlines() |
| 2527 | |
| 2528 | # Step through and try to find the COLOUR line |
| 2529 | for line in step_content: |
| 2530 | if "COLOUR_RGB(''," in line: |
| 2531 | assert "0.47" in line |
| 2532 | assert "0.25" in line |
| 2533 | assert "0.18" in line |
| 2534 | |
| 2535 | |
| 2536 | def test_special_methods(subshape_assy): |
nothing calls this directly
no test coverage detected