Syntax
SG=SGprintPreForm(SG,[ptyp])
Input Parameter
SG : | | Solid Geoemetry to print |
ptyp : | | 'arrange', 'box', 'pack', 'sep' |
Output Parameter
Examples
SGprintPreForm(SGbox)
Copyright 2019-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, SGprintPreForm, is designed to send a Solid Geometry (SG) object to the PreForm application of Formlab for 3D printing. It was developed by Tim Lueth and is part of the VLFL-Lib, introduced in SolidGeometry 4.7.
Input Parameters
- SG: The Solid Geometry object to be printed.
- ptyp: A string parameter that determines the arrangement type. It can be 'arrange', 'box', 'pack', or 'sep'.
Output
- SG: The processed Solid Geometry object.
Algorithm Steps
- Retrieve the arrangement type (ptyp) from the input parameters, defaulting to 'arrange' if not specified.
- Determine the scaling dimensions (sdim). If 'eos' is specified, set sdim to [242, 193, 320]; otherwise, set it to [inf, inf, inf].
- Scale the SG object to the specified dimensions using the SGscale2dim function.
- Generate a filename based on the current date and time, prefixed with 'SGprintjob'.
- Use a switch statement to handle different arrangement types:
- Case 'arrange': Arrange the SG object using SGarrangeSG, write it to an STL file using SGwriteSTL, and update the filename.
- Case 'box': Pack the SG object into a box using SGboxpacking, write it to an STL file, and update the filename.
- Case 'pack': Pack the SG object using SGpacking with 'eos' dimensions, write it to an STL file, and update the filename.
- Case 'sep': Analyze and separate the SG object using SGanalyzeGroupParts and SGpacking with 'eos' dimensions, then write the separated parts to an STL file using SGwriteSeparatedSTL.
- Otherwise: Throw an error if the arrangement type is unknown, suggesting valid options.
- Write the final SG object to an STL file named 'printjob'.
- If the operating system is macOS, open the STL file with PreForm.app using openbydoubleclick.
- If no output is expected (nargout == 0), display the SG object in a figure with specific view settings, plot it, apply flat shading, and add a camera light.
Algorithm explaination created using ChatGPT on 2025-08-19 08:25. (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