You are here: Start » AVL.NET » Function Reference » Surface » Surface Spatial Transforms » AVL.CropSurfaceToRegion

AVL.CropSurfaceToRegion

Removes points that are not present in a given region.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void CropSurfaceToRegion
(
	AvlNet.Surface inSurface,
	AvlNet.Region inRegion,
	bool inPreserveDimensions,
	AvlNet.Surface outSurface
)

Parameters

Name Type Range Default Description
inSurfaceAvlNet.SurfaceInput surface.
inRegionAvlNet.RegionRegion from which the points are not removed.
inPreserveDimensionsboolFalseFlag indicating whether the surface dimensions should be preserved or not. Default value: False.
outSurfaceAvlNet.SurfaceOutput surface.

Description

The operation removes points from surface that are not contained in a given rectangular box within provided Region.
This operation is very similar to CropSurface, although it is slightly limited. Region within the surface will be cropped is viewed from above. This means that it is possible to edit the input within a two-dimensional space through the X and Y axis instead of X, Y and Z axis in CropSurface filter.
Flag inPreserveDimensions informs if the operation output should keep the original dimensions of its input. E.g. if inSurface has its Width=300, Height=200 and Pitch=608 and the flag is enabled, the outSurface will have exactly the same dimensions of 300x200x608. However, if the flag is disabled, outSurface will have its dimensions smaller to adjust them to surface size, but its XOffset, YOffset, ZOffset properties will be accordingly bigger in order to keep the surface in the same place in workspace.

Examples

A sample Surface object.

The same Surface object seen from above.

A sample Surface object cropped within the Region of a bottom-right part of surface.

Cropped Surface object seen from above.

Properties of a cropped surface with dimension preservation enabled.

Properties of a cropped surface with dimension preservation disabled.

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

Hardware acceleration settings may be manipulated with Settings class.

Errors

List of possible exceptions:

Error type Description
DomainError Input region exceeds surface dimensions in CropSurfaceToRegion.

See also