Clip2D (FPScript)

21.09.2021

Cuts surfaces at an edge or along a closed curve.

Syntax

Clip2D(Surface, CuttingEdge, Mode)

 

The syntax of the Clip2D function consists of the following parts:

Part

Description

Surface

The surface to be cut, which may be a data matrix/signal series or space curve. If you specify a data series or a data matrix, then the X and Z components will be generated automatically.

Permitted data structures are data matrix, signal series und space curve. All numeric data types are permitted.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

CuttingEdge

Specifies the cutting edge to cut along.

Permitted data structures are scalar value und signal. All numeric data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Mode

Specifies the mode of how the data set is to be cut.

The argument Mode can have the following values:

Constant

Meaning

CLIP2D_XMAX

All values above the cutting edge in the X direction are set to void.

CLIP2D_XMIN

All values below the cutting edge in the X direction are set to void.

CLIP2D_ZMAX

All values above the cutting edge in the Z direction are set to void.

CLIP2D_ZMIN

All values below the cutting edge in the Z direction are set to void.

CLIP2D_CURVEOUTSIDE

All values outside of the closed curve are set to void.

CLIP2D_CURVEINSIDE

All values within the closed curve are set to void.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

If Surface is of the calendar time or time span data type, then this also applies for the result. For all other Surface data types, the data type of the result is a 64-bit floating point value.

If the argument CuttingEdge is specified as a scalar value, all Y values are set to void, whose X values are greater than ( CLIP2D_XMAX), less than (CLIP2D_XMIN), or whose Z values are greater than (CLIP2D_ZMAX) or less than (CLIP2D_ZMIN) the specified limit.

If the argument CuttingEdge is specified as a signal, the Y component corresponds to the dimension of the surface to be cut and the X component corresponds to the other dimension. Interpolation will be used, if necessary. For Mode equal to CLIP2D_XMAX or CLIP2D_XMIN , the Y component of the signal corresponds to the X component of the surface, for instance, and the X component of the signal corresponds to the Y component of the surface.

For the modes CLIP2D_CURVEOUTSIDE and CLIP2D_CURVEINSIDE , the argument CuttingEdge must be specified as a signal. The Y and X values of the signal must then form a closed curve along which to cut. The Y values of the signal are thus assigned to the Z component of the surface, and the X values are assigned to their X component. The curve specified by the signal is closed automatically, which means that the first point in the signal does not have to match the last point.

Constant

Method

CLIP2D_XMAX

All Y values whose assigned X value is above the specified cutting edge are set to void.

CLIP2D_XMIN

All Y values whose assigned X value is below the specified cutting edge are set to void.

CLIP2D_ZMAX

All Y values whose assigned Z value is above the specified cutting edge are set to void.

CLIP2D_ZMIN

All Y values whose assigned Z value is below the specified cutting edge are set to void.

CLIP2D_CURVEOUTSIDE

All Y values whose assigned X, Z coordinates are outside the closed curve passed as the argument CuttingEdge are set to void.

CLIP2D_CURVEINSIDE

All Y values whose assigned X, Z coordinates are within the closed curve passed as the argument CuttingEdge are set to void.

For complex data types the absolute value is formed.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

Dim d = Data
d = Clip2D(d, 2000, CLIP2D_XMIN)
d = Clip2D(d, 10000, CLIP2D_XMAX)
d = Clip2D(d, 50, CLIP2D_ZMIN)
d = Clip2D(d, Signal({200,50},{2000,10000}), CLIP2D_ZMAX)
 

In the following example, a surface is cut in the X direction as well as in the Z direction.

Clip2D(Data, Signal({100,200,250,200,100,50},{2000,2000,6000,10000,10000,6000}), CLIP2D_CURVEINSIDE)
Clip2D(Data, Signal({100,200,250,200,100,50},{2000,2000,6000,10000,10000,6000}), CLIP2D_CURVEOUTSIDE)
 

The following example shows how a contour with a closed curve is cut.

See Also

Clip Function

ValuesAboveLevel Function

ValuesBelowLevel Function

ValuesInInterval Function

Event Isolation Analysis Object

Share article or send as email:

You might be interested in these articles