This modules provides methods to generate triangle meshes from reconstruction volumes. Besides basic surface extraction, hole closing and decimation functionality is provided.
The example below illustrates the functionality.
Handle referencing a surface object.
A reme_surface_t represents a 3D mesh surface extracted from a volume. Its associated methods allow to influence the generation process, access mesh data and save volumes using our exporters.
Destroy a previously created surface object.
- Parameters
-
c | A pointer to a valid context object |
s | A mutable pointer to a valid surface handle to destroy |
- Return values
-
- Examples:
- example_reconstructmesdk_one_minute.cpp.
Access the poisson reconstruction options.
- Associated Protocol Buffers Specification
message poisson_options {
optional int32 depth = 1 [default = 8];
optional int32 solver_divide = 2 [default = 8];
optional int32 iso_divide = 3 [default = 8];
optional int32 minimum_samples_per_node = 4 [default = 1];
optional float scale = 5 [default = 1];
optional bool enable_clipping = 6 [default = false];
}
- Parameters
-
c | A valid context object |
s | A valid surface object |
o | A valid options binding object |
- Return values
-
- Examples:
- example_reconstructmesdk_options_lazy.cpp, example_reconstructmesdk_options_type_safe.cpp, and example_reconstructmesdk_surface.cpp.
Access the surface decimation options.
- Associated Protocol Buffers Specification
message decimation_options {
optional int32 maximum_faces = 1 [default = 100000];
optional int32 maximum_vertices = 2 [default = 0];
optional float maximum_error = 3 [default = 100000];
}
- Parameters
-
c | A valid context object |
s | A valid surface object |
o | A valid options binding object |
- Return values
-
- Examples:
- example_reconstructmesdk_surface.cpp.
Transform the surface.
This will transform the points and normals of the surface.
- Parameters
-
c | A valid context object |
s | A valid surface object |
coordinates | A pointer to constant Transform data. |
- Return values
-
- Examples:
- example_reconstructmesdk_surface.cpp.
Get points of a surface.
The surface points are represented as an array of floats where each point consists of 4 coordinates Px Py Pz Pw Px Py Pz Pw ...
. The w component is always zero.
Note the i-th point starts at index i * 4
of coordinate array returned.
- Memory Management Rules Exception
The returned coordinates pointer remains valid until the mesh changes.
- Parameters
-
c | A valid context object |
s | A valid surface object |
coordinates | A mutable pointer to constant point data. |
length | The number of coordinates returned. To get the number of points divide this value by 4. |
- Return values
-
Get point normals of a surface.
The surface point normals are represented as an array of floats where each point consists of 4 coordinates Px Py Pz Pw Px Py Pz Pw ...
. The w component is always zero.
Note the i-th point normal starts at index i * 4
of coordinate array returned.
- Memory Management Rules Exception
The returned coordinates pointer remains valid until the mesh changes.
- Parameters
-
c | A valid context object |
s | A valid surface object |
coordinates | A mutable pointer to constant point normal data. |
length | The number of coordinates returned. To get the number of point normals divide this value by 4. |
- Return values
-
Get triangle faces of a surface.
The triangle faces are represented as an array of unsigned integers (point indice s) where each triangle consists of 3 indices that represent that points that make up each face P0 P1 P2 P0 P1 P2 ...
.
Note the i-th triangle starts at index i * 3
of index array returned.
- Memory Management Rules Exception
The returned indices pointer remains valid until the mesh changes.
- Parameters
-
c | A valid context object |
s | A valid surface object |
indices | A mutable pointer to constant triangle index data. |
length | The number of indices returned. To get the number of triangles divide this value by 3. |
- Return values
-
Export the surface to file.
The exporter is chosen based on the file extension. Currently supported are
- .PLY - Polygon File Format
- .STL - StereoLithography
- .OBJ - Wavefront
- .3DS - 3D Studio Max
- Parameters
-
c | A valid context object |
s | A valid surface object |
filename | Filename to save mesh as |
- Return values
-
- Examples:
- example_reconstructmesdk_one_minute.cpp, and example_reconstructmesdk_surface.cpp.