Detailed Usage

[Top]

Below, the detailed usage of the tool and the standard JSON project file will be explained.

Command line arguments

If the program is executed with -h or --help option, the following quick help will be displayed:

  GCodeGenerator.exe [OPTION...]

  -j, --json-file arg           Project JSON file
  -o, --output-directory arg    Output folder
  -t, --material-thickness arg  Material thickness to cut in mm
  -b, --box-height-3d arg       Box height in 3D in mm
  -d, --cut-depth-per-pass arg  Depth per pass to cut in mm
  -p, --bit-shape arg           Bit shape for drill size compensation:
                                straight, or v-shaped (default: straight)
  -m, --bit-diameter arg        Bit diameter in mm for drill size
                                compensation (default: 0)
  -k, --bit-angle arg           Bit angle in degrees for v-shaped bits for
                                drill size compensation (default: 0)
  -f, --bit-cutter-height arg   Bit cutter height in mm at which the
                                maximum diameter is reached (default: 0)
  -g, --outer-sizing            Box sizes are for outside borders (inner
                                area will be smaller), default: inner
                                sizing
  -r, --recess-depth arg        The depth of recess in mm (Default: no
                                recess) (default: 0)
  -x, --feedrate-x arg          Feedrate to use for x-axis (default: 200)
  -y, --feedrate-y arg          Feedrate to use for y-axis (default: 200)
  -z, --feedrate-z arg          Feedrate to use for z-axis (default: 100)
  -l, --outline                 Enable side outline cutting (default: true)
  -c, --components              Enable component cutting (default: true)
  -e, --screw-size-top arg      Screw diameter for top side in mm (Default:
                                0 - no screws) (default: 0)
  -w, --screw-size-bottom arg   Screw diameter for bottom side in mm
                                (Default: 0 - no screws) (default: 0)
  -i, --screw-head-diameter arg
                                Screw head diameter in mm (default: 0)
  -a, --screw-head-height arg   Screw head height in mm (default: 0)
  -n, --screw-extra-margin arg  Screw extra margin in mm (default: 0)
  -s, --simulate                Simulate, do not write NCs
  -h, --help                    Show this help message and quit

Both short and long versions of the arguments can be used.

The arguments -j, -o, -t, -b, and -d are mandatory. Other arguments have default values as mentioned above. To set an argument to false, use the long version and assign the value false. For example, to disable outline cut, use --outline=false. Similarly, for activation of options, which are disabled by default, only use the argument. For example, to enable simulation, use either -s or --simulate. Argument values can be provided with a space or an equal sign if long versions are used. For instance, both --json-file test.json and --json-file=test.json are valid usage. For short versions, only space allowed, e.g., -b 30.

--json-file

A valid path to JSON file to be used as input. Can be a relative path (starting from the working directory) or an absolute path.

--output-directory

The directory to write the output files to. Using . (dot) will use the current working directory. The final files will be written into a new folder having the name of the --json-file.

--material-thickness

This value is used to calculate the depth required for creating holes for components and/or screws, in conjunction with the --cut-depth-per-pass argument. The value is in millimeters (mm).

Additionally, this value is used to determine the dimensions of the left, right, front, and bottom sides (if enabled) based on whether the --outer-sizing parameter is active. See Coordinate system and effects of sizing parameters for more info.

--box-height-3d

The height of the box in millimeters (mm). If --outer-sizing is used, this will be the outer height of the box. Otherwise, it is the inner height of the box.

--bit-shape

The shape of the endmill/bit/cutter. Currently straight and v-shaped cutters are supported.

Default: straight

--bit-diameter

The diameter of the bit or cutter can affect not only the size of drilled holes but also the overall dimensions of the cuts. This may result in slightly larger or smaller dimensions than intended. G-Code already supports compensation for cutter diameter using specific commands. This argument adjusts the coordinates to account for the bit diameter, ensuring accurate cuts and dimensions in case native compensation is not desired.

Default: 0, no compensation

--bit-angle

Angle in degrees which forms the v-shape. Only effective for v-shaped bits.

Default: 0, straight cutter

--bit-cutter-height

The height of the cutter in mm at which it reaches its maximum cut width. After this height (or after reaching this depth), always --bit-diameter value will be used. Only effective for v-shaped bits. Note that this is not the total height of the bit itself.

Default: 0, straight cutter, starting directly with --bit-diameter width.

--outer-sizing

If used, the sizes defined in the JSON file as well as the --material-thickness and --box-height-3d arguments will be used to create the outer volume with the given dimensions. Otherwise, these values will be used to create the inner volume with the given dimensions.

Default: false, use inner dimensions.

--recess-depth

The depth of the recess for components in millimeters (mm).

Recesses also take the sizing from visible_diameter (priority) or visible_width and visible_height properties. Recesses may be helpful to have slightly lowered shapes to e.g., stabilize or limit the movement of button caps. This value does not change the behavior of the screw head recess (See --screw-head-height).

Default: 0 mm, no recess for the components

Recesses also take the sizing from visible_diameter (priority) or visible_width and visible_height properties. Recesses may be helpful to have slightly lowered shapes to e.g., stabilize or limit the movement of button caps. This value does not change the behavior of the screw head recess (See --screw-head-height).

Default: 0 mm, no recess for the components

--feedrate-x

The speed at which the tool moves during cutting or engraving on x-axis, measured in units per minute (e.g., millimeters per minute). This value is crucial for controlling the precision and quality of the cut, with higher feedrates generally resulting in faster cuts but potentially lower accuracy or finish quality.

Default: 200

--feedrate-y

The speed at which the tool moves during cutting or engraving on y-axis, measured in units per minute (e.g., millimeters per minute). This value is crucial for controlling the precision and quality of the cut, with higher feedrates generally resulting in faster cuts but potentially lower accuracy or finish quality.

Default: 200

--feedrate-z

The speed at which the tool moves during cutting or engraving on z-axis, measured in units per minute (e.g., millimeters per minute). This value is crucial for controlling the precision and quality of the cut, with higher feedrates generally resulting in faster cuts but potentially lower accuracy or finish quality.

Default: 100

--outline

Enables side outline cuts, which adjust the dimensions of the sides according to the given sizes, based on the --outer-sizing property.

Default: true

--components

Enables the component output to cut circles and/or rectangular shapes through the --material-thickness.

Default: true

--screw-size-top

Screw hole diameter to be drawn as hole in millimeters (mm) on the top side of the box.

Default: 0 mm, no screws.

Brown: Screw diameter (or screw size)

--screw-size-bottom

Screw hole diameter to be drawn as hole in millimeters (mm) on the bottom side of the box.

Default: 0 mm, no screws.

Brown: Screw diameter (or screw size)

--screw-head-diameter

If the screws must be counterbore/recessed, any value given in millimeters (mm) (preferably greater than --screw-size-top or --screw-size-bottom) will create a circular shape to bury the head.

Default: 0 mm, protruding screw head.

Red: Screw head diameter

--screw-head-height

The depth of the screw-head to create counterbore/recessed screws given in millimeters (mm).

Default: 0 mm, protruding screw head.

Gray: Screw head height

The images below show how --screw-head-diameter and --screw-head-height affect the creation of screw head related recesses.

--screw-extra-margin

By default, screws are added at the four corners of the top and/or bottom side of the box, leaving a margin of --material-thickness from the sides. If an additional margin is desired, any value given in millimeters (mm) will increase this gap.

Default: 0 mm, no additional margin.

Green: Screw extra margin

--simulate

If used, simulates the settings, without writing to actual files.

Default: false, write to actual files.

--help

Shows the quick help with the list of arguments and their short descriptions.

JSON File

See the definition on this page: MIDILLI JSON File Definition.