SGwatertightofSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.9.1, Creation date: 2020-08-28, Last change: 2025-09-14

returns within 60 seconds a watertight reconstruction

Description

Voxel based, different approach to SGconvexHullsliced (2024)
NEEDS IMPROVEMENT - Currently more show but helps for PDE Toolbox
Simply creates a Voxel Model 128 x 128 x 128
and uses VLFLofVMdelaunay to create a triangulation model
Both marchingcube and isosurface fail, but SGofVMdelaunay works.

See Also: SGconvexHullsliced , VLFLofVMdelaunay

Example Illustration

 missing image of SGwatertightofSG(SG)

Syntax

SGN=SGwatertightofSG(SG)

Input Parameter

SG: Solid Geometry

Output Parameter

SGN: Reconstruction Resolution 128

Examples


SGwatertightofSG(SGservosample(5))




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 function, SGwatertightofSG, is designed to create a watertight reconstruction of a given solid geometry (SG) using a voxel-based approach. Below is a detailed explanation of the algorithm and its parameters:

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by converting the input solid geometry (SG) into a voxel model using the function VMofSG. The voxel model is created with a resolution of 128 x 128 x 128. This step is crucial for discretizing the geometry into a grid format that can be processed further.
  2. Next, the function attempts to create a triangulation model from the voxel model using SGofVMdelaunay. This function takes the voxel model (VM) and voxel size (vs) as inputs and returns a triangulated surface model (SGN). The voxel size is adjusted by reordering its dimensions to [2 1 3] to match the expected input format for the triangulation function.
  3. Alternative methods for creating the triangulation model, such as SGofVMmarchcube and SGofVMisosurface, are commented out. These methods are mentioned as failing in the header comments, indicating that they are not reliable for this task.
  4. If no output argument is specified (i.e., nargout==0), the function will visualize the results. It uses SGfigure to set up a 3D plot and SGplotalpha to display the reconstructed model (SGN) in white with 90% opacity and the original model (SG) in red.

The function is part of a library designed for solid geometry processing and is intended to provide a quick method for generating watertight models, which are essential for applications like finite element analysis.

Algorithm explaination created using ChatGPT on 2025-08-19 00:49. (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