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
- fname: This is the file name of the G-code file to be read. If this parameter is empty, a dialog will prompt the user to select a file.
Output Results
- TEXT: This is an array of unsigned characters representing the content of the G-code file.
- s: These are the new line positions within the file.
- fname: The name of the file that was read.
Algorithm Steps
- 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.
- 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.
- 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.
- 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