Click or drag to resize
AB4D logo

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

Subtracts the specified meshGeometry3D from the specified modelVisual3D.

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

Parameters

modelVisual3D  ModelVisual3D
ModelVisual3D
meshGeometry3D  MeshGeometry3D
MeshGeometry3D
parentTransform3D  Transform3D  (Optional)
optional Transform3D
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

Subtracts the specified meshGeometry3D from the specified modelVisual3D.

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

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