Rhoban / onshape-to-robot

Converting OnShape assembly to robot definition (SDF or URDF) through OnShape API
MIT License
231 stars 49 forks source link

Windows openSCAD detection and color output fix #107

Closed csamid closed 10 months ago

csamid commented 10 months ago

What

This pull request: 1) enables OpenSCAD detection on Windows 2) resolves a color output inconsistency issue on Windows consoles.

Why

1) OpenSCAD detection was not available on Windows systems. 2) OpenSCAD detection changes introduced a color output inconsistencies on Windows consoles.

How

OpenSCAD Detection

I replaced os.system() with subprocess.run() for executing openscad -v

Colorama Solution

Calls just_fix_windows_console() function from the colorama library to address the color output inconsistency.

Visual Demos

Screenshots below illustrate the impact of the changes. These showcase code output comparisons before and after the modifications. It covers both Windows and Linux environments while OpenSCAD is installed

Before and After Screenshots

  1. Windows Before - Unable to detect
  2. Windows After 1. - Color output inconsistency
  3. Windows After 1. and 2. - Consistent color output
  4. Linux (wsl2) Before - Works
  5. Linux (wsl2) After - Still works
Gregwar commented 10 months ago

Hello,

Seems good to me, only we know to update requirements.txt and setup.py to depend on colorama >= 0.4.6 which includes just_fix_window_console. I will merge, do it and repackage

Gregwar commented 10 months ago

Updated dependency and uploaded upstream v0.3.20

Gregwar commented 10 months ago

Can you confirm me it's working ?

csamid commented 10 months ago

It works!