PlaneSlice |
public void SliceGeometryModel3D( GeometryModel3D geometryModel3D, Transform3D parentTransform, out GeometryModel3D frontGeometryModel3D, out GeometryModel3D backGeometryModel3D )
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).