SGofVMmarchcube
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VM/Voxels
Introduced first in SolidGeometry 3.4, Creation date: 2017-02-17, Last change: 2025-09-14
returns a surface model by the marching cubes
Description
This function uses the MarchingCubes function from Matlab Central written by Peter Hammer in 2011 based on the Octave function written by Martin Helm (www.mhelm.de/octave/m/marching_cube.m) in 2009. It contains also code from Oliver Woodford for removing duplicated vertices.
See Also: VLFLofVMdelaunay
, VLFLofVMmarchcube
, TR3ofVM
, SGofVMdelaunay
Example Illustration
Syntax
SG=SGofVMmarchcube(V,[vs,cl])
Input Parameter
V: | | Logical Volume Model |
vs: | | voxel size, optional |
cl: | | closes open facets by adding empty planes; default is true |
Output Parameter
Examples
[V,vs]=VMreaddicomdir('AIM_DICOMFILES'); [a,as]=VMresize(V,[0.5 0.5 0.5],vs);
SG=SGofVMmarchcube(a>1400,as);
SGcut(SG,40);
c=CPLofSGslice3(SG,20);
PLFLofCPLdelaunay(c);
PLFLofCPLpoly(c)
% Understanding the Existance or creation of non manifold edges
V=zeros(3,3,3); for i=1:numel(V); if isodd(i); V(i)=1; end; end; SGofVMmarchcube(V,[],false)
V=zeros(3,3,3); for i=1:numel(V); if isodd(i); V(i)=1; end; end; SGofVMmarchcube(V,[],true)
Copyright 2017-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