subtract
R2026bSyntax
Description
subtracts the geometry g3 = subtract(g1,g2)g2 from the geometry g1 and
returns the combined geometry g3. If g2 is a
vector of geometries, the function subtracts all geometries specified by
g2 from the geometry g1.

All geometries must be either 2-D or 3-D. The function does not support a mix of 2-D and 3-D geometries.
Examples
Input Arguments
Output Arguments
Tips
When creating a 3-D geometry,
subtractuses the default threshold of 44 degrees for the dihedral angle between adjacent triangles. If the angle between the triangles exceeds the threshold, the edge becomes a topological (feature) edge separating two faces. If the angle does not exceed the threshold,subtractdoes not create a topological edge with two separate faces, unless the function can create the edge based on other criteria. Instead,subtractcreates one face.To use a different feature angle value, create a triangulation object from the resulting geometry
g3, and then convert the object back to anfegeometryobject. Set the value of theFeatureAngleargument as a number between 10 and 90. The specifiedFeatureAnglevalue represents degrees.tr = triangulation(g3); g3 = fegeometry(tr,FeatureAngle=15)
The
triangulationfunction accepts only single-domain geometries, sog3must have one cell.Boolean operations on
AnalyticGeometryorDiscreteGeometryobjects return anfegeometryobject.









