SGplotcell

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.6, Creation date: 2019-05-26, Last change: 2025-09-14

plot a cell list solid in different colors

Description

it plots until the facet difference is less than 1e-4

See Also: SGsurfacessort , SGsurfaces , SGplotsurfaces

Example Illustration

 missing image of SGplotcell(SG,c,w)

Syntax

h=SGplotcell(SG,[c,w])

Input Parameter

SG: cell list of solid
c: color
w: width

Output Parameter

h: handle to plot




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

Algorithm (Workflow)

This function, SGplotcell, is designed to plot a list of solid cells with different colors. It is part of the SolidGeometry library and was introduced in version 4.6. The function takes a cell list of solids and optional parameters for color and width, and returns a handle to the plot.

Input Parameters

Output

Algorithm Steps

  1. Set a tolerance level tol to 2e-4 for determining when to stop plotting based on facet differences.
  2. Initialize firstplot as false to track if the first plot has been drawn.
  3. Sort the surfaces of SG using SGsurfacessort with the 'facet' option, and calculate the total number of facets nf.
  4. Initialize counters kf and pfa to zero.
  5. Check if SG is not a cell. If true, call SGplot with the given arguments and return the handle.
  6. If SG is a cell, iterate over each element:
Algorithm explaination created using ChatGPT on 2025-08-19 07:35. (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