Click or drag to resize
AB4D logo

PlaneSliceMeshGeometry3D(MeshGeometry3D, Transform3D) Method

Slices the MeshGeometry3D with this Plane. If the meshGeometry3D is fully in front of the Plane (in the direction of plane's Normal vector), then the same meshGeometry3D is returned. If meshGeometry3D intersects the plane, then a new sliced MeshGeometry3D is returned. If meshGeometry3D is in the back of the plane, then null is returned.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public MeshGeometry3D SliceMeshGeometry3D(
	MeshGeometry3D meshGeometry3D,
	Transform3D transform = null
)

Parameters

meshGeometry3D  MeshGeometry3D
MeshGeometry3D
transform  Transform3D  (Optional)
Transform3D that is added to the meshGeometry3D (null by default)

Return Value

MeshGeometry3D
MeshGeometry3D that is in front of the plane
Remarks

SliceMeshGeometry3D slices the MeshGeometry3D with this Plane. If the meshGeometry3D is fully in front of the Plane (in the direction of plane's Normal vector), then the same meshGeometry3D is returned. If meshGeometry3D intersects the plane, then a new sliced MeshGeometry3D is returned. If meshGeometry3D is in the back of the plane, then null is returned.

Note for using with textured objects: SliceMeshGeometry3D correctly calculates slided 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