OptoInspect3D Inline - alg3Dlib
3.4.0
Library for measured 3D data processing
|
This module contains best-fit algorithms of point clouds with geometric primitives. More...
Data Structures | |
struct | ALG3D_Plane |
Data type for a plane. More... | |
struct | ALG3D_Line |
Data type for a 3D-line. More... | |
struct | ALG3D_Circle |
Data type for a 3D-circle. More... | |
struct | ALG3D_Ellipse |
Data type for a 3D-Ellipse. More... | |
struct | ALG3D_Superellipse |
Data type for a 3D-superellipse (Lamé-curve). More... | |
struct | ALG3D_Sphere |
Data type for a sphere. More... | |
struct | ALG3D_Cylinder |
Data type for a cylinder. More... | |
struct | ALG3D_Cone |
Data type for a cone. More... | |
struct | ALG3D_Torus |
Data type for a torus. More... | |
Enumerations | |
enum | ALG3D_ApproximateFlags { enFitNone =1L<< 0, enFixCenter =1L<< 1, enFixDirection =1L<< 2, enFixRadius =1L<< 3, enFixRadius2 =1L<< 4, enFixRotAngle =1L<< 5, enFixA =1L<< 6, enFixB =1L<< 7, enFixConeAngle =1L<< 8, enFixEpsilon =1L<< 9, enVarCenter =1L<<10, enVarDirection =1L<<11, enVarRadius =1L<<12, enVarRadius2 = 1L<<13, enVarRotAngle =1L<<14, enVarA =1L<<15, enVarB =1L<<16, enVarConeAngle =1L<<17, enVarEpsilon =1L<<18, enUseWeights =1L<<31 } |
Functions | |
int | ALG3D_fitLine (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Line *line, int iterations, int flags) |
Computes best-fit line in 3D with least-squares. More... | |
int | ALG3D_fitPlane (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Plane *plane, int iterations, int flags) |
Computes best-fit plane with least-squares. More... | |
int | ALG3D_fitCircle (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Circle *circle, int iterations, int flags) |
Computes best-fit circle in 3D with least-squares. More... | |
int | ALG3D_fitEllipse (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Ellipse *ellipse, int iterations, int flags) |
Computes best-fit ellipse in 3D with least-squares. More... | |
int | ALG3D_fitSuperellipse (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Superellipse *superellipse, int iterations, int flags) |
Computes best-fit superellipse with least-squares. More... | |
int | ALG3D_fitSphere (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Sphere *sphere, int iterations, int flags) |
Computes best-fit sphere with least-squares. More... | |
int | ALG3D_fitCylinder (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Cylinder *cylinder, int iterations, int flags) |
Computes best-fit cylinder with least-squares. More... | |
int | ALG3D_fitCone (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Cone *cone, int iterations, int flags) |
Computes best-fit cone with least-squares. Note that the cone radius is measured at the height of the cone center. The cone radius is an output parameter only and is ignored when given as input parameter. More... | |
int | ALG3D_fitTorus (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Torus *torus, int iterations, int flags) |
Computes best-fit torus with least-squares. More... | |
int | ALG3D_fitLineMZ (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Line *line, double *absMax, int iterations) |
Computes best-fit 3D line using the Chebyshev norm. More... | |
int | ALG3D_fitPlaneMZ (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Plane *plane, double *absMax, int iterations) |
Computes best-fit plane using the Chebyshev norm. More... | |
int | ALG3D_fitSphereMZ (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Sphere *sphere, double *absMax, int iterations, int flags) |
Computes best-fit sphere using the Chebyshev norm. More... | |
int | ALG3D_fitCylinderMZ (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Cylinder *cylinder, double *absMax, int iterations, int flags) |
Computes best-fit cylinder using the Chebyshev norm. More... | |
int | ALG3D_fitConeMZ (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Cone *cone, double *absMax, int iterations, int flags) |
Computes best-fit cone using the Chebyshev norm. More... | |
int | ALG3D_fitTorusMZ (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Torus *torus, double *absMax, int iterations, int flags) |
Computes best-fit torus using the Chebyshev norm. More... | |
int | ALG3D_fitSphereMC (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Sphere *sphere, int iterations) |
Computes the minimum enclosing sphere. More... | |
int | ALG3D_fitCylinderMC (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Cylinder *cylinder, int iterations) |
Computes the minimum enclosing cylinder. More... | |
int | ALG3D_fitPlanesMC (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Plane *plane1, ALG3D_Plane *plane2, double *thickness, int iterations) |
Computes the minimum enclosing planes. More... | |
int | ALG3D_fitSphereMI (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Sphere *sphere, int iterations) |
Computes the maximum inscribed sphere (Pferch sphere). More... | |
int | ALG3D_fitCylinderMI (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Cylinder *cylinder, int iterations) |
Computes the maximum inscribed cylinder (Pferch cylinder). More... | |
int | ALG3D_distancesPoints2Line (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Line *line, double *distances) |
Computes the distances of points to a 3D line. More... | |
int | ALG3D_distancesPoints2Plane (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Plane *plane, double *distances) |
Computes the distances of points to a plane. More... | |
int | ALG3D_distancesPoints2Circle (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Circle *circle, double *distances) |
Computes the distances of points to a 3D circle. More... | |
int | ALG3D_distancesPoints2Sphere (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Sphere *sphere, double *distances) |
Computes the distances of points to a sphere. More... | |
int | ALG3D_distancesPoints2Cylinder (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Cylinder *cylinder, double *distances) |
Computes the distances of points to a cylinder. More... | |
int | ALG3D_distancesPoints2Cone (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Cone *cone, double *distances) |
Computes the distances of points to a cone. More... | |
int | ALG3D_distancesPoints2Torus (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Torus *torus, double *distances) |
Computes the distances of points to a torus. More... | |
int | ALG3D_distancesPoints2Ellipse (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Ellipse *ellipse, double *distances) |
Computes the distances of points to a 3D ellipse. More... | |
int | ALG3D_distancesPoints2Superellipse (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Superellipse *superellipse, double *distances) |
Computes the distances of points to a 3D superellipse. More... | |
int | ALG3D_projectPoints2Line (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Line *line, ALG3D_Point3d *ptsOut) |
Computes the projections of points to a 3D line. More... | |
int | ALG3D_projectPoints2Plane (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Plane *plane, ALG3D_Point3d *ptsOut) |
Computes the projections of points to a plane. More... | |
int | ALG3D_projectPoints2Sphere (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Sphere *sphere, ALG3D_Point3d *ptsOut) |
Computes the projections of points to a sphere. More... | |
int | ALG3D_projectPoints2Cylinder (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Cylinder *cylinder, ALG3D_Point3d *ptsOut) |
Computes the projections of points to a cylinder. More... | |
int | ALG3D_projectPoints2Cone (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Cone *cone, ALG3D_Point3d *ptsOut) |
Computes the projections of points to a cone. More... | |
int | ALG3D_projectPoints2Torus (const ALG3D_Point3d *ptsIn, size_t numIn, const ALG3D_Torus *torus, ALG3D_Point3d *ptsOut) |
Computes the projections of points to a torus. More... | |
int | ALG3D_intersectLineLine (const ALG3D_Line *line1, const ALG3D_Line *line2, ALG3D_Point3d *point) |
Computes the intersection between two 3D lines. If the two lines are not parallel an intersection point will be computed. This point is computed from the position where the lines are closest. The middle point between the closest points on the lines is returned as the intersection point. More... | |
int | ALG3D_intersectLinePlane (const ALG3D_Line *line, const ALG3D_Plane *plane, ALG3D_Point3d *point) |
Computes the intersection between 3D line and a plane. More... | |
int | ALG3D_intersectLineSphere (const ALG3D_Line *line, const ALG3D_Sphere *sphere, ALG3D_Point3d *ptsOut, size_t *numOut) |
Computes the intersection between 3D line and a sphere. More... | |
int | ALG3D_intersectLineCylinder (const ALG3D_Line *line, const ALG3D_Cylinder *cylinder, ALG3D_Point3d *ptsOut, size_t *numOut) |
Computes the intersection between a 3D line and a cylinder. More... | |
int | ALG3D_intersectLineCone (const ALG3D_Line *line, const ALG3D_Cone *cone, ALG3D_Point3d *ptsOut, size_t *numOut) |
Computes the intersection between a 3D line and a cone. More... | |
int | ALG3D_intersectPlanePlane (const ALG3D_Plane *plane1, const ALG3D_Plane *plane2, ALG3D_Line *line) |
Computes the intersection between two planes. More... | |
int | ALG3D_intersectPlaneSphere (const ALG3D_Plane *plane, const ALG3D_Sphere *sphere, ALG3D_Circle *circle) |
Computes the intersection between a plane and a sphere. More... | |
int | ALG3D_computePrincipleComponents (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Point3d components[3]) |
Computes the principal components of a 3D point set. The principal components are the directions of the main axes of a point sets. The three directions (normalized vectors) are perpendicular to each other and thus form a orthogonal system. Principal components are useful to analyze an unknown point set, e.g. in order to get to largest and smallest extents. The functions returns these components as three normalized vectors. More... | |
int | ALG3D_computeMinimumBoundingCircle (const ALG3D_Point3d *v1, const ALG3D_Point3d *v2, const ALG3D_Point3d *v3, ALG3D_Point3d *center, double *radius) |
Computes the minimum bounding circle for a triangle. Computes the smallest circle that contains the 3 given vertices, but the circle must not pass through all of the vertices. The minimum bounding circle differs from the circumcircle, which requires to pass through all vertices and is equal or larger to the minimum bounding circle. More... | |
Functions for Triangles | |
int __cdecl | ALG3D_computeConvexHull (const ALG3D_Point3d *ptsIn, size_t numIn, ALG3D_Point3d **vertices, size_t *numVertices, size_t **indices, size_t *numIndices) |
Computes the convex hull of a 3D point set. More... | |
This module contains best-fit algorithms of point clouds with geometric primitives.
The most important optimization strategies are supported: classical Least-Squares (Gauss) and Minimum-Zone (Chebyshev). The least-squares algorithms utilize a combination of a singular-value-decomposition and a Levenberg-Marquardt strategy to solve the equation system with high numerical robustness. The optimization criterion is the minimization of the squared-distance perpendicular to the primitive's surface. The Minimum Zone algorithms solve a much more difficult problem that is the numerical minimization of the absolute maximum distance measured perpendicular to the primitiv's surface. Numerical methods from linear and quadratic programming are implemented in a highly efficient manner that are numerically robust even for large points clouds.
For each of the best-fit function constrains may be applied, eg. in order to keep the radius of a cylinder fixed and just solve for the remaining parameters. Therefore, the ALG3D_ApproximateFlags can be used. Most of the functions require to specify a maximum number of iterations for solving the optimization problem. Since this is a maximum number one may define for example 100. Typically, less than 10 iterations are required, only in ill-conditioned cases more iterations may be required.
struct ALG3D_Plane |
Data type for a plane.
Data Fields | ||
---|---|---|
ALG3D_Point3d | center | Point on plane. |
ALG3D_Point3d | direction | Direction vector of the plane. |
struct ALG3D_Line |
Data type for a 3D-line.
Data Fields | ||
---|---|---|
ALG3D_Point3d | center | Point on the line. |
ALG3D_Point3d | direction | Direction vector of the line. |
struct ALG3D_Circle |
Data type for a 3D-circle.
Data Fields | ||
---|---|---|
ALG3D_Point3d | center | Center of the circle. |
ALG3D_Point3d | direction | Direction vector of the plane the circle lies in. |
double | radius | Radius of the circle. |
struct ALG3D_Ellipse |
Data type for a 3D-Ellipse.
Data Fields | ||
---|---|---|
double | a | |
double | angle | Angular position within the plane with respect to the longer axis a. |
double | b | Radii of the ellipse, with a >= b. |
ALG3D_Point3d | center | Center of the ellipse. |
ALG3D_Point3d | direction | Direction vector of the plane the ellipse lies in. |
struct ALG3D_Superellipse |
Data type for a 3D-superellipse (Lamé-curve).
Data Fields | ||
---|---|---|
double | a | |
double | angle | Angular position within the plane with respect to the longer axis a. |
double | b | Radii of the superellipse, with a >= b. |
ALG3D_Point3d | center | Center of the superellipse. |
ALG3D_Point3d | direction | Direction vector of the plane the superellipse lies in. |
double | epsilon | Shape factor of the superellipse: rectangle (e<<1), ellipse/circle (e==1), diamond (e==2), star (e>2). |
struct ALG3D_Sphere |
Data type for a sphere.
Data Fields | ||
---|---|---|
ALG3D_Point3d | center | Center of the sphere. |
double | radius | Radius of the sphere. |
struct ALG3D_Cylinder |
Data type for a cylinder.
Data Fields | ||
---|---|---|
ALG3D_Point3d | center | Center of the cylinder (projection of the mass center onto the cylinder axis) |
ALG3D_Point3d | direction | Direction vector of the cylinder axis. |
double | radius | Radius of the cylinder. |
struct ALG3D_Cone |
Data type for a cone.
Data Fields | ||
---|---|---|
double | angle | Angle of the cone. |
ALG3D_Point3d | center | Center of the cone (projection of the mass center onto the cone axis) |
ALG3D_Point3d | direction | Direction vector of the cone axis. |
double | radius | Radius of the cone (at the height of the center point) |
struct ALG3D_Torus |
Data type for a torus.
Data Fields | ||
---|---|---|
ALG3D_Point3d | center | Center of the torus. |
ALG3D_Point3d | direction | Direction vector of the torus plane. |
double | radius1 | Radius of the ring. |
double | radius2 | Radius of the tube. |
#include <approximate.h>
Enum that provides flags to control the behaviour of the best-fit algoithms. Parameters of a geometric primitive may be initialized in order to support the optimization functions. Parameters may also be set fixed, which forces the algorithm to keep this value unchanged during optimization.
int __cdecl ALG3D_computeConvexHull | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Point3d ** | vertices, | ||
size_t * | numVertices, | ||
size_t ** | indices, | ||
size_t * | numIndices | ||
) |
#include <geometry.h>
Computes the convex hull of a 3D point set.
Computes the convex hull of a 3D point set as a triangle mesh. The function returns a list of vertices and indices that build the triangle mesh For example: the first triangle contains 3 vertices: v1=vertices[indices[0]], v2=vertices[indices[1]], v3=vertices[indices[2]]
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | vertices | pointer to begin of resulting point data for the vertices of the convex hull triangles (a sub of the input points) |
[out] | numVertices | resulting number of vertices |
[out] | indices | pointer to begin of resulting indices for the triangles pointing to vertices (in counterclockwise order). |
[out] | numIndices | number of points |
int ALG3D_computeMinimumBoundingCircle | ( | const ALG3D_Point3d * | v1, |
const ALG3D_Point3d * | v2, | ||
const ALG3D_Point3d * | v3, | ||
ALG3D_Point3d * | center, | ||
double * | radius | ||
) |
#include <geometry.cpp>
Computes the minimum bounding circle for a triangle. Computes the smallest circle that contains the 3 given vertices, but the circle must not pass through all of the vertices. The minimum bounding circle differs from the circumcircle, which requires to pass through all vertices and is equal or larger to the minimum bounding circle.
v1,v2,v3 | points/vertices of the triangle |
center | center of the minimum bounding circle |
radius | radius of the minimum bounding circle |
int ALG3D_computePrincipleComponents | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Point3d | components[3] | ||
) |
#include <geometry.cpp>
Computes the principal components of a 3D point set. The principal components are the directions of the main axes of a point sets. The three directions (normalized vectors) are perpendicular to each other and thus form a orthogonal system. Principal components are useful to analyze an unknown point set, e.g. in order to get to largest and smallest extents. The functions returns these components as three normalized vectors.
The components are sorted in decreasing order, that means, the first vector contains the direction of the largest extent of the point set.
ptsIn | pointer to the begin of the point data |
numIn | number of points |
components | three normalized vectors containing the principal components |
int ALG3D_distancesPoints2Circle | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Circle * | circle, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a 3D circle.
ptsIn | pointer to begin of point data |
numIn | number of points |
circle | circle object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the geometry. |
int ALG3D_distancesPoints2Cone | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Cone * | cone, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a cone.
ptsIn | pointer to begin of point data |
numIn | number of points |
cone | cone object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the geometry. |
int ALG3D_distancesPoints2Cylinder | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Cylinder * | cylinder, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a cylinder.
ptsIn | pointer to begin of point data |
numIn | number of points |
cylinder | cylinder object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the geometry. |
int ALG3D_distancesPoints2Ellipse | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Ellipse * | ellipse, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a 3D ellipse.
ptsIn | pointer to begin of point data |
numIn | number of points |
ellipse | ellipse object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the geometry. |
int ALG3D_distancesPoints2Line | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Line * | line, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a 3D line.
ptsIn | pointer to begin of point data |
numIn | number of points |
line | line object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn) |
int ALG3D_distancesPoints2Plane | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Plane * | plane, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a plane.
ptsIn | pointer to begin of point data |
numIn | number of points |
plane | plane object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies on the opposite side than the planes normal directs. |
int ALG3D_distancesPoints2Sphere | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Sphere * | sphere, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a sphere.
ptsIn | pointer to begin of point data |
numIn | number of points |
sphere | sphere object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the geometry. |
int ALG3D_distancesPoints2Superellipse | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Superellipse * | superellipse, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a 3D superellipse.
ptsIn | pointer to begin of point data |
numIn | number of points |
superellipse | superellipse object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the geometry. |
int ALG3D_distancesPoints2Torus | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Torus * | torus, | ||
double * | distances | ||
) |
#include <geometry.cpp>
Computes the distances of points to a torus.
ptsIn | pointer to begin of point data |
numIn | number of points |
torus | torus object |
distances | pointer to existing storage for the resulting distance values (must have the size of numIn). A negative distance indicates that the point lies inside the tube of the torus. |
int ALG3D_fitCircle | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Circle * | circle, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit circle in 3D with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
circle | circle object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags |
int ALG3D_fitCone | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Cone * | cone, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit cone with least-squares. Note that the cone radius is measured at the height of the cone center. The cone radius is an output parameter only and is ignored when given as input parameter.
ptsIn | pointer to begin of point data |
numIn | number of points |
cone | cone object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags. Note, that the radius cannot be initialized, because it is a return value |
int ALG3D_fitConeMZ | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Cone * | cone, | ||
double * | absMax, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit cone using the Chebyshev norm.
This function computes the best-fit cone by minimizing the Chebyshev norm (absolute maximum deviation). The resulting cone can be used to analyzed the conicity of the data points. The maximum absolute deviation is written to the variable absMax.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[in,out] | cone | cone object |
[out] | absMax | contains the absolute maximum deviation afterwards |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
[in] | flags | initialization flags |
int ALG3D_fitCylinder | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Cylinder * | cylinder, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit cylinder with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
cylinder | cylinder object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags |
int ALG3D_fitCylinderMC | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Cylinder * | cylinder, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes the minimum enclosing cylinder.
This function computes the minimum enclosing cylinder, i.e. the smallest cylinder that contains all points. It is equivalent to MZ line.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | cylinder | cylinder object |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitCylinderMI | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Cylinder * | cylinder, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes the maximum inscribed cylinder (Pferch cylinder).
This function computes the maximum inscribed cylinder, i.e. the largest cylinder that fits inside the given points.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | cylinder | cylinder object |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitCylinderMZ | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Cylinder * | cylinder, | ||
double * | absMax, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit cylinder using the Chebyshev norm.
This function computes the best-fit cylinder by minimizing the Chebyshev norm (absolute maximum deviation). The resulting cylinder can be used to analyzed the cylindricity of the data points, which is measured as the minimal width between two concentric cylinders that enclose the data points. The maximum absolute deviation which is half this width is written to the variable absMax.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[in,out] | cylinder | cylinder object |
[out] | absMax | contains the absolute maximum deviation afterwards |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
[in] | flags | initialization flags |
int ALG3D_fitEllipse | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Ellipse * | ellipse, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit ellipse in 3D with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
ellipse | ellipse object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags |
int ALG3D_fitLine | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Line * | line, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit line in 3D with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
line | Line object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | flags. This parameter only exists for interface compatibility and is ignored in the case of a line, because no parameter can be fixed. |
int ALG3D_fitLineMZ | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Line * | line, | ||
double * | absMax, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes best-fit 3D line using the Chebyshev norm.
This function computes the best-fit 3D line by minimizing the Chebyshev norm (absolute maximum deviation). The resulting line can be used to analyzed the straightness / linearity of the data points, which is measured as the radius of minimal cylinder that encloses the data points. The maximum absolute deviation is written to the variable absMax.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | line | line object |
[out] | absMax | contains the absolute maximum deviation afterwards |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitPlane | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Plane * | plane, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit plane with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
plane | plane object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags |
int ALG3D_fitPlaneMZ | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Plane * | plane, | ||
double * | absMax, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes best-fit plane using the Chebyshev norm.
This function computes the best-fit plane by minimizing the Chebyshev norm (absolute maximum deviation). The resulting plane can be used to analyzed the planarity of the data points, which is measured as the minimal width between two parallel planes that enclose the data points. The maximum absolute deviation which is half this width is written to the variable absMax.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | plane | plane object |
[out] | absMax | contains the absolute maximum deviation afterwards |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitPlanesMC | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Plane * | plane1, | ||
ALG3D_Plane * | plane2, | ||
double * | thickness, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes the minimum enclosing planes.
This function computes the minimum enclosing planes, i.e. two minimum distance parallel planes that contains all points. This function can be used to compute the thickness of a point set. It is equivalent to MZ plane.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | plane1,plane2 | two plane objects, their normal vectors will point towards each other |
[out] | thickness | thickness as the distance between the two planes |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitSphere | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Sphere * | sphere, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit sphere with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
sphere | sphere object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags |
int ALG3D_fitSphereMC | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Sphere * | sphere, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes the minimum enclosing sphere.
This function computes the minimum enclosing sphere, i.e. the smallest sphere that contains all points.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | sphere | sphere object |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitSphereMI | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Sphere * | sphere, | ||
int | iterations | ||
) |
#include <approximate.cpp>
Computes the maximum inscribed sphere (Pferch sphere).
This function computes the maximum inscribed sphere, i.e. the largest sphere that fits inside the given points.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[out] | sphere | sphere object |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
int ALG3D_fitSphereMZ | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Sphere * | sphere, | ||
double * | absMax, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit sphere using the Chebyshev norm.
This function computes the best-fit sphere by minimizing the Chebyshev norm (absolute maximum deviation). The maximum absolute deviation is written to the variable absMax.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[in,out] | sphere | sphere object |
[out] | absMax | contains the absolute maximum deviation afterwards |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
[in] | flags | initialization flags |
int ALG3D_fitSuperellipse | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Superellipse * | superellipse, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit superellipse with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
superellipse | superellipse object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags |
int ALG3D_fitTorus | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Torus * | torus, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit torus with least-squares.
ptsIn | pointer to begin of point data |
numIn | number of points |
torus | torus object |
iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
flags | initialization flags. |
int ALG3D_fitTorusMZ | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
ALG3D_Torus * | torus, | ||
double * | absMax, | ||
int | iterations, | ||
int | flags | ||
) |
#include <approximate.cpp>
Computes best-fit torus using the Chebyshev norm.
This function computes the best-fit torus by minimizing the Chebyshev norm (absolute maximum deviation). The maximum absolute deviation is written to the variable absMax.
[in] | ptsIn | pointer to begin of point data |
[in] | numIn | number of points |
[in,out] | torus | torus object |
[out] | absMax | contains the absolute maximum deviation afterwards |
[in] | iterations | maximum number of iterations (e.g. 100 is sufficient in most cases) |
[in] | flags | initialization flags |
int ALG3D_intersectLineCone | ( | const ALG3D_Line * | line, |
const ALG3D_Cone * | cone, | ||
ALG3D_Point3d * | ptsOut, | ||
size_t * | numOut | ||
) |
#include <geometry.cpp>
Computes the intersection between a 3D line and a cone.
line | line |
cone | cone |
ptsOut | existing storage for max. 2 intersection points |
numOut | number of intersection points (0, 1 or 2) |
int ALG3D_intersectLineCylinder | ( | const ALG3D_Line * | line, |
const ALG3D_Cylinder * | cylinder, | ||
ALG3D_Point3d * | ptsOut, | ||
size_t * | numOut | ||
) |
#include <geometry.cpp>
Computes the intersection between a 3D line and a cylinder.
line | line |
cylinder | cylinder |
ptsOut | existing storage for max. 2 intersection points |
numOut | number of intersection points (0, 1 or 2) |
int ALG3D_intersectLineLine | ( | const ALG3D_Line * | line1, |
const ALG3D_Line * | line2, | ||
ALG3D_Point3d * | point | ||
) |
#include <geometry.cpp>
Computes the intersection between two 3D lines. If the two lines are not parallel an intersection point will be computed. This point is computed from the position where the lines are closest. The middle point between the closest points on the lines is returned as the intersection point.
line1,line2 | two lines |
point | intersection point (if there is no intersection, e.g. parallel lines, ERR_CONDITION is returned) |
int ALG3D_intersectLinePlane | ( | const ALG3D_Line * | line, |
const ALG3D_Plane * | plane, | ||
ALG3D_Point3d * | point | ||
) |
#include <geometry.cpp>
Computes the intersection between 3D line and a plane.
line | line |
plane | plane |
point | intersection point (if there is no or infinite intersections, e.g. line is perpendicular to plane normal, ERR_CONDITION is returned) |
int ALG3D_intersectLineSphere | ( | const ALG3D_Line * | line, |
const ALG3D_Sphere * | sphere, | ||
ALG3D_Point3d * | ptsOut, | ||
size_t * | numOut | ||
) |
#include <geometry.cpp>
Computes the intersection between 3D line and a sphere.
line | line |
sphere | sphere |
ptsOut | existing storage for max. 2 intersection points |
numOut | number of intersection points (0, 1 or 2) |
int ALG3D_intersectPlanePlane | ( | const ALG3D_Plane * | plane1, |
const ALG3D_Plane * | plane2, | ||
ALG3D_Line * | line | ||
) |
#include <geometry.cpp>
Computes the intersection between two planes.
plane1,plane2 | two planes |
line | intersection line. If there are no or infinite intersections, e.g. parallel planes, ERR_CONDITION is returned. |
int ALG3D_intersectPlaneSphere | ( | const ALG3D_Plane * | plane, |
const ALG3D_Sphere * | sphere, | ||
ALG3D_Circle * | circle | ||
) |
#include <geometry.cpp>
Computes the intersection between a plane and a sphere.
plane | plane |
sphere | sphere |
circle | resulting intersection circle, if one exists. If the plane is tangent to sphere the resulting circle radius is 0. |
int ALG3D_projectPoints2Cone | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Cone * | cone, | ||
ALG3D_Point3d * | ptsOut | ||
) |
#include <geometry.cpp>
Computes the projections of points to a cone.
ptsIn | pointer to begin of point data |
numIn | number of points |
cone | cone object |
ptsOut | pointer to existing storage for the resulting projected points (must have the size of numIn). |
int ALG3D_projectPoints2Cylinder | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Cylinder * | cylinder, | ||
ALG3D_Point3d * | ptsOut | ||
) |
#include <geometry.cpp>
Computes the projections of points to a cylinder.
ptsIn | pointer to begin of point data |
numIn | number of points |
cylinder | cylinder object |
ptsOut | pointer to existing storage for the resulting projected points (must have the size of numIn). |
int ALG3D_projectPoints2Line | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Line * | line, | ||
ALG3D_Point3d * | ptsOut | ||
) |
#include <geometry.cpp>
Computes the projections of points to a 3D line.
ptsIn | pointer to begin of point data |
numIn | number of points |
line | line object |
ptsOut | pointer to existing storage for the resulting projected points (must have the size of numIn). |
int ALG3D_projectPoints2Plane | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Plane * | plane, | ||
ALG3D_Point3d * | ptsOut | ||
) |
#include <geometry.cpp>
Computes the projections of points to a plane.
ptsIn | pointer to begin of point data |
numIn | number of points |
plane | plane object |
ptsOut | pointer to existing storage for the resulting projected points (must have the size of numIn). |
int ALG3D_projectPoints2Sphere | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Sphere * | sphere, | ||
ALG3D_Point3d * | ptsOut | ||
) |
#include <geometry.cpp>
Computes the projections of points to a sphere.
ptsIn | pointer to begin of point data |
numIn | number of points |
sphere | sphere object |
ptsOut | pointer to existing storage for the resulting projected points (must have the size of numIn). |
int ALG3D_projectPoints2Torus | ( | const ALG3D_Point3d * | ptsIn, |
size_t | numIn, | ||
const ALG3D_Torus * | torus, | ||
ALG3D_Point3d * | ptsOut | ||
) |
#include <geometry.cpp>
Computes the projections of points to a torus.
ptsIn | pointer to begin of point data |
numIn | number of points |
torus | torus object |
ptsOut | pointer to existing storage for the resulting projected points (must have the size of numIn). |