{"id":20926217,"url":"https://github.com/purge12/g-code-visualisation-using-python","last_synced_at":"2026-04-16T04:33:40.431Z","repository":{"id":211551076,"uuid":"729438857","full_name":"pUrGe12/G-code-visualisation-using-python","owner":"pUrGe12","description":"A script that will sketch the shapes made by G-codes used in CNC machines using Python using python's turtle and regular expressions (re) library.","archived":false,"fork":false,"pushed_at":"2023-12-12T07:39:10.000Z","size":49,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T22:43:27.545Z","etag":null,"topics":["g-codes","python","turtle-graphics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pUrGe12.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-09T08:22:53.000Z","updated_at":"2025-03-16T02:40:29.000Z","dependencies_parsed_at":"2024-11-19T06:01:11.446Z","dependency_job_id":null,"html_url":"https://github.com/pUrGe12/G-code-visualisation-using-python","commit_stats":null,"previous_names":["purge12/g-code-translator-on-python","purge12/g-code-translation-using-python","purge12/g-code-visualisation-using-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pUrGe12/G-code-visualisation-using-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pUrGe12%2FG-code-visualisation-using-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pUrGe12%2FG-code-visualisation-using-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pUrGe12%2FG-code-visualisation-using-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pUrGe12%2FG-code-visualisation-using-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pUrGe12","download_url":"https://codeload.github.com/pUrGe12/G-code-visualisation-using-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pUrGe12%2FG-code-visualisation-using-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31871683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["g-codes","python","turtle-graphics"],"created_at":"2024-11-18T20:37:16.684Z","updated_at":"2026-04-16T04:33:40.407Z","avatar_url":"https://github.com/pUrGe12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Project: to visualise G-codes used by CNC machines using python.\n\nAim is to trace the shape given by the G-code commands. Hence, I will skip over the Z axis line codes, and ignore the M-codes related to spindle movements and cutting.\nThe speed of the movements defined by G00 and G01 will be predefined and variable depending on user.\n\nPreassumtions:\n1. G17 (XY plane) unless G18 or G19 specified.\n2. G40 --\u003e cancel cutter compensation (since we are only tracing)\n3. G64 --\u003e continous path mode (tolerance may be specified)\n\nThe G-codes taken into consideration are:\n1. G00 --\u003e rapid move from (x,y) to (x+x0, y+y0), may not be a straight line motion (goto specific position while not sketching)\n2. G01 --\u003e controlled move from (x,y) to (x+x0, y+y0), straight line motion\n3. G02 --\u003e clockwise curve\n4. G03 --\u003e anti-clockwise curve\n5. G21 --\u003e metric mode\n6. G20 --\u003e imperial mode \n7. G90 --\u003e absolute distancing\n8. G91 --\u003e incremental distancing\n9. G94 --\u003e feed rate in inches/mm per min\n10. G53 --\u003e machine coordinates\n11. G54 --\u003e coordinate system\n12. G64 --\u003e specify tolerance (P)\n\nNote: Since machine configuration, kinematics and control systems are unknown, I will be assuming the G00 command to be the same as G01 command, i.e. a straight line motion. (Not that it would matter anyway, since G00 is for positioning) \n\nThe M-codes and letter codes taken into consideration are:\n1. M0 --\u003e pause machine\n2. M2 --\u003e end program\n3. M30 --\u003e end program and loop to first line\n4. R --\u003e radius in G02 and G03\n5. X --\u003e x coordinate specification\n6. Y --\u003e y coordinate specification\n7. N --\u003e line number\n8. I --\u003e radius specification for a circle\n\nThe libraries used in python are turtle, re (regular expressions) and math. Note, for the code to run, you need the turtle library.\nTo install turtle use:\n\n  $pip install turtle\n\non the command prompt, or linux terminal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurge12%2Fg-code-visualisation-using-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurge12%2Fg-code-visualisation-using-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurge12%2Fg-code-visualisation-using-python/lists"}