Artec 3D Scanning SDK
2.0
|
The Basics page highlights only fundamental API functions and usage scenarios.
You can use more classes and functions to implement advanced usage scenarios.
The table below lists interfaces for the most essential data types, whereas the figure shows their structure (by the example of IModel).
Interface | Meaning |
---|---|
IBlob | Memory chunk of undisclosed content |
IArrayPoint3F | Array of point positions |
IArrayIndexTriplet | Array of coordinate indices for triangles |
IArrayMatrix4x4D | Array of matrices |
IImage | Raster image |
IArrayUVCoordinates | Array of texture coordinates |
ITexture | IImage + UV coordinates + IArrayIndexTriplet |
IFrame | Captured frame |
IMesh | 3D surface without texture |
IFrameMesh | 3D surface obtained from the scanner (IMesh + IImage) |
ICompositeMesh | 3D surface obtained from algorithms (IMesh + ITexture) |
IScan | Set of IFrameMeshes |
ICompositeContainer | Set of ICompositeMeshes |
IModel | Set of IScans and ICompositeContainer |
IProject | Set of methods designed to work with data on a disk |
IModel is an array that includes both IScan and ICompositeContainer, although the latter might be empty.
IСompositeСontainer mirrors the IScan's structure except for ScannerType. Another distinction is that the source of the surfaces (CompositeMeshes) is the fusion algorithm output or various mesh upload.
FrameMeshes make sense when they are stored in a sequence container and feature information on their relative positions. IScan is a minimum unit for storing reconstructed frame-meshes with supplemental information. The structure is as follows: each FrameMesh is assigned a transformation matrix and undisclosed attributes. Scan as a single whole has its own attributes, transformation matrix and data on the source of the surfaces (ScannerType).
See the figure above for more details.
IProject is an interface designed to work with Artec Studio projects. It can save and load 3D data from the project (createNewProject() and openProject() functions). Each project consists of entries (scans and models) and has its unique identifier (UUID). Each of the entries also has its UUID and type (EntryType).
Working with projects is similar to the way we launch algorithms using the API using the launchJob() function.
First you may want to create function to run a job asynchronously with progress tracking:
Consult project-sample.cpp for details.
To load two scans, first, we need to determine their identifier (UUIDs):
IFrameMesh is designed to work with frames that have only a (single) texture obtained from the scanner. The IСompositeMesh interface, on the other hand, offers various methods for multiple textures that are outputs of an algorithm.
If your focus is only on geometry (e.g., you didn't capture or don't intend to map texture), you can use the parent class IMesh.
Scanner captures frames in the coordinate system that has its origin in the center of 3D camera (primary 3D camera for Spider). After being registered, frames are assigned transformation matrices. Each scan has its own coordinate system with the origin.
To obtain coordinates for each point of a mesh, call the IMesh::getPoints() method. This method returns IArrayPoint3F, which can return the point array using the IArrayPoint3F::getPointer() method.
The IFrameMesh::getUVCoordinates() method returns UV coordinates for each point of a mesh. Since not each frame has texture, first check it using the isTextured() method.
To move frames from the scanner camera coordinate system to the tripod mounting point, do the following:
Processing 3D Data outlines basic concepts of using algorithms. The IAlgorithm interface inherits from IJob, which represents a basic multithreaded work item. To run an IJob-based algorithm task, use either of the following calls:
To receive notification regarding completion of an IJob, implement your own completed() method for a JobObserverBase descendent. See project-sample.cpp for details.
For convenience, API includes the following classes related to reference counting.
We recommend using TRef
when working with classes that have names starting with I
(e.g., IScanner ):
The example below illustrates how to use a custom class with reference counting and efficient memory management: