Syntax
KMplot(KM)
Input Parameter
Copyright 2015-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, KMplot
, is designed to plot all parts of a kinematic model. The kinematic model is represented as a cell list with each entry containing solid geometry, a name, and a 4x4 transformation matrix.
Input Parameters
- KM: The kinematic model, which is a structured cell list. Each element of the list includes:
- Solid Geometry: A struct with a vertex list (VL) and a facet list (FL).
- Name: A string representing the name of the solid geometry.
- 4x4-Matrix: A transformation matrix for the geometry.
- varargin: Optional parameters. The first optional parameter is the color for plotting, defaulting to 'r' (red) if not specified.
Algorithm Steps
- Initialize the color
c
to 'r'. If a color is provided as an additional argument, update c
with this value.
- Determine the number of solid geometries in the kinematic model by evaluating
length(KM.SG)
.
- Iterate over each solid geometry in the kinematic model:
- For each solid geometry, check if the corresponding transformation matrix
KM.BT{i}
is not the identity matrix eye(4)
.
- If the transformation matrix is not the identity matrix, call the function
SGplot
with the following parameters:
KM.SG{i}
: The solid geometry to be plotted.
c
: The color for plotting.
- An empty array
[]
as a placeholder for additional parameters.
KM.BT{i}
: The transformation matrix to apply to the solid geometry.
The function relies on the SGplot
function to handle the actual plotting of each solid geometry, applying the specified transformation matrix and color.
Algorithm explaination created using ChatGPT on 2025-08-18 23:52. (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