SGofCPLcommandui

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Parametric Design
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-07, Last change: 2025-09-14

Simple commandline based 2.5 solid modeler for the use of a caliper

Description

First a Contour is designed; afterwards the contour is extruded; and set below the already designed existing solid; ATTENTION IF YOU MELT THE PARTS AFTERWARDS AVOID edges with same planes

SGofCPLcommands supports the following commands, separated by commas:
See publishable tutorial VLFL_EXP45.m

=== CPL shape commands =================================
b x-size y-size [d] => Box as rectangle or displace trapaze
c diameter x-coord y-coord => Cylinder
cs phi r-outer r-inner offset => Cylinder segment with angle
co r-outer length r-inner => Cylinder oval segment with optional holes
d diameter x-coord y-coord n-faces => Drilling hole at x/y with n edges
g diameter teeth-nr x-coord y-coord => Gear
ms diameter-1 diameter-2 => Motor shaft contour

=== CPL manipulation commands =================================
move x-coord y-coord => Move the CPL relatively
cp x-coord y-coord => Center point change
ch distance radius => Convex hull in distance with optional radius
dupc x-copies y copies distance => Duplicates contour in as x y pattern
dupr radius number offset => Duplicates contour radial in n copies

=== CPL stack commands =================================
enter => current CPL is shifted to the stack
swap => current CPL is swaped with CPL on stack
+/add => current CPL is added to stack CPL
-/sub => current CPL is substracted from stack CPL
rem => stack CPL ist substracted from current CPL
xor => current CPL is intersected with stack CPL => avoid creates non manifold points/edges
hs height => stack connection using height

=== CPL to solid commands =================================
h height z-displacement => Height of the extruded solid
hc height z-displacement => Height of extrusion with smoothed edges
r angle pitch => Extrusion by rotation (degree) and optional pitch

=== SG element commands =================================
scr mm length diameter => Screw/Cutter/Nut threat of diameter and length
sph diameter end-angle => Sphere

=== SG manipulation commands =================================
move x-coord y-coord => Move the solid relatively
rotx degree => rotate around the x-axis
roty degree => rotate around the y-axis
rotz degree => rotate around the z-axis
melt => Boolean addition of all solid elements
text string => Add a string to the largest surface
dupr number => Duplicates contour radial in n copies
hollow wall => Creates a hollow solid
shell wall distance => Creates a shell for the solid
cutz z1 z2 => Cuts the solid at z1 and z2

=== SG save and restore commands =================================
save name => saves the solid into name.SG
load name => loads a solid from name.SG
write name => saves the solid into File name.STL
read name => reads the solid from File name.STL

=== SG stack commands =================================
enter => current SG is shifted to the stack
swap => current SG is swaped with SG on stack
clear nr => Clear stack content 1..n
+/add => current SG is added to stack SG
-/sub => current SG is substracted from stack SG
rem => stack SG is substracted from current SG
xor => current SG is intersected with stack SG => avoid creates non manifold points/edges
rel command parameter => current SG is move relatively to stack

2018-11-21 Tim Lueth (implementation) and Yilun Sun (requests) discussed the boolean RPN (reverse Polish Notation / Forth) concept using stacks


See Also: , SGofCPLz , SGsurfacemeltbool , SGsurfacemeltbool , SGofCPLcommand

Example Illustration

 missing image of SGofCPLcommandui(CLINE)

Syntax

SG=SGofCPLcommandui([CLINE])

Input Parameter

CLINE: CPL command string, use '?' for info

Output Parameter

SG: solid Geometry

Examples


SGofCPLcommandui('g 4 21, h 4'); % Gear with diameter 4mm, 21 teeth, height 4 mm
SGofCPLcommandui('g 4 21, h 4, c 3, h 1, move 5 0, b 40 10 ,h 2,b 25 10 , h 20')
SGofCPLcommandui('g 4 21, h 4, c 3, h 1, move 5 0, b 40 10 ,d 2.5 -15 0, d 2.5 +15 0, h 2,b 25 10 , h 20')
SGofCPLcommandui('g 4 21, h 4, c 3, h 1, move 5 0, b 15 8, h 4, b 40 10 ,d 2.5 -15 0, d 2.5 +15 0, h 2,b 25 10 , h 20')
SGofCPLcommandui('g 4 21, h 4, c 3, h 1, move 5 0, b 15 8, hc 4, b 40 10 ,d 2.5 -15 0, d 2.5 +15 0, hc 2,b 25 10 , hc 20')
SGofCPLcommandui('g 5 10, enter, b 10 30 10')
SGofCPLcommandui('g 5 10, enter, b 10 30 10')
SGofCPLcommandui('g 5 10, enter, b 10 30 10, xor, h 4')




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

Last html export of this page out of FM database by TL: 2025-09-21