Click or drag to resize
AB4D logo

PlaneSliceModel3D(Model3D, Transform3D, Model3D, Model3D) Method

Slices the 3D models defined by model3D (GeometryModel3D or Model3DGroup) with this Plane and creates two new Model3D 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.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public void SliceModel3D(
	Model3D model3D,
	Transform3D parentTransform,
	out Model3D frontModel3D,
	out Model3D backModel3D
)

Parameters

model3D  Model3D
model3D as GeometryModel3D or Model3DGroup
parentTransform  Transform3D
Transform3D that is added to the modelVisual3D (null by default)
frontModel3D  Model3D
Out parameters as Model3D for front models
backModel3D  Model3D
Out parameters as Model3D for back models
Remarks

SliceModel3D slices the 3D models defined by model3D (GeometryModel3D or Model3DGroup) with this Plane and creates two new Model3D 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: SliceModel3D 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