Click or drag to resize
AB4D logo

PlaneSliceGeometryModel3D(GeometryModel3D, GeometryModel3D, GeometryModel3D) Method

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

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public void SliceGeometryModel3D(
	GeometryModel3D geometryModel3D,
	out GeometryModel3D frontGeometryModel3D,
	out GeometryModel3D backGeometryModel3D
)

Parameters

geometryModel3D  GeometryModel3D
GeometryModel3D
frontGeometryModel3D  GeometryModel3D
Out parameters as GeometryModel3D for front model
backGeometryModel3D  GeometryModel3D
Out parameters as GeometryModel3D for back model
Remarks

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

Note for using with textured objects: SliceGeometryModel3D 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