Syntax
SGchristmasstar([n,txt,DR])
Input Parameter
n : | | number of corners; default is 7 |
txt : | | name ontop |
DR : | | Diameter; default is 50 |
Examples
SGchristmas(11,'Wiebke',70)
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 algorithm generates a 3D model of a Christmas star and writes it to an STL file for 3D printing. The function is part of the SolidGeometry library and is designed for parametric design.
Input Parameters
- n: Number of corners of the star. Default is 7.
- txt: Text to be placed on top of the star. Default is 'Julia'.
- DR: Diameter of the star. Default is 50 mm.
Algorithm Steps
- Retrieve input parameters using
getfuncparams
function. If not provided, use default values.
- Calculate the radius
R
as half of the diameter DR
.
- Ensure the number of corners
n
is odd. If not, increment n
by 1.
- Create a star shape using
PLstar
function with parameters adjusted for the number of corners and other geometric properties.
- Determine the position
p
based on whether n
is odd or even.
- Create a circular base using
PLcircle
and adjust its position with p
.
- Combine the star and base shapes using
CPLunion
and CPLsubtract
to form the final 2D contour.
- Enhance the contour with radial edges using
CPLradialEdges
.
- Convert the 2D contour to a 3D shape using
SGofCPLz
and rotate it with SGrotate
.
- Create a nameplate with the specified text using
SGNameplate
.
- Align the nameplate with the star using
SGtransrelSG
.
- Visualize the star and nameplate using
SGfigure
and SGplotalpha
.
- Concatenate the star and nameplate into a single object using
SGconcat
.
- Generate a filename based on the text, number of corners, and diameter.
- Write the final 3D model to an STL file using
SGwriteSTL
.
Algorithm explaination created using ChatGPT on 2025-08-19 07:05. (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