OptoInspect3D Inline - alg3Dlib
3.4.0
Library for measured 3D data processing
|
This module provides basic functions common to all modules. More...
Data Structures | |
struct | ALG3D_Point3d |
Data type for 3d points/vectors with a user-defined pointer. More... | |
Macros | |
#define | ERR_NONE 1 |
function returned normally More... | |
#define | ERR_CONDITION 0 |
function returned normally but some condition has not been met More... | |
#define | ERR_UNKNOWN -1 |
undefined error occured More... | |
#define | ERR_FCT_LOCKED -2 |
function is locked More... | |
#define | ERR_NUM_POINTS -3 |
not enough points More... | |
#define | ERR_FILE_IO -4 |
file i/o error occured More... | |
#define | ERR_INVALID_ARG -5 |
invalid argument(s) passed to a function More... | |
Typedefs | |
typedef struct ALG3D_Point3d | ALG3D_Point3d |
Data type for 3d points/vectors with a user-defined pointer. More... | |
Functions | |
double | ALG3D_vectorLength (const ALG3D_Point3d *vector) |
Returns the length of a vector. More... | |
double | ALG3D_vectorLengthSq (const ALG3D_Point3d *vector) |
Returns the squared length of a vector. More... | |
double | ALG3D_dotProduct (const ALG3D_Point3d *vector1, const ALG3D_Point3d *vector2) |
Returns the scalar/dot product of two vectors. More... | |
ALG3D_Point3d | ALG3D_crossProduct (const ALG3D_Point3d *vector1, const ALG3D_Point3d *vector2) |
Returns the cross product of two vectors. More... | |
int | ALG3D_transformPoints (ALG3D_Point3d *pts, size_t numPts, const double R[9], const double T[3], const double S[1]) |
Transforms points by the given tranformation. More... | |
void | ALG3D_normalizeVector (ALG3D_Point3d *vector) |
Normalizes a vector so that its length is 1. If the vector equals the Null-Vector(0,0,0) it is not normalized. More... | |
double | ALG3D_distancePoint2Point (const ALG3D_Point3d *pt1, const ALG3D_Point3d *pt2) |
Return the euclidean distance between two points. More... | |
double | ALG3D_distancePoint2PointSq (const ALG3D_Point3d *pt1, const ALG3D_Point3d *pt2) |
Computes the squared euclidean distance between two points. More... | |
int | ALG3D_checkResult (int code) |
Function that checks for error codes and prints out the result. To activate console print out use ALG3D_enableLogOutput(1). This function prints nothing if the code is ERR_NONE. More... | |
int | ALG3D_getLibraryVersion (int *major, int *minor, int *revision) |
Function that returns the library's version info. More... | |
int | ALG3D_getAlgorithmsVersion (int *major, int *minor, int *revision) |
Function that returns the algorithms version info. More... | |
void | ALG3D_enableLogOutput (int enable) |
Enables print out of internal status information. More... | |
void | ALG3D_showDongleInfo () |
Function that prints some library information to console. More... | |
int | ALG3D_freeMemory (void *data) |
Releases the memory of an array that was allocated internally. It is up to the application to assure that the pointer is valid. More... | |
int | ALG3D_dongleConnected () |
Returns if a dongle for this library is connected. More... | |
ALG3D_DLL int | ALG3D_setMaxThreads (unsigned int number) |
Sets the maximum number of threads to use. More... | |
int | ALG3D_readXYZ (const char *fname, ALG3D_Point3d **data, size_t *numPts) |
Reads XYZ-data from a file. More... | |
int | ALG3D_writeXYZ (const char *fname, const ALG3D_Point3d *data, size_t numPts) |
Writes 3D point data to a XYZ-ASCII-file. More... | |
int | ALG3D_readSTL (const char *fname, ALG3D_Point3d **data, size_t **indices, size_t *numTriangles) |
Reads STL data from file (ascii and binary). The STL file stores the points of the triangles individually. This leads to duplications. This function deletes the duplications and returns the content of the STL as an array of points and an array of indices into the point array. Three consecutive indices form a triangle. More... | |
This module provides basic functions common to all modules.
struct ALG3D_Point3d |
Data type for 3d points/vectors with a user-defined pointer.
The user-defined pointer may be used to store references to any additional information belonging to this point.
Data Fields | ||
---|---|---|
ALG3D_USER_TYPE | data | pointer to additional user-defined data |
double | vec[3] | point data, e.g. 0=x,1=y,2=z |
#define ERR_CONDITION 0 |
#include <interface.h>
function returned normally but some condition has not been met
#define ERR_FCT_LOCKED -2 |
#include <interface.h>
function is locked
#define ERR_FILE_IO -4 |
#include <interface.h>
file i/o error occured
#define ERR_INVALID_ARG -5 |
#include <interface.h>
invalid argument(s) passed to a function
#define ERR_NONE 1 |
#include <interface.h>
function returned normally
#define ERR_NUM_POINTS -3 |
#include <interface.h>
not enough points
#define ERR_UNKNOWN -1 |
#include <interface.h>
undefined error occured
typedef struct ALG3D_Point3d ALG3D_Point3d |
#include <interface.h>
Data type for 3d points/vectors with a user-defined pointer.
The user-defined pointer may be used to store references to any additional information belonging to this point.
int ALG3D_checkResult | ( | int | code | ) |
#include <interface.cpp>
Function that checks for error codes and prints out the result. To activate console print out use ALG3D_enableLogOutput(1). This function prints nothing if the code is ERR_NONE.
code | error code |
ALG3D_Point3d ALG3D_crossProduct | ( | const ALG3D_Point3d * | vector1, |
const ALG3D_Point3d * | vector2 | ||
) |
#include <geometry.cpp>
Returns the cross product of two vectors.
vector1,vector2 | vectors/points |
double ALG3D_distancePoint2Point | ( | const ALG3D_Point3d * | pt1, |
const ALG3D_Point3d * | pt2 | ||
) |
#include <geometry.cpp>
Return the euclidean distance between two points.
pt1,pt2 | two points |
double ALG3D_distancePoint2PointSq | ( | const ALG3D_Point3d * | pt1, |
const ALG3D_Point3d * | pt2 | ||
) |
#include <geometry.cpp>
Computes the squared euclidean distance between two points.
pt1,pt2 | two points |
int ALG3D_dongleConnected | ( | ) |
#include <interface.cpp>
Returns if a dongle for this library is connected.
double ALG3D_dotProduct | ( | const ALG3D_Point3d * | vector1, |
const ALG3D_Point3d * | vector2 | ||
) |
#include <geometry.cpp>
Returns the scalar/dot product of two vectors.
vector1,vector2 | vectors/points |
void ALG3D_enableLogOutput | ( | int | enable | ) |
#include <interface.cpp>
Enables print out of internal status information.
enable | flag to enable (1) or disable (0) print outputs |
int ALG3D_freeMemory | ( | void * | data | ) |
#include <interface.cpp>
Releases the memory of an array that was allocated internally. It is up to the application to assure that the pointer is valid.
data | pointer to array data |
int ALG3D_getAlgorithmsVersion | ( | int * | major, |
int * | minor, | ||
int * | revision | ||
) |
#include <interface.cpp>
Function that returns the algorithms version info.
major,minor,revision | Version |
int ALG3D_getLibraryVersion | ( | int * | major, |
int * | minor, | ||
int * | revision | ||
) |
#include <interface.cpp>
Function that returns the library's version info.
major,minor,revision | Version |
void ALG3D_normalizeVector | ( | ALG3D_Point3d * | vector | ) |
#include <geometry.cpp>
Normalizes a vector so that its length is 1. If the vector equals the Null-Vector(0,0,0) it is not normalized.
vector | vector/point |
int ALG3D_readSTL | ( | const char * | fname, |
ALG3D_Point3d ** | data, | ||
size_t ** | indices, | ||
size_t * | numTriangles | ||
) |
#include <io.cpp>
Reads STL data from file (ascii and binary). The STL file stores the points of the triangles individually. This leads to duplications. This function deletes the duplications and returns the content of the STL as an array of points and an array of indices into the point array. Three consecutive indices form a triangle.
fname | file name |
data | pointer to an array for the points (will be allocated in this function) |
indices | pointer to an array for the indices (will be allocated in this function) |
numTriangles | the number of triangles that have been read (the size of indices is 3 * numTriangles) |
int ALG3D_readXYZ | ( | const char * | fname, |
ALG3D_Point3d ** | data, | ||
size_t * | numPts | ||
) |
#include <io.cpp>
Reads XYZ-data from a file.
fname | file name |
data | pointer to an array for the points (will be allocated in this function) |
numPts | the number of XYZ-data points that have been read |
ALG3D_DLL int ALG3D_setMaxThreads | ( | unsigned int | number | ) |
#include <interface.cpp>
Sets the maximum number of threads to use.
In order to control the overall usage of threads by an application the number of parallel threads used by the algorithms of this library can be limited to a certain amount. Note, that is advisable to only use as many threads as you have CPU cores.
number | maximum number of threads to use. If number is < 1 the maximum number of threads to use is set to 1. The maximum number is limited by the maximum number of available hardware threads on your system. |
void ALG3D_showDongleInfo | ( | ) |
#include <interface.cpp>
Function that prints some library information to console.
int ALG3D_transformPoints | ( | ALG3D_Point3d * | pts, |
size_t | numPts, | ||
const double | R[9], | ||
const double | T[3], | ||
const double | S[1] | ||
) |
#include <geometry.cpp>
Transforms points by the given tranformation.
Applies the transformation to the given points: pt = S*R*p+T.
[in,out] | pts | pointer to points |
[in] | numPts | number of points |
[in] | R,T,S | Rotation matrix R, Translation vector T and uniform scalinf factor S |
double ALG3D_vectorLength | ( | const ALG3D_Point3d * | vector | ) |
#include <geometry.cpp>
Returns the length of a vector.
vector | vector/point |
double ALG3D_vectorLengthSq | ( | const ALG3D_Point3d * | vector | ) |
#include <geometry.cpp>
Returns the squared length of a vector.
vector | vector/point |
int ALG3D_writeXYZ | ( | const char * | fname, |
const ALG3D_Point3d * | data, | ||
size_t | numPts | ||
) |
#include <io.cpp>
Writes 3D point data to a XYZ-ASCII-file.
fname | file name |
data | pointer to data begin |
numPts | number of points to write |