Click or drag to resize
AB4D logo

PlaneSliceMeshGeometry3D(MeshGeometry3D, Transform3D, MeshGeometry3D, MeshGeometry3D) Method

Slices the MeshGeometry3D with this Plane and creates two new MeshGeometry3D objects: one with MeshGeometry3D that are in front of the plane (in the direction of plane's Normal vector) and one with MeshGeometry3D in the back of the plane. If MeshGeometry3D is fully in front (or in back) of the Plane, the the same instance of MeshGeometry3D is used. If the MeshGeometry3D intersects the Plane, it is sliced and new MeshGeometry3D objects are created from it.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public void SliceMeshGeometry3D(
	MeshGeometry3D meshGeometry3D,
	Transform3D transform,
	out MeshGeometry3D frontMeshGeometry3D,
	out MeshGeometry3D backMeshGeometry3D
)

Parameters

meshGeometry3D  MeshGeometry3D
MeshGeometry3D
transform  Transform3D
Transform3D that is added to the meshGeometry3D (null by default)
frontMeshGeometry3D  MeshGeometry3D
Out parameters as MeshGeometry3D for front model or null when no position is in front of the plane
backMeshGeometry3D  MeshGeometry3D
Out parameters as MeshGeometry3D for back model or null when no position is in the back of the plane
Remarks

SliceMeshGeometry3D slices the MeshGeometry3D with this Plane and creates two new MeshGeometry3D objects: one with MeshGeometry3D that are in front of the plane (in the direction of plane's Normal vector) and one with MeshGeometry3D in the back of the plane. If MeshGeometry3D is fully in front (or in back) of the Plane, the the same instance of MeshGeometry3D is used. If the MeshGeometry3D intersects the Plane, it is sliced and new MeshGeometry3D objects are created from it.

Note for using with textured objects: SliceMeshGeometry3D correctly calculates sliced TextureCoordinates, but to show the texture correctly, the ViewportUnits on ImageBrush needs to be set to BrushMappingMode.Absolute. It should not be set to BrushMappingMode.RelativeToBoundingBox (a default value in WPF). In case of RelativeToBoundingBox, both sliced parts of the 3D model will still show the whole texture).

See Also