SGchristmasstar

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Parametric Design
Introduced first in SolidGeometry 5.0, Creation date: 2020-12-20, Last change: 2025-09-15

writes a STL file for Printing a christmas star

Example Illustration

 missing image of SGchristmasstar(n,txt,DR)

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

Algorithm Steps

  1. Retrieve input parameters using getfuncparams function. If not provided, use default values.
  2. Calculate the radius R as half of the diameter DR.
  3. Ensure the number of corners n is odd. If not, increment n by 1.
  4. Create a star shape using PLstar function with parameters adjusted for the number of corners and other geometric properties.
  5. Determine the position p based on whether n is odd or even.
  6. Create a circular base using PLcircle and adjust its position with p.
  7. Combine the star and base shapes using CPLunion and CPLsubtract to form the final 2D contour.
  8. Enhance the contour with radial edges using CPLradialEdges.
  9. Convert the 2D contour to a 3D shape using SGofCPLz and rotate it with SGrotate.
  10. Create a nameplate with the specified text using SGNameplate.
  11. Align the nameplate with the star using SGtransrelSG.
  12. Visualize the star and nameplate using SGfigure and SGplotalpha.
  13. Concatenate the star and nameplate into a single object using SGconcat.
  14. Generate a filename based on the text, number of corners, and diameter.
  15. 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