FlexScan3D User Manual - Version 3.3.4.x
The FlexScan3D DLL allows the calling application to start an interactive session via any programming or scripting language that supports the loading up of DLL interfaces. The DLL also supports callbacks that allow users to receive event and mesh data asynchronously.
You can find the include file, library, and example projects under C:\Program Files\LMI Technologies\FlexScan3D 3.3\SDK\ScanInterface after installation.
Callbacks are supported in FlexScan3D version 3.3.2.178 and higher.
For basic applications, FS3D_Init should be called at the beginning to start FlexScan3D and FS3D_Exit at the end to exit FlexScan3D. If the basic command I/O is handled separately through standard input/output, then FlexScan3D should be started separately and the application calls FS3D_Attach and FS3D_Detach to connect to the already running FlexScan3D instance. See below for more information on FS3D_Init and FS3D_Exit.
Either FS3D_Init or FS3D_Attach must be called before FS3D_RegisterCallback.
Call FS3D_RegisterCallback to register callbacks. The callback to be registered is specified by name. The following callbacks are supported:
Callback Name | Description |
---|---|
ScanProcessed | Triggers immediately after a scan has been processed. Allows users to receive vertices or faces. |
MotionDetected | Active when live scanning is enabled. Triggers when live scanning is enabled and motion is initially detected. |
MotionStopped | Active when live scanning is enabled. Triggers when live scanning is enabled and motion is no longer detected. |
Call this function multiple times to register multiple callbacks.
To avoid writing to disk during scanning, the Scanning_WriteToDisk advanced setting must be set to False before scanning.
The callbacks return a FS3D handle, which is container of multiple items. The items contained depend on the callbacks. Users can use the FS3D_Get<Property type> functions to access the contained items.
Item Name | Item Type | Description |
---|---|---|
gridHeight | int | Height of the scan grid |
gridWidth | int | Width of the scan grid |
nVertices | int | Number of vertices |
nFaces | int | Number of faces |
nGrid | int | Number of grid indices (should be the same as nVertices) |
vertices | double array | Vertices in X,Y,Z sequence |
faces | int array | Triangle faces, with 3 vertex index values per face |
grids | int array | Grid indices with a H,W sequence per vertex |
Item Name | Item Type | Description |
---|---|---|
scannerName | string | Name of the scanner which detected motion |
Item Name | Item Type | Description |
---|---|---|
scannerName | string | Name of the scanner which detected motion |
motionDetected | int | Set to 1 if motion was detected, 0 if no motion was detected |
Memory returned through various FS3D_Get*() function parameters are accessible throughout the scope of the callback function. There is no need to explicitly allocate or free memory.
Error FS3D_RESULT_WRONGTYPE will be returned if the item names or type do not match.
See below.
Starts FlexScan3D in Interactive mode and connects to the input and output pipes to allow direct control over it. Must be called before any FS3D_Command calls. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Sends the specified command to FlexScan3D and waits for it to reply that the task is completed. Returns FS3D_RESULT_OK if the command was successful, FS3D_RESULT_ERROR if the command was unsuccessful, and FS3D_RESULT_UNKNOWN if the command was not recognized.
Sends the specified command to FlexScan3D and returns immediately. Always returns FS3D_RESULT_OK.
Used to check the result of an asynchronous command from FS3D_CommandAsync(). While the command is still running, this function will return FS3D_RESULT_EXECUTING. For multi-threaded applications, a "while(FS3D_CommandAsync()==FS3D_RESULT_EXECUTING)" loop can be used to determine when the command has completed.
Queries FlexScan3D for the current value of a script variable. Returns the value of the variable as a string, or 0 (NULL) if the query failed. String variables are returned as-is, numbers are converted to a string representation before being returned, and nil values are returned as "nil".
Example: For script "a = 4 * 5", FS3D_ScriptQuery("a") returns "20".
Opens a direct communication pipe with a running instance of FlexScan3D. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Closes the communication with FlexScan3D. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Registers a callback with FlexScan3D. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Unregisters a callback with FlexScan3D. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Gets the number of available named data items. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Gets information pertaining to the item at a particular index. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure.
Gets a text string. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not a text string.
Gets a 64-bit floating-point value. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not a 64-bit floating-point value.
Gets a 32-bit floating-point value. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not a 32-bit floating-point value.
Gets a 32-bit integer value. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not a 32-bit integer value.
Gets an array of 64-bit floating-point values. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not an array of 64-bit floating-point values.
Gets an array of 32-bit floating-point values. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not an array of 32-bit floating-point values.
Gets an array of 32-bit integer values. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not an array of 32-bit integer values.
Gets an array of byte values. Returns FS3D_RESULT_OK on success, FS3D_RESULT_ERROR on failure, or FS3D_RESULT_WRONGTYPE if the item defined by itemName is not an array of byte values.
Used to abort a command while it is being executed, which can be useful for long operations such as 360-degree rotary scans. This can be used in multi-threaded applications when using FS3D_CommandAsync(). Always returns FS3D_RESULT_OK.
Shuts down the communication pipes with FlexScan3D and terminates the application. Failure to call before terminating the calling application may result in data loss and/or error messages from FlexScan3D. Always returns FS3D_RESULT_OK.
Copyright © 2015 LMI Technologies, Inc. All rights reserved.