Click or drag to resize
AB4D logo

MeshBooleanOperationsSubtract(GeometryModel3D, MeshGeometry3D, Transform3D, Boolean, Boolean) Method

Updates the MeshGeometry3D of the specified geometryModel3D with subtracting the specified meshGeometry3D from it. This method replaces the geometryModel3D.Geometry object with a new MeshGeometry3D object. The geometryModel3D.Geometry is transformed with geometryModel3D.Transform before being subtracted.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public static void Subtract(
	GeometryModel3D geometryModel3D,
	MeshGeometry3D meshGeometry3D,
	Transform3D parentTransform3D = null,
	bool processOnlyIntersectingTriangles = true,
	bool generateInnerTriangles = true
)

Parameters

geometryModel3D  GeometryModel3D
GeometryModel3D that will be changed with subtracting the specified MeshGeometry3D
meshGeometry3D  MeshGeometry3D
MeshGeometry3D that will be used to subtract the GeometryModel3D
parentTransform3D  Transform3D  (Optional)
Transform3D that will be applied to the positions (null by default)
processOnlyIntersectingTriangles  Boolean  (Optional)
when true (by default) then only triangles from mesh1 that intersect the bounds of mesh2 will be processed by subtraction; other triangles will be copied from the mesh1. This can produce significantly simpler mesh.
generateInnerTriangles  Boolean  (Optional)
when true (by default) then then triangles inside the first mesh are generated (this closes the hole that is created by subtraction); when false then no additional inner triangles are generated - only existing triangles are processed in subtraction
Remarks

Updates the MeshGeometry3D of the specified geometryModel3D with subtracting the specified meshGeometry3D from it.

This method replaces the MeshGeometry3D used by the geometryModel3D with a new MeshGeometry3D objects.

The geometryModel3D.Geometry is transformed with geometryModel3D.Transform before being subtracted.

Because boolean operations do not generate TextureCoordinates, it will not be possible to show textures after calling this method. To manually generate texture coordinates you can use the methods from MeshUtils class: GenerateCubicTextureCoordinates(MeshGeometry3D), GeneratePlanarTextureCoordinates(MeshGeometry3D, Vector3D, Vector3D, Boolean, Boolean, Boolean), GenerateCylindricalTextureCoordinates(MeshGeometry3D, Vector3D, Vector3D).

See Also