Click or drag to resize
AB4D logo

PlaneSliceModelVisual3D(ModelVisual3D, Transform3D) Method

Slices the 3D models defined by ModelVisual3D with this Plane and returns a new ModelVisual3D with models that are in front of the plane (in the direction of plane's Normal vector). The models that are fully in front 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 ModelVisual3D SliceModelVisual3D(
	ModelVisual3D modelVisual3D,
	Transform3D parentTransform = null
)

Parameters

modelVisual3D  ModelVisual3D
ModelVisual3D
parentTransform  Transform3D  (Optional)
Transform3D that is added to the modelVisual3D (null by default)

Return Value

ModelVisual3D
new ModelVisual3D with models that are in front of the plane
Remarks

SliceModelVisual3D slices the 3D models defined by ModelVisual3D with this Plane and returns a new ModelVisual3D with models that are in front of the plane (in the direction of plane's Normal vector). The models that are fully in front 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: SliceModelVisual3D 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