CARLA
Classes | Typedefs | Functions
MeshReconstruction Namespace Reference

Classes

class  Cube
 
struct  IntersectInfo
 
struct  Mesh
 
struct  Rect3
 
struct  Vec3
 

Typedefs

using Fun3s = std::function< double(Vec3 const &)>
 
using Fun3v = std::function< Vec3(Vec3 const &)>
 
using Triangle = std::array< int, 3 >
 

Functions

Mesh MarchCube (Fun3s const &sdf, Rect3 const &domain)
 Reconstructs a triangle mesh from a given signed distance function using Marching Cubes. More...
 
Mesh MarchCube (Fun3s const &sdf, Rect3 const &domain, Vec3 const &cubeSize, double isoLevel=0, Fun3v sdfGrad=nullptr)
 Reconstructs a triangle mesh from a given signed distance function using Marching Cubes. More...
 
void Triangulate (IntersectInfo const &intersect, Fun3v const &grad, Mesh &mesh)
 Given a grid cube and an isolevel the triangles (5 max) required to represent the isosurface in the cube are computed. More...
 

Typedef Documentation

◆ Fun3s

using MeshReconstruction::Fun3s = typedef std::function<double(Vec3 const &)>

Definition at line 54 of file DataStructs.h.

◆ Fun3v

using MeshReconstruction::Fun3v = typedef std::function<Vec3(Vec3 const &)>

Definition at line 55 of file DataStructs.h.

◆ Triangle

using MeshReconstruction::Triangle = typedef std::array<int, 3>

Definition at line 45 of file DataStructs.h.

Function Documentation

◆ MarchCube() [1/2]

Mesh MeshReconstruction::MarchCube ( Fun3s const &  sdf,
Rect3 const &  domain 
)

Reconstructs a triangle mesh from a given signed distance function using Marching Cubes.

Parameters
sdfThe Signed Distance Function.
domainDomain of reconstruction.
Returns
The reconstructed mesh.

Definition at line 49 of file MeshReconstruction.h.

References MeshReconstruction::Rect3::size.

Referenced by carla::road::Map::SDFToMesh().

+ Here is the caller graph for this function:

◆ MarchCube() [2/2]

Mesh MeshReconstruction::MarchCube ( Fun3s const &  sdf,
Rect3 const &  domain,
Vec3 const &  cubeSize,
double  isoLevel = 0,
Fun3v  sdfGrad = nullptr 
)

Reconstructs a triangle mesh from a given signed distance function using Marching Cubes.

Parameters
sdfThe Signed Distance Function.
domainDomain of reconstruction.
cubeSizeSize of marching cubes. Smaller cubes yields meshes of higher resolution.
isoLevelLevel set of the SDF for which triangulation should be done. Changing this value moves the reconstructed surface.
sdfGradGradient of the SDF which yields the vertex normals of the reconstructed mesh. If none is provided a numerical approximation is used.
Returns
The reconstructed mesh.

Definition at line 57 of file MeshReconstruction.h.

References MeshReconstruction::Cube::Intersect(), MeshReconstruction::Rect3::min, min(), MeshReconstruction::Vec3::Norm(), MeshReconstruction::Rect3::size, Triangulate(), MeshReconstruction::Vec3::x, MeshReconstruction::Vec3::y, and MeshReconstruction::Vec3::z.

+ Here is the call graph for this function:

◆ Triangulate()

void MeshReconstruction::Triangulate ( IntersectInfo const &  intersect,
Fun3v const &  grad,
Mesh mesh 
)

Given a grid cube and an isolevel the triangles (5 max) required to represent the isosurface in the cube are computed.

Definition at line 279 of file Triangulation.h.

References MeshReconstruction::IntersectInfo::edgeVertIndices, MeshReconstruction::IntersectInfo::signConfig, MeshReconstruction::Mesh::triangles, MeshReconstruction::Mesh::vertexNormals, and MeshReconstruction::Mesh::vertices.

Referenced by MarchCube().

+ Here is the caller graph for this function: