Syntax
fnames=SGwriteSTLplot(SG,[sname])
Input Parameter
SG : | | Solid Geometry to write as STL |
sname : | | filename for STL file and PNG file |
Output Parameter
fnames : | | filename of STL file |
Examples
SGwriteSTLplot(SGbox,'test')
fourBarposesyntheses(Posesample(26),[1 3 ],[20],'','','isrot, break coll CPLW CPL0, extend CPLM, break length CPL0 < 120'); PS=ans;
Copyright 2021-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, SGwriteSTLplot
, is designed to create an STL file from a given solid geometry and generate a corresponding plot image. It combines functionalities from SGwriteSTL
and SGTplotalpha
.
Input Parameters
- SG: The solid geometry object that needs to be written as an STL file.
- sname (optional): The filename for the STL and PNG files. If not provided, a default name is used.
Output Results
- fnames: A cell array containing the filenames of the generated STL and PNG files.
Algorithm Steps
- Retrieve the filename parameter
sname
using getfuncparams
. If not provided, it defaults to an empty string.
- Call
SGwriteSTL
with the solid geometry SG
and the filename sname
to create the STL file. Store the result in fname
.
- Set up a figure with a specific view using
SGfigure(-30,30)
.
- Plot the solid geometry with transparency using
SGTplotalpha(SG)
.
- Add a title to the plot with the filename and the current date using
title(fname)
and titleappend(datestr(now))
.
- Refresh the plot display with
drawnowvid
and bring the figure window to the front with shg
.
- Capture a snapshot of the current axes and save it to the desktop directory with the filename
sname
using gcasnapshot(gca,desktopdir(sname))
. Store the result in iname
.
- Return a cell array
fnames
containing the filenames of the STL and PNG files.
Algorithm explaination created using ChatGPT on 2025-08-19 00:37. (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