#define
-ing FAST_COMPILE in PreProcess.h. However, this will make the compilation significantly slower.
#define
-ed.
#define
-ed.
Reconstructors.h
.
Using the functionality requires requires choosing a finite element type, FEMSig
and defining one input stream and two output streams.
FEMSig
describes the finite element type, which is a composite of the degree of the finite element and the boundary conditions it satisfies. Given an integer valued Degree
and boundary type BType
(one of BOUNDARY_FREE
, BOUNDARY_DIRICHLET
, and BOUNDARY_NEUMANN
defined in BSplineData.h
), the signature is defined by setting:
static const unsigned int FEMSig = FEMDegreeAndBType< Degree , BoundaryType >::Signature;
Real
is the floating point type used to represent data (typically float
) and Dim
is the integer dimension of the space (fixed at Dim
=3). The namespace Reconstructor
is omitted for brevity.
InputSampleStream< Real , Dim >
class.
The base class has two pure virtual methods that need to be over-ridden:
void reset( void )
:bool base_read( Point< Real , Dim > &p , Point< Real , Dim > &n )
:true
if the read was successful and false
if the read failed (i.e. the end of the stream was reached). The class Point< Real , Dim >
represents a point in Dim
-dimensional space, can be accessed like an array (i.e. overloads the bracked operator) and supports algebraic manipulation like addition and scalar multiplication.
OutputPolygonStream
class.
The base class has one pure virtual method that needs to be over-ridden:
void base_write( const std::vector< node_index_type > &polygon )
:std::vector
of integral indices. (The type node_index_type
is an unsigned int
if the BIG_DATA
macro is not defined an unsigned long long
if it is.)
OutputVertexStream< Real , Dim >
class.
The base class has one pure virtual method that needs to be over-ridden:
void base_write( Point< Real , Dim > p , Point< Real , Dim > g , Real w )
:p
, as well as the gradient, g
, and density weight, w
if the extraction code is asked to compute those.
Poisson::Implicit< Real , Dim , FEMSig >::Implicit( InputSampleStream< Real , Dim > &sStream , SolutionParameters< Real > sParams )
:sStream
) and a description of the reconstruction parameters (sParams
) desribing the depth, number of samples per node, etc. (Reconstructors.h
, line 229). This object derives from Implicit< Real , Dim , FEMSig >
.
void Implicit< Real , Dim , FEMSig >::extractLevelSet( OutputVertexStream< Real , Dim > &vStream , &pStream , LevelSetExtractionParameters meParams )
:vStream
and pStream
) and parameters for level-set extraction (meParams
) and computes the extracted triangle/polygon mesh, writing its vertices and faces into the corresponding output streams as they are generated (Reconstructors.h
, line 98).
Reconstruction.example.cpp
code.
std::vector
of std::vector< int >
s is defined in lines 164-179 and constructed in line 311.
std::vector
of Real
s is desfined in lines 182-192 and constructed in line 312.
RGBColor
type defined in lines 60-75).
% PoissonRecon --in horse.npts --out horse.ply --depth 10
or the SSD surface reconstructor
% SSDRecon --in horse.npts --out horse.ply --depth 10
% PoissonRecon --in bunny.points.ply --out bunny.ply --depth 10 --pointWeight 0
By default, the Poisson surface reconstructor uses degree-2 B-splines. A more efficient reconstruction can be obtained using degree-1 B-splines:
% PoissonRecon --in bunny.points.ply --out bunny.ply --depth 10 --pointWeight 0 --degree 1
(The SSD reconstructor requires B-splines of degree at least 2 since second derivatives are required to formulate the bi-Laplacian energy.)
% PoissonRecon --in eagle.points.ply --out eagle.pr.ply --depth 10
(with the RGBA color properties automatically detected from the .ply header).% SSDRecon --in eagle.points.ply --out eagle.ssd.ply --depth 10 --density
using the --density flag to indicate that density estimates should be output with the vertices of the mesh, and then calling:
% SurfaceTrimmer --in eagle.ssd.ply --out eagle.ssd.trimmed.ply --trim 7
to remove all subsets of the surface where the sampling density corresponds to a depth smaller than 7.% ChunkPly --in 1 eagle.ssd.trimmed.ply --out eagle.ssd.trimmed.chnks --width 4
which partitions the reconstruction into 11 pieces.
% PoissonRecon --in torso.points.ply --envelope torso.envelope.ply --out torso.pr.ply --depth 10
using the --envelope flag to specify the water-tight mesh constraining the reconstruction.<in dir>
and that a networked temporary folder <temp dir>
exists, a distributed reconstruction of the eagle over 4 clients at depth 10, outputting the reconstruction to eagle.ply
(relative to the directory from the server is run), can be obtained by calling:
% PoissonReconServer --count 4 --depth 10 --in <in dir>/eagle.points.ply --tempDir <temp dir>/temp --out eagle.ply
(with the RGBA color properties automatically detected from the .ply header).Server Address: <IPv4 address>:<port>
The four clients can then be executed by connecting them to the server:
% PoissonReconClient --port <port> --address <IPv4 address>
% PoissonReconClient --port <port> --address <IPv4 address>
% PoissonReconClient --port <port> --address <IPv4 address>
% PoissonReconClient --port <port> --address <IPv4 address>
Alternatively, the four clients can be executed serially:
% PoissonReconClient --port <port> --address <IPv4 address> --multi 4
% PointInterpolant --inValues quadratic.2D.fitting.samples --tree quadratic.2D.tree --dim 2
Then, the reconstructed function can be evaluated at the evaluation samples by calling the adaptive tree visualization:
% AdaptiveTreeVisualization --in quadratic.2D.tree --samples quadratic.2D.evaluation.samples
This will output the evaluation positions and values:
0 0 1.33836e-05
0.5 0 0.25001
0.5 0.5 0.500006
2 2 nan
Note that because the (last) evaluation position (2,2) is outside the bounding box of the fitting samples, the function cannot be evaluated at this point and a value of "nan" is output.
% ImageSitching --in pixels.png labels.png --out out.png
% EDTInHeat --in horse.ply --out horse.edt --depth 9
Then, the visualization code can be used to extract iso-surfaces from the implicit function.% AdaptiveTreeVisualization.exe --in horse.edt --mesh horse_0.01_.ply --iso 0.01 --flip
(By default, the surface is aligned so that the outward facing normal aligns with the negative gradient. Hence, specifying the --flip
flag is used to re-orient the surface.)% AdaptiveTreeVisualization.exe --in horse.edt --mesh horse_0.25_.ply --iso 0.25 --flip
(Since the default --scale
is 2, a value of 0.25 should still give a surface that is contained within the bounding box.)% AdaptiveTreeVisualization.exe --in horse.edt --grid horse.grid
PoissonRecon
and SSDRecon
to support processing of 2D point sets.
PoissonRecon
, SSDRecon
, and AdaptiveTreeVisualization
to support ouput to .jpg
and .png
image files.
DynamicFactory
object is dynamically allocated and not only known at construction time.
Poisson
and SSD
to be classes for cleaner library interface in Reconstruction.example.cpp
.