PlaneSlice |
public void SliceModel3DGroup( Model3DGroup model3DGroup, out Model3DGroup frontModel3DGroup, out Model3DGroup backModel3DGroup )
SliceModel3DGroup slices the 3D models defined by Model3DGroup with this Plane and creates two new Model3DGroup objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Note for using with textured objects: SliceModel3DGroup 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).