SGgcoderead

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - 3D-Print/Production
Introduced first in SolidGeometry 5.0, Creation date: 2020-12-26, Last change: 2025-09-15

reads in a ascii gcode file and creates a line table

Description

extracted from SGgcodesimulate


See Also: , SGgcodesimulate

Example Illustration

 missing image of SGgcoderead(fname)

Syntax

[TEXT,s]=SGgcoderead([fname])

Input Parameter

fname: File Name or empty for dialog

Output Parameter

TEXT: unsigned char
s: new line positions

Examples


SGgcoderead('AP_owl_pair.gcode')




Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, SGgcoderead, is designed to read an ASCII G-code file and create a line table. It is part of the SolidGeometry library and was introduced in version 5.0. The function is primarily used for 3D printing and production tasks.

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by retrieving the file name from the input parameters using getfuncparams. If no file name is provided, it defaults to an empty string.
  2. If the file name is empty, the function uses uigetfile to open a dialog box for the user to select a G-code file. The selected file's path and name are concatenated to form the full file name.
  3. The function then calls readtextfile with the file name to read the content of the G-code file. This function returns the text content, new line positions, and the file name.
  4. If there are no output arguments specified, the function prints a message to the console indicating that the G-code file is being analyzed.

The function is straightforward, focusing on reading and processing a G-code file for further analysis or simulation in 3D printing applications.

Algorithm explaination created using ChatGPT on 2025-08-19 00:01. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21