Syntax
SGN=SGturn4AM(SG)
Input Parameter
Output Parameter
SGN : | | Turned or unchanged Solid |
Examples
SGturn4AM(SGrotate(SGsample(19),'y',pi))
Copyright 2023-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, SGturn4AM
, is designed to adjust the orientation of a solid object for additive manufacturing. It checks if the upper printing surface is larger than the lower floor printing area and rotates the object if necessary.
Input Parameters
- SG: A solid geometry object that represents the 3D model to be evaluated and potentially rotated.
Output Results
- SGN: The solid geometry object that is either turned or remains unchanged based on the evaluation.
Algorithm Steps
- Initialize
SGN
as SG
, assuming no change initially.
- Convert
SG
to a standard format using SGofSG
.
- Determine the bounding box's z-dimensions using
zofBB
with the parameter 'bbz'.
- Set a tolerance value
tol
to 0.05 for slicing precision.
- Calculate the cross-sectional area slightly above the bottom using
CPLofSGslice3
at zz(1) + tol
.
- Calculate the cross-sectional area slightly below the top using
CPLofSGslice3
at zz(2) - tol
.
- Compute the areas of these cross-sections using
CPLarea
.
- Compare the areas: if the bottom area
aO
is greater than the top area aU
, rotate the object 180 degrees around the y-axis using SGrotate
.
- Align the rotated object to the original's center using
SGtransrelSG
.
- If no output is requested, visualize the original and potentially rotated object using
SGfigure
, SGplotalpha
, and CVLplots
.
- Annotate the plot to distinguish between the original and the printing orientation.
Algorithm explaination created using ChatGPT on 2025-08-19 00:49. (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