SGreplace

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Boolean
Introduced first in SolidGeometry 5.0, Creation date: 2021-01-07, Last change: 2025-09-15

First version to replace a part of a solid

Description

In comparision with the newer SGunionreplace, this older version has no spatial paraemters and uses SGgrow instead of SGofBB als subtraction solid. It also uses SGconvexofSGintersect insted of a simple SGofBB.
The full functionality was implemented in Feb 2023, so in fact, after SGunionreplace.
Function has still its value

See Also: SGunionreplace , SGconvexofSGintersect , SGtransrelSG , SGboolh , SGintersect , SGsubtract , SGxor , SGconcat , SGsupplement

Example Illustration

 missing image of SGreplace(SG,A,B,ol)

Syntax

SG=SGreplace([SG,A,B,ol])

Input Parameter

SG: Solid Geometry
A: Volume of SG to be replaced; default is convex hull of B
B: Solid Geometry to fill the replaced volume
ol: oversize to cut; default is 0.05

Output Parameter

SG: Solid with B instead of A

Examples


SGreplace(SGbox,'',SGbox([5 5 5]),1) % intrusion between SG and B
SGremsurfedgepoints(ans)
SGreplace(SGbox,'',SGbox([5 5 5]),-1) % slot of SG and B
SGremsurfedgepoints(ans)




Copyright 2021-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