Click or drag to resize
Ab4d.SharpEngine logo

MeshBooleanOperationsSubtract(GroupNode, StandardMesh, Transform, Boolean, Boolean) Method

Returns a GroupNode that is created by subtracting mesh from all the ModelNodes in the GroupNode. Note that the children from specified GroupNode may be moved to the returned GroupNode (this happens when they are preserved because they do not intersect with the mesh).

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public static GroupNode? Subtract(
	GroupNode groupNode,
	StandardMesh mesh,
	Transform? parentTransform = null,
	bool processOnlyIntersectingTriangles = true,
	bool generateInnerTriangles = true
)

Parameters

groupNode  GroupNode
GroupNode that will be changed with subtracting the specified StandardMesh
mesh  StandardMesh
StandardMesh that will be used to subtract the ModelNode
parentTransform  Transform  (Optional)
optional Transform 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

Return Value

GroupNode
GroupNode with subtracted models
Remarks

Returns a GroupNode that is created by subtracting mesh from all the ModelNodes in the GroupNode. Note that the children from specified GroupNode may be moved to the returned GroupNode (this happens when they are preserved because they do not intersect with the mesh).

Only children that can be casted to ModelNode are subtracted. Child GroupNodes are recursively processed. Other types of SceneNodes are preserved.

When the mesh does not intersect with the GroupNode, then the original GroupNode is returned. Otherwise a new GroupNode is created.

See Also