Skip to main content

Extensible G-Code Markup Language Transpiler

Project description

XGML

XGML: eXtensible G-code Markup Language, the lightweight markup language specifically designed for easier prototyping of G-Code, without the complex G commands. Simple tags, no closing tag boilerplate from XML and others (</>).

What does it solve?

It solves having to read clunky G-code, let alone actually... understand it at the same efficiency you would understand XGML. It is also an easy markup language to test 3D-printers, make complex patterns, for people who... just don't have well-established experience with 3D modelling.

Why a Markup Language?

Markup languages are really lightweight, declarative, and serve their simple purposes well.

How to use XGML?

  • Installation

Run:

pip install xgml
  • Transpiling XGML scripts

If cloning from GitHub, just copy the xgmlparse.py file over to your preferred directory.

Run:

xgml FILENAME.xgml
# File is found with the same name, with the .gcode extension.

What 3D printers does it support?

I'm a WASP enthusiast. so the coordinate system is exactly like the one in their printers, though it supports any 3D printer that can process standard Marlin G-Code.

** Two things to keep in mind...

• Print bed size might not match up to the scripts coordinates. Double check before loading onto the printer.

• Some printers require complex start codes, e.g. Bambu Lab X1C

Try it out!

Here, I've written some XGML code (also found here at test/layers.xgml)

<module XGML_3D_TEST_PRINT
    <var print_bed_temp: 60.0>
    <var print_noz_temp: 210.0>
    <var circle_radius: 12.5>
    <var total_layers: 4>

    <temperature nozzle:print_noz_temp bed:print_bed_temp end>
    <fan speed:255 end>

    <path @f4000 end>
    <path x:0.0 y:0.0 z:0.3 e:0.0 end>
    <path x:10.0 y:10.0 z:0.3 e:1.25 end>

    <loop @for total_layers @zstep 0.4
        ; This circle will automatically print higher on every single pass
        <polygon @PREDEF CIRCLE r:circle_radius end>
        
        ; A travel and extrusion path inside the layer loop
        <path x:30.0 y:30.0 e:2.5 end>
        
        ; This square will stack right along with the circle
        <polygon @PREDEF SQUARE size:20.0 end>
    end>

    <fan speed:0 end>
    <temperature nozzle:0.0 bed:0.0 end>
end>

License

This project is licensed under the Apache License 2.0. Feel free to use, modify, distribute, and build upon this core engine for both personal and commercial 3D printing workflows! See the source headers and the LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xgml-1.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xgml-1.0.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file xgml-1.0.3.tar.gz.

File metadata

  • Download URL: xgml-1.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for xgml-1.0.3.tar.gz
Algorithm Hash digest
SHA256 30d318fdf76452276e53740c30b6bf7eddfe9d5bd22eaaecbcd4814ba26f92e6
MD5 7774efaa8e911a378695d460ce0ab035
BLAKE2b-256 8889f7954340cb6120d3b54f2172bfb35e2b1f5492c69908c5fd6afb867f8582

See more details on using hashes here.

File details

Details for the file xgml-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: xgml-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for xgml-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b1db77d521d8aa6de7e51a146add1d1ba48ecdf77c13cde0c27d398a02e45df
MD5 c9994a0fe71caab6e7e746090d9d26f9
BLAKE2b-256 4801007ea04993d31b31e580db6f38f9a1cd574a3e44f23363f1cdff0a48748d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page