MeshLib JavaScript Docs
Loading...
Searching...
No Matches
bindings.d.mts File Reference

Classes

class  NoiseSettings
class  AffineXf3f
class  BitSet
class  FaceBitSet
class  VertBitSet
class  EdgeBitSet
class  UndirectedEdgeBitSet
class  Box3f
class  Box3i
class  DistanceFromWeightedPointsParams
class  Color
class  CutMeshResult
class  CutMeshParameters
 Parameters of MR::cutMesh. More...
class  CutByProjectionSettings
 Settings structurer for cutMeshByProjection function. More...
class  FaceFace
 a pair of faces More...
class  SubdivideFillingSettings
class  SmoothFillingSettings
class  FillHoleNicelySettings
class  SelfIntersectionsSettings
 Setting set for mesh self-intersections fix. More...
class  SelfIntersections
class  FloatGrid
 wrapper class that helps mrbind to avoid excess MRVDBFloatGrid.h includes More...
class  FreeFormDeformer
 Class for deforming mesh using Bernstein interpolation. More...
class  ICPProperties
 parameters of ICP algorithm More...
class  ICP
class  Laplacian
class  SphereParams
class  Matrix3f
class  Mesh
class  BooleanResult
 Structure contain boolean result. More...
class  BooleanResultMapper
 Structure to map old mesh BitSets to new. More...
class  MeshBuilder
 Building topologies by triangles. More...
class  CollidingTriangleBitsets
class  VarEdgeTri
class  PreciseCollisionResult
class  ComponentsMapResult
class  LargeByAreaRegionsResult
class  MeshComponents
class  DecimateResult
 Results of MR::decimateMesh. More...
class  DecimateSettings
 Parameters structure for MR::decimateMesh. More...
class  RemeshSettings
class  FillHoleParams
 Parameters structure for MR::fillHole Structure has some options to control MR::fillHole. More...
class  StitchHolesParams
 Parameters structure for MR::stitchHoles Structure has some options to control MR::stitchHoles. More...
class  FixMeshDegeneraciesParams
class  MeshLoad
class  MeshDistanceResult
class  MeshMeshSignedDistanceResult
class  MeshOrPoints
class  MeshOrPointsXf
 an object and its transformation to global space with other objects More...
class  MeshProjectionResult
class  SignedMeshProjectionResult
class  MeshRelaxParams
class  MeshSave
class  SubdivideSettings
class  MeshTopology
class  MeshTriPoint
class  MultiwayICPSamplingParameters
 Parameters that are used for sampling of the MultiwayICP objects. More...
class  MultiwayICP
class  DenoiseViaNormalsSettings
class  BaseShellParameters
class  OffsetParameters
class  SharpOffsetParameters
class  GeneralOffsetParameters
 allows the user to select in the parameters which offset algorithm to call More...
class  PointCloud
class  TriangulationParameters
 Parameters of point cloud triangulation. More...
class  PointOnFace
 a point located on some mesh's face More...
class  PointsLoad
class  PointsSave
class  PointsToMeshParameters
class  MeshProjectionParameters
class  UniformSamplingSettings
class  GridMinMax
class  MeshToVolumeParams
class  GridToMeshSettings
 parameters of OpenVDB Grid to Mesh conversion using Dual Marching Cubes algorithm More...
class  VdbVolume
class  VertCoords
class  VertScalars
class  Triangulation
class  FaceNormals
class  VertMap
class  FaceMap
class  Face2RegionMap
class  VertColors
class  Vector3f
class  Vector3i
class  Vector3
class  VoxelsLoad
class  VoxelsSave
class  WeightedShellParametersBase
class  WeightedShellParametersMetric
class  WeightedShell

Enumerations

enum  FillPart { Both , Left , Right }
enum  ForceFill { None , Good , All }
enum  EdgeWeights { Unit , Cotan }
 determines the weight of each edge in applications like Laplacian More...
enum  VertexMass { Unit , NeiArea }
 determines the weight or mass of each vertex in applications like Laplacian More...
enum  RememberShape { Yes , No }
enum  OffsetMode { Smooth , Standard , Sharpening }
enum  SelfIntersectionsMethod { Relax , CutAndFill }
 Fix method. More...
enum  ICPMethod { Combined , PointToPoint , PointToPlane }
 The method how to update transformation from point pairs. More...
enum  ICPMode {
  RigidScale , AnyRigidXf , OrthogonalAxis , FixedAxis ,
  TranslationOnly
}
 The group of transformations, each with its own degrees of freedom. More...
enum  ICPExitType {
  NotStarted , NotFoundSolution , MaxIterations , MaxBadIterations ,
  StopMsdReached
}
enum  BooleanOperation {
  InsideA , InsideB , OutsideA , OutsideB ,
  Union , Intersection , DifferenceBA , DifferenceAB
}
enum  BooleanMapObject { A , B }
 Input object index enum. More...
enum  MeshComponentsFaceIncidence { PerEdge , PerVertex }
 Face incidence type. More...
enum  DecimateStrategy { MinimizeError , ShortestEdgeFirst }
 Defines the order of edge collapses inside Decimate algorithm. More...
enum  MultipleEdgesResolveMode { None , Simple , Strong }
enum  FixMeshDegeneraciesMode { Decimate , Remesh , RemeshPatch }
enum  MeshMeshCollisionStatus {
  BothOutside , BothInside , AInside , BInside ,
  Colliding , Touching , NotColliding
}
enum  CascadeMode { Sequential , AABBTreeBased }
enum  SignDetectionMode {
  Unsigned , OpenVDB , ProjectionNormal , WindingRule ,
  HoleWindingRule
}
 how to determine the sign of distances from a mesh More...
enum  MeshToVolumeType { Signed , Unsigned }

Functions

FloatGrid resampled (FloatGrid grid, number voxelScale)
 resample this grid to fit voxelScale
FloatGrid resampled (FloatGrid grid, number scaleX, number scaleY, number scaleZ)
 resample this grid to fit voxelScale
FloatGrid cropped (FloatGrid grid, Box3i box)
 returns cropped grid
void addNoise (Mesh mesh, NoiseSettings settings)
Uint32Array cutMeshByProjection (Mesh mesh, readonly Float32Array contours, CutByProjectionSettings settings)
 Performs orthographic projection with of given contours to mesh and cut result lines, fails if any point of contours has missed mesh on projection stage or cut contours contains self-intersections.
Mesh makeConvexHullFromMesh (Mesh mesh)
Mesh makeCube ()
Mesh makeCylinderAdvanced (number radius0, number radius1, number start_angle, number arc_size, number length, number resolution)
FaceBitSet fillHoleNicely (Mesh mesh, number holeEdge, FillHoleNicelySettings settings)
Mesh makeSphere (SphereParams params)
 creates a mesh of sphere with irregular triangulation
Mesh makeUVSphere (number radius, number horisontalResolution, number verticalResolution)
 creates a mesh of sphere with regular triangulation (parallels and meridians)
BooleanResult boolean (Mesh meshA, Mesh meshB, BooleanOperation operation)
 Performs CSG operation on two meshes.
BooleanResult boolean (Mesh meshA, Mesh meshB, BooleanOperation operation, BooleanResultMapper mapper)
 Performs CSG operation on two meshes.
boolean isInside (Mesh a, Mesh b)
 checks that arbitrary mesh part A is inside of closed mesh part B
FaceFace findCollidingTriangles (Mesh a, Mesh b)
 finds all pairs of colliding triangles from two meshes or two mesh regions
FaceFace findCollidingTriangles (Mesh a, Mesh b, boolean firstIntersectionOnly)
 finds all pairs of colliding triangles from two meshes or two mesh regions
CollidingTriangleBitsets findCollidingTriangleBitsets (Mesh a, Mesh b)
 the same as findCollidingTriangles, but returns one bite set per mesh with colliding triangles
FaceFace findSelfCollidingTriangles (Mesh mp)
 finds all pairs (or the fact of any self-collision) of colliding triangles from one mesh or a region
FaceBitSet findSelfCollidingTrianglesBS (Mesh mp)
 the same findSelfCollidingTriangles but returns the union of all self-intersecting faces
DecimateResult decimateMesh (Mesh mesh, DecimateSettings settings)
 Performs mesh simplification in mesh region according to the settings.
boolean remesh (Mesh mesh, RemeshSettings settings)
 Splits too long and eliminates too short edges from the mesh.
void makeDegenerateBandAroundRegion (Mesh mesh, FaceBitSet region)
 Create a band of degenerate faces along the border of the specified region and the rest of the mesh.
void fillHole (Mesh mesh, number a, FillHoleParams params)
 Fills hole in mesh
void fillHoles (Mesh mesh, readonly number as, FillHoleParams params)
 fill all holes given by their representative edges in
void stitchHoles (Mesh mesh, number a, number b, StitchHolesParams params)
 Stitches two holes in Mesh
void fixMeshDegeneracies (Mesh mesh, FixMeshDegeneraciesParams params)
 Fixes degenerate faces and short edges in mesh (changes topology)
void fixMultipleEdges (Mesh mesh)
 resolves given multiple edges, but splitting all but one edge in each group
FaceBitSet findDegenerateFaces (Mesh mp, number criticalAspectRatio)
 finds faces having aspect ratio >= criticalAspectRatio
UndirectedEdgeBitSet findShortEdges (Mesh mp, number criticalLength)
 finds edges having length <= criticalLength
FaceBitSet findHoleComplicatingFaces (Mesh mesh)
 adds in complicatingFaces the faces not from the wedge with largest angle of faces connected by edges incident to given vertex
MeshDistanceResult findDistance (Mesh a, Mesh b)
 computes minimal distance between two meshes or two mesh regions
MeshMeshSignedDistanceResult findSignedDistanceFromMesh (Mesh a, Mesh b)
FillHoleMetric getCircumscribedMetric (Mesh mesh)
FillHoleMetric getPlaneFillMetric (Mesh mesh, number e)
FillHoleMetric getPlaneNormalizedFillMetric (Mesh mesh, number e)
FillHoleMetric getComplexFillMetric (Mesh mesh, number e)
FillHoleMetric getEdgeLengthFillMetric (Mesh mesh)
FillHoleMetric getUniversalMetric (Mesh mesh)
FillHoleMetric getMinAreaMetric (Mesh mesh)
number calcCombinedFillMetric (Mesh mesh, FaceBitSet filledRegion, FillHoleMetric metric)
 Computes combined metric after filling a hole.
boolean relax (Mesh mesh, MeshRelaxParams params)
boolean relaxKeepVolume (Mesh mesh, MeshRelaxParams params)
number subdivideMesh (Mesh mesh, SubdivideSettings settings)
FaceBitSet expandFaces (MeshTopology topology, FaceBitSet region)
FaceBitSet shrinkFaces (MeshTopology topology, FaceBitSet region)
FaceBitSet getBoundaryFaces (MeshTopology topology, FaceBitSet region)
 returns faces from given region that have at least one neighbor face with shared edge not from the region
VertBitSet expandVerts (MeshTopology topology, VertBitSet region, number hops)
VertBitSet shrinkVerts (MeshTopology topology, VertBitSet region, number hops)
ContinuousContours orderIntersectionContours (MeshTopology topologyA, MeshTopology topologyB, PreciseCollisionResult intersections)
void meshDenoiseViaNormals (Mesh mesh)
void meshDenoiseViaNormals (Mesh mesh, DenoiseViaNormalsSettings settings)
number suggestVoxelSize (Mesh mp, number approxNumVoxels)
 computes size of a cubical voxel to get approximately given number of voxels during rasterization
Mesh offsetMesh (Mesh mp, number offset, OffsetParameters params)
Mesh doubleOffsetMesh (Mesh mp, number offsetA, number offsetB, OffsetParameters params)
Mesh mcOffsetMesh (Mesh mp, number offset, OffsetParameters params)
Mesh mcShellMeshRegion (Mesh mesh, FaceBitSet region, number offset, BaseShellParameters params)
Mesh sharpOffsetMesh (Mesh mp, number offset, SharpOffsetParameters params)
Mesh generalOffsetMesh (Mesh mp, number offset, GeneralOffsetParameters params)
Mesh thickenMesh (Mesh mesh, number offset, GeneralOffsetParameters params)
 mapping between original mesh and thicken result
CutMeshResult cutMesh (Mesh mesh, OneMeshContours contours, CutMeshParameters params)
 Cuts mesh by given contours.
Mesh makeConvexHullFromPoints (PointCloud pointCloud)
PointCloud meshToPointCloud (Mesh mesh, boolean saveNormals)
number findAvgPointsRadius (PointCloud pointCloud, number avgPoints)
 Finds the radius of ball, so on average that ball contained avgPoints excluding the central point.
number findAvgPointsRadius (PointCloud pointCloud, number avgPoints, number samples)
 Finds the radius of ball, so on average that ball contained avgPoints excluding the central point.
Mesh triangulatePointCloud (PointCloud pointCloud, TriangulationParameters params)
 Creates mesh from given point cloud according params Returns empty optional if was interrupted by progress bar.
Mesh pointsToMeshFusion (PointCloud cloud, PointsToMeshParameters params)
Float32Array findSignedDistances (Mesh refMesh, Mesh mesh, MeshProjectionParameters params)
 if projector is not given then CPU's computations will be used
CoordinateConverters getVectorConverters (Mesh a, Mesh b)
 creates simple converters from Vector3f to Vector3i and back in mesh parts area range
PreciseCollisionResult findCollidingEdgeTrisPrecise (Mesh a, Mesh b, CoordinateConverters conv)
 finds all pairs of colliding edges from one mesh and triangle from another mesh
OneMeshContours getOneMeshIntersectionContours (Mesh meshA, Mesh meshB, ContinuousContours contours, boolean getMeshAIntersections, CoordinateConverters converters)
 if true, then open self-intersection contours will be prolonged to terminal vertices
VertBitSet getIncidentVertsFromFaces (MeshTopology topology, FaceBitSet faces)
VertBitSet getIncidentVertsFromEdges (MeshTopology topology, UndirectedEdgeBitSet edges)
FaceBitSet getIncidentFacesFromVerts (MeshTopology topology, VertBitSet verts)
FaceBitSet getIncidentFacesFromEdges (MeshTopology topology, UndirectedEdgeBitSet edges)
UndirectedEdgeBitSet getIncidentEdgesFromFaces (MeshTopology topology, FaceBitSet faces)
UndirectedEdgeBitSet getIncidentEdgesFromEdges (MeshTopology topology, UndirectedEdgeBitSet edges)
VertBitSet getInnerVertsFromFaces (MeshTopology topology, FaceBitSet region)
VertBitSet getInnerVertsFromEdges (MeshTopology topology, UndirectedEdgeBitSet edges)
FaceBitSet getInnerFaces (MeshTopology topology, VertBitSet verts)
 composes the set of all faces with all their vertices in given set
UndirectedEdgeBitSet getInnerEdgesFromVerts (MeshTopology topology, VertBitSet verts)
UndirectedEdgeBitSet getInnerEdgesFromFaces (MeshTopology topology, FaceBitSet region)
VertBitSet getBoundaryVerts (MeshTopology topology, FaceBitSet region)
 composes the set of all boundary vertices for given region (or whole mesh if !region)
Uint32Array trackRightBoundaryLoop (MeshTopology topology, number e0)
Uint32Array findRightBoundary (MeshTopology topology)
Mesh makeTorus ()
Mesh makeTorus (number primaryRadius)
Mesh makeTorus (number primaryRadius, number secondaryRadius)
Mesh makeTorus (number primaryRadius, number secondaryRadius, number primaryResolution)
Mesh makeTorus (number primaryRadius, number secondaryRadius, number primaryResolution, number secondaryResolution)
Mesh makeTorusWithSelfIntersections (number primaryRadius, number secondaryRadius, number primaryResolution, number secondaryResolution)
VertBitSet pointUniformSampling (PointCloud pointCloud, UniformSamplingSettings settings)
GridMinMax evalGridMinMax (FloatGrid grid)
Mesh gridToMesh (FloatGrid grid, GridToMeshSettings settings)
 converts OpenVDB Grid into mesh using Dual Marching Cubes algorithm
VdbVolume meshToVolume (Mesh mp, MeshToVolumeParams params)
VdbVolume meshToDistanceVdbVolume (Mesh mp, MeshToVolumeParams params)
VdbVolume floatGridToVdbVolume (FloatGrid grid)
VertCoords computePerVertNormals (Mesh mesh)
 returns a vector with vertex normals in every element for valid mesh vertices
FaceNormals computePerFaceNormals (Mesh mesh)
 returns a vector with face-normal in every element for valid mesh faces
Mesh makeCube (Vector3f size)
Mesh makeCube (Vector3f size, Vector3f base)
MeshProjectionResult findProjection (Vector3f pt, Mesh mp)
 computes the closest point on mesh (or its region) to given point
SignedMeshProjectionResult findSignedDistanceFromPoint (Vector3f pt, Mesh mp)
number getValue (FloatGrid grid, Vector3i p)
 returns the value at given voxel
void setValue (FloatGrid grid, Vector3i p, number value)

Enumeration Type Documentation

◆ BooleanMapObject

Input object index enum.

Enumerator

◆ BooleanOperation

Enum class of available CSG operations

See also
MR::boolean
Enumerator
InsideA 
InsideB 
OutsideA 
OutsideB 
Union 
Intersection 
DifferenceBA 
DifferenceAB 

◆ CascadeMode

Enumerator
Sequential 
AABBTreeBased 

◆ DecimateStrategy

Defines the order of edge collapses inside Decimate algorithm.

Enumerator
MinimizeError 
ShortestEdgeFirst 

◆ EdgeWeights

determines the weight of each edge in applications like Laplacian

Enumerator
Unit 
Cotan 

◆ FillPart

enum FillPart

Caller can avoid filling non-needed part of cut faces to speedup cutting still add pseudo FaceId to opposite side to keep connectivity

Enumerator
Both 
Left 
Right 

◆ FixMeshDegeneraciesMode

Enumerator
Decimate 
Remesh 
RemeshPatch 

◆ ForceFill

enum ForceFill

This enum defines the MR::cutMesh behaviour in case of bad faces acure basicaly MR::cutMesh removes all faces which contours pass through, adds new edges to topology and fills all removed parts

Note
Bad faces here mean faces where contours have intersections and cannot be cut and filled in an good way
Enumerator
None 
Good 
All 

◆ ICPExitType

Enumerator
NotStarted 
NotFoundSolution 
MaxIterations 
MaxBadIterations 
StopMsdReached 

◆ ICPMethod

enum ICPMethod

The method how to update transformation from point pairs.

Enumerator
Combined 
PointToPoint 
PointToPlane 

◆ ICPMode

enum ICPMode

The group of transformations, each with its own degrees of freedom.

Enumerator
RigidScale 
AnyRigidXf 
OrthogonalAxis 
FixedAxis 
TranslationOnly 

◆ MeshComponentsFaceIncidence

Face incidence type.

Enumerator
PerEdge 
PerVertex 

◆ MeshMeshCollisionStatus

Enumerator
BothOutside 
BothInside 
AInside 
BInside 
Colliding 
Touching 
NotColliding 

◆ MeshToVolumeType

Enumerator
Signed 
Unsigned 

◆ MultipleEdgesResolveMode

If Strong makes additional efforts to avoid creating multiple edges, in some rare cases it is not possible (cases with extremely bad topology), if you faced one try to use MR::duplicateMultiHoleVertices before MR::fillHole

If Simple avoid creating edges that already exist in topology (default)

If None do not avoid multiple edges

Enumerator
None 
Simple 
Strong 

◆ OffsetMode

enum OffsetMode
Enumerator
Smooth 
Standard 
Sharpening 

◆ RememberShape

Enumerator
Yes 
No 

◆ SelfIntersectionsMethod

Fix method.

Enumerator
Relax 
CutAndFill 

◆ SignDetectionMode

how to determine the sign of distances from a mesh

Enumerator
Unsigned 
OpenVDB 
ProjectionNormal 
WindingRule 
HoleWindingRule 

◆ VertexMass

enum VertexMass

determines the weight or mass of each vertex in applications like Laplacian

Enumerator
Unit 
NeiArea 

Function Documentation

◆ addNoise()

void addNoise ( Mesh mesh,
NoiseSettings settings )

◆ boolean() [1/2]

BooleanResult boolean ( Mesh meshA,
Mesh meshB,
BooleanOperation operation )

Performs CSG operation on two meshes.

Makes new mesh - result of boolean operation on mesh A and mesh B

Parameters
meshAInput mesh A
meshBInput mesh B
operationCSG operation to perform
rigidB2ATransform from mesh B space to mesh A space
mapperOptional output structure to map mesh A and mesh B topology to result mesh topology
Note
Input meshes should have no self-intersections in intersecting zone
If meshes are not closed in intersecting zone some boolean operations are not allowed (as far as input meshes interior and exterior cannot be determined)

◆ boolean() [2/2]

BooleanResult boolean ( Mesh meshA,
Mesh meshB,
BooleanOperation operation,
BooleanResultMapper mapper )

Performs CSG operation on two meshes.

Makes new mesh - result of boolean operation on mesh A and mesh B

Parameters
meshAInput mesh A
meshBInput mesh B
operationCSG operation to perform
rigidB2ATransform from mesh B space to mesh A space
mapperOptional output structure to map mesh A and mesh B topology to result mesh topology
Note
Input meshes should have no self-intersections in intersecting zone
If meshes are not closed in intersecting zone some boolean operations are not allowed (as far as input meshes interior and exterior cannot be determined)

◆ calcCombinedFillMetric()

number calcCombinedFillMetric ( Mesh mesh,
FaceBitSet filledRegion,
FillHoleMetric metric )

Computes combined metric after filling a hole.

◆ computePerFaceNormals()

FaceNormals computePerFaceNormals ( Mesh mesh)

returns a vector with face-normal in every element for valid mesh faces

◆ computePerVertNormals()

VertCoords computePerVertNormals ( Mesh mesh)

returns a vector with vertex normals in every element for valid mesh vertices

◆ cropped()

FloatGrid cropped ( FloatGrid grid,
Box3i box )

returns cropped grid

◆ cutMesh()

CutMeshResult cutMesh ( Mesh mesh,
OneMeshContours contours,
CutMeshParameters params )

Cuts mesh by given contours.

This function cuts mesh making new edges paths on place of input contours

Parameters
meshInput mesh that will be cut
contoursInput contours to cut mesh with, find more MR::OneMeshContours
paramsParameters describing some cut options, find more MR::CutMeshParameters
Returns
New edges that correspond to given contours, find more MR::CutMeshResult
Warning
Input contours should have no intersections, faces where contours intersects (bad faces) will not be allowed for fill
Input mesh will be changed in any case, if bad faces are in mesh, mesh will be spoiled, so if you cannot guarantee contours without intersections better make copy of mesh, before using this function

◆ cutMeshByProjection()

Uint32Array cutMeshByProjection ( Mesh mesh,
readonly Float32Array contours,
CutByProjectionSettings settings )

Performs orthographic projection with of given contours to mesh and cut result lines, fails if any point of contours has missed mesh on projection stage or cut contours contains self-intersections.

Note
it might be useful to subdivide mesh before cut, to avoid issues related to lone contours
Parameters
meshfor cutting, it will be changed
contoursfor projection onto mesh
settingsto specify direction and contours to mesh space transformation
Returns
newly appeared edges on the mesh after cut or error

◆ decimateMesh()

DecimateResult decimateMesh ( Mesh mesh,
DecimateSettings settings )

Performs mesh simplification in mesh region according to the settings.

◆ doubleOffsetMesh()

Mesh doubleOffsetMesh ( Mesh mp,
number offsetA,
number offsetB,
OffsetParameters params )

Offsets mesh by converting it to voxels and back two times only closed meshes allowed (only Offset mode) typically offsetA and offsetB have distinct signs

◆ evalGridMinMax()

GridMinMax evalGridMinMax ( FloatGrid grid)

◆ expandFaces()

FaceBitSet expandFaces ( MeshTopology topology,
FaceBitSet region )

returns given region with all faces sharing an edge with a region face;

Parameters
stopEdges- neighborhood via this edges will be ignored

◆ expandVerts()

VertBitSet expandVerts ( MeshTopology topology,
VertBitSet region,
number hops )

◆ fillHole()

void fillHole ( Mesh mesh,
number a,
FillHoleParams params )

Fills hole in mesh

Fills given hole represented by one of its edges (having no valid left face), uses fillHoleTrivially if cannot fill hole without multiple edges, default metric: CircumscribedFillMetric

Next picture show, how newly generated faces can be smoothed MR::positionVertsSmoothly MR::subdivideMesh

Parameters
meshmesh with hole
aEdgeId which represents hole (should not have valid left FaceId)
paramsparameters of hole filling
See also
stitchHoles
fillHoleTrivially
FillHoleParams

◆ fillHoleNicely()

FaceBitSet fillHoleNicely ( Mesh mesh,
number holeEdge,
FillHoleNicelySettings settings )

fills a hole in mesh specified by one of its edge, optionally subdivides new patch on smaller triangles, optionally make smooth connection with existing triangles outside the hole

Returns
triangles of the patch

◆ fillHoles()

void fillHoles ( Mesh mesh,
readonly number as,
FillHoleParams params )

fill all holes given by their representative edges in

Parameters
as

◆ findAvgPointsRadius() [1/2]

number findAvgPointsRadius ( PointCloud pointCloud,
number avgPoints )

Finds the radius of ball, so on average that ball contained avgPoints excluding the central point.

Parameters
samplesthe number of test points to find given number of samples in each

◆ findAvgPointsRadius() [2/2]

number findAvgPointsRadius ( PointCloud pointCloud,
number avgPoints,
number samples )

Finds the radius of ball, so on average that ball contained avgPoints excluding the central point.

Parameters
samplesthe number of test points to find given number of samples in each

◆ findCollidingEdgeTrisPrecise()

PreciseCollisionResult findCollidingEdgeTrisPrecise ( Mesh a,
Mesh b,
CoordinateConverters conv )

finds all pairs of colliding edges from one mesh and triangle from another mesh

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation
anyIntersectionif true then the function returns as fast as it finds any intersection

◆ findCollidingTriangleBitsets()

CollidingTriangleBitsets findCollidingTriangleBitsets ( Mesh a,
Mesh b )

the same as findCollidingTriangles, but returns one bite set per mesh with colliding triangles

◆ findCollidingTriangles() [1/2]

FaceFace findCollidingTriangles ( Mesh a,
Mesh b )

finds all pairs of colliding triangles from two meshes or two mesh regions

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation
firstIntersectionOnlyif true then the function returns at most one pair of intersecting triangles and returns faster

◆ findCollidingTriangles() [2/2]

FaceFace findCollidingTriangles ( Mesh a,
Mesh b,
boolean firstIntersectionOnly )

finds all pairs of colliding triangles from two meshes or two mesh regions

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation
firstIntersectionOnlyif true then the function returns at most one pair of intersecting triangles and returns faster

◆ findDegenerateFaces()

FaceBitSet findDegenerateFaces ( Mesh mp,
number criticalAspectRatio )

finds faces having aspect ratio >= criticalAspectRatio

◆ findDistance()

MeshDistanceResult findDistance ( Mesh a,
Mesh b )

computes minimal distance between two meshes or two mesh regions

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation
upDistLimitSqupper limit on the distance in question, if the real distance is larger then the function exists returning upDistLimitSq and no valid points

◆ findHoleComplicatingFaces()

FaceBitSet findHoleComplicatingFaces ( Mesh mesh)

adds in complicatingFaces the faces not from the wedge with largest angle of faces connected by edges incident to given vertex

◆ findProjection()

MeshProjectionResult findProjection ( Vector3f pt,
Mesh mp )

computes the closest point on mesh (or its region) to given point

Parameters
upDistLimitSqupper limit on the distance in question, if the real distance is larger then the function exits returning upDistLimitSq and no valid point
xfmesh-to-point transformation, if not specified then identity transformation is assumed
loDistLimitSqlow limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one
validFacesif provided then only faces from there will be considered as projections
validProjectionsif provided then only projections passed this test can be returned

◆ findRightBoundary()

Uint32Array findRightBoundary ( MeshTopology topology)

returns all region boundary loops; every loop has region faces on the right, and not-region faces or holes on the left

◆ findSelfCollidingTriangles()

FaceFace findSelfCollidingTriangles ( Mesh mp)

finds all pairs (or the fact of any self-collision) of colliding triangles from one mesh or a region

if true then treat touching faces as self-intersections too

◆ findSelfCollidingTrianglesBS()

FaceBitSet findSelfCollidingTrianglesBS ( Mesh mp)

the same findSelfCollidingTriangles but returns the union of all self-intersecting faces

if true then treat touching faces as self-intersections too

◆ findShortEdges()

UndirectedEdgeBitSet findShortEdges ( Mesh mp,
number criticalLength )

finds edges having length <= criticalLength

◆ findSignedDistanceFromMesh()

MeshMeshSignedDistanceResult findSignedDistanceFromMesh ( Mesh a,
Mesh b )

◆ findSignedDistanceFromPoint()

SignedMeshProjectionResult findSignedDistanceFromPoint ( Vector3f pt,
Mesh mp )

◆ findSignedDistances()

Float32Array findSignedDistances ( Mesh refMesh,
Mesh mesh,
MeshProjectionParameters params )

if projector is not given then CPU's computations will be used

Computes signed distances from given test points to the closest point on the reference mesh: positive value - outside reference mesh, negative - inside reference mesh; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh

◆ fixMeshDegeneracies()

void fixMeshDegeneracies ( Mesh mesh,
FixMeshDegeneraciesParams params )

Fixes degenerate faces and short edges in mesh (changes topology)

◆ fixMultipleEdges()

void fixMultipleEdges ( Mesh mesh)

resolves given multiple edges, but splitting all but one edge in each group

◆ floatGridToVdbVolume()

VdbVolume floatGridToVdbVolume ( FloatGrid grid)

◆ generalOffsetMesh()

Mesh generalOffsetMesh ( Mesh mp,
number offset,
GeneralOffsetParameters params )

Offsets mesh by converting it to voxels and back using one of three modes specified in the parameters

◆ getBoundaryFaces()

FaceBitSet getBoundaryFaces ( MeshTopology topology,
FaceBitSet region )

returns faces from given region that have at least one neighbor face with shared edge not from the region

◆ getBoundaryVerts()

VertBitSet getBoundaryVerts ( MeshTopology topology,
FaceBitSet region )

composes the set of all boundary vertices for given region (or whole mesh if !region)

◆ getCircumscribedMetric()

FillHoleMetric getCircumscribedMetric ( Mesh mesh)

This metric minimizes the sum of circumcircle radii for all triangles in the triangulation. It is rather fast to calculate, and it results in typically good triangulations. It is measured in length units.

◆ getComplexFillMetric()

FillHoleMetric getComplexFillMetric ( Mesh mesh,
number e )

This metric minimizes the sum of triangleMetric for all triangles in the triangulation plus the sum edgeMetric for all edges inside and on the boundary of the triangulation. Where triangleMetric is proportional to weighted triangle area and triangle aspect ratio edgeMetric grows with angle between triangles as ( ( 1 - cos( x ) ) / ( 1 + cos( x ) ) ) ^ 4. It is unitless.

◆ getEdgeLengthFillMetric()

FillHoleMetric getEdgeLengthFillMetric ( Mesh mesh)

Simple metric minimizing the sum of all edge lengths It is measured in length units.

◆ getIncidentEdgesFromEdges()

UndirectedEdgeBitSet getIncidentEdgesFromEdges ( MeshTopology topology,
UndirectedEdgeBitSet edges )

◆ getIncidentEdgesFromFaces()

UndirectedEdgeBitSet getIncidentEdgesFromFaces ( MeshTopology topology,
FaceBitSet faces )

◆ getIncidentFacesFromEdges()

FaceBitSet getIncidentFacesFromEdges ( MeshTopology topology,
UndirectedEdgeBitSet edges )

◆ getIncidentFacesFromVerts()

FaceBitSet getIncidentFacesFromVerts ( MeshTopology topology,
VertBitSet verts )

◆ getIncidentVertsFromEdges()

VertBitSet getIncidentVertsFromEdges ( MeshTopology topology,
UndirectedEdgeBitSet edges )

◆ getIncidentVertsFromFaces()

VertBitSet getIncidentVertsFromFaces ( MeshTopology topology,
FaceBitSet faces )

◆ getInnerEdgesFromFaces()

UndirectedEdgeBitSet getInnerEdgesFromFaces ( MeshTopology topology,
FaceBitSet region )

◆ getInnerEdgesFromVerts()

UndirectedEdgeBitSet getInnerEdgesFromVerts ( MeshTopology topology,
VertBitSet verts )

◆ getInnerFaces()

FaceBitSet getInnerFaces ( MeshTopology topology,
VertBitSet verts )

composes the set of all faces with all their vertices in given set

◆ getInnerVertsFromEdges()

VertBitSet getInnerVertsFromEdges ( MeshTopology topology,
UndirectedEdgeBitSet edges )

◆ getInnerVertsFromFaces()

VertBitSet getInnerVertsFromFaces ( MeshTopology topology,
FaceBitSet region )

◆ getMinAreaMetric()

FillHoleMetric getMinAreaMetric ( Mesh mesh)

This metric is for triangulation construction with minimal summed area of triangles. It is measured in squared length units. Warning: this metric can produce degenerated triangles

◆ getOneMeshIntersectionContours()

OneMeshContours getOneMeshIntersectionContours ( Mesh meshA,
Mesh meshB,
ContinuousContours contours,
boolean getMeshAIntersections,
CoordinateConverters converters )

if true, then open self-intersection contours will be prolonged to terminal vertices

Converts contours given in topological terms as the intersections of one mesh's edge and another mesh's triangle (ContinuousContours), into contours of meshA and/or meshB given as a sequence of (primitiveId and Cartesian coordinates); converters are required for better precision in case of degenerations; note that contours should not have intersections

◆ getPlaneFillMetric()

FillHoleMetric getPlaneFillMetric ( Mesh mesh,
number e )

Same as getCircumscribedFillMetric, but with extra penalty for the triangles having normals looking in the opposite side of plane containing left of (e). It is measured in length units.

◆ getPlaneNormalizedFillMetric()

FillHoleMetric getPlaneNormalizedFillMetric ( Mesh mesh,
number e )

Similar to getPlaneFillMetric with extra penalty for the triangles having normals looking in the opposite side of plane containing left of (e), but the metric minimizes the sum of circumcircle radius times aspect ratio for all triangles in the triangulation. It is measured in length units.

◆ getUniversalMetric()

FillHoleMetric getUniversalMetric ( Mesh mesh)

This metric consists of two parts 1) for each triangle: it is the circumcircle diameter, this avoids the appearance of degenerate triangles; 2) for each edge: square root of double total area of triangles to its left and right times the factor depending extensionally on absolute dihedral angle between left and right triangles, this makes visually triangulated surface as smooth as possible. It is measured in length units. For planar holes it is the same as getCircumscribedMetric.

◆ getValue()

number getValue ( FloatGrid grid,
Vector3i p )

returns the value at given voxel

◆ getVectorConverters()

CoordinateConverters getVectorConverters ( Mesh a,
Mesh b )

creates simple converters from Vector3f to Vector3i and back in mesh parts area range

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation

◆ gridToMesh()

Mesh gridToMesh ( FloatGrid grid,
GridToMeshSettings settings )

converts OpenVDB Grid into mesh using Dual Marching Cubes algorithm

◆ isInside()

boolean isInside ( Mesh a,
Mesh b )

checks that arbitrary mesh part A is inside of closed mesh part B

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation

◆ makeConvexHullFromMesh()

Mesh makeConvexHullFromMesh ( Mesh mesh)

◆ makeConvexHullFromPoints()

Mesh makeConvexHullFromPoints ( PointCloud pointCloud)

◆ makeCube() [1/3]

Mesh makeCube ( )

creates box mesh with given min-corner (base) and given size in every dimension; with default parameters, creates unit cube mesh with the centroid in (0,0,0)

◆ makeCube() [2/3]

Mesh makeCube ( Vector3f size)

creates box mesh with given min-corner (base) and given size in every dimension; with default parameters, creates unit cube mesh with the centroid in (0,0,0)

◆ makeCube() [3/3]

Mesh makeCube ( Vector3f size,
Vector3f base )

creates box mesh with given min-corner (base) and given size in every dimension; with default parameters, creates unit cube mesh with the centroid in (0,0,0)

◆ makeCylinderAdvanced()

Mesh makeCylinderAdvanced ( number radius0,
number radius1,
number start_angle,
number arc_size,
number length,
number resolution )

◆ makeDegenerateBandAroundRegion()

void makeDegenerateBandAroundRegion ( Mesh mesh,
FaceBitSet region )

Create a band of degenerate faces along the border of the specified region and the rest of the mesh.

The function is useful for extruding the region without changing the existing faces and creating holes

Parameters
mesh- the target mesh
region- the region required to be separated by a band of degenerate faces
params- optional output parameters

◆ makeSphere()

Mesh makeSphere ( SphereParams params)

creates a mesh of sphere with irregular triangulation

◆ makeTorus() [1/5]

Mesh makeTorus ( )

◆ makeTorus() [2/5]

Mesh makeTorus ( number primaryRadius)

◆ makeTorus() [3/5]

Mesh makeTorus ( number primaryRadius,
number secondaryRadius )

◆ makeTorus() [4/5]

Mesh makeTorus ( number primaryRadius,
number secondaryRadius,
number primaryResolution )

◆ makeTorus() [5/5]

Mesh makeTorus ( number primaryRadius,
number secondaryRadius,
number primaryResolution,
number secondaryResolution )

◆ makeTorusWithSelfIntersections()

Mesh makeTorusWithSelfIntersections ( number primaryRadius,
number secondaryRadius,
number primaryResolution,
number secondaryResolution )

◆ makeUVSphere()

Mesh makeUVSphere ( number radius,
number horisontalResolution,
number verticalResolution )

creates a mesh of sphere with regular triangulation (parallels and meridians)

◆ mcOffsetMesh()

Mesh mcOffsetMesh ( Mesh mp,
number offset,
OffsetParameters params )

Offsets mesh by converting it to distance field in voxels (using OpenVDB library if SignDetectionMode::OpenVDB or our implementation otherwise) and back using standard Marching Cubes, as opposed to Dual Marching Cubes in offsetMesh(...)

◆ mcShellMeshRegion()

Mesh mcShellMeshRegion ( Mesh mesh,
FaceBitSet region,
number offset,
BaseShellParameters params )

Constructs a shell around selected mesh region with the properties that every point on the shall must

  1. be located not further than given distance from selected mesh part,
  2. be located not closer to not-selected mesh part than to selected mesh part.

◆ meshDenoiseViaNormals() [1/2]

void meshDenoiseViaNormals ( Mesh mesh)

Reduces noise in given mesh, see the article "Mesh Denoising via a Novel Mumford-Shah Framework"

◆ meshDenoiseViaNormals() [2/2]

void meshDenoiseViaNormals ( Mesh mesh,
DenoiseViaNormalsSettings settings )

Reduces noise in given mesh, see the article "Mesh Denoising via a Novel Mumford-Shah Framework"

◆ meshToDistanceVdbVolume()

VdbVolume meshToDistanceVdbVolume ( Mesh mp,
MeshToVolumeParams params )

converts mesh (or its part) into a volume filled with signed or unsigned distances to mesh using OpenVDB library; for signed distances the mesh must be closed; *params.outXf is untouched

◆ meshToPointCloud()

PointCloud meshToPointCloud ( Mesh mesh,
boolean saveNormals )

◆ meshToVolume()

VdbVolume meshToVolume ( Mesh mp,
MeshToVolumeParams params )

converts mesh (or its part) into a volume filled with signed or unsigned distances to mesh using OpenVDB library; for signed distances the mesh must be closed; prior to conversion, world space is shifted to ensure that the bounding box of offset mesh is in positive quarter-space, and the shift is written in *params.outXf

◆ offsetMesh()

Mesh offsetMesh ( Mesh mp,
number offset,
OffsetParameters params )

Offsets mesh by converting it to distance field in voxels using OpenVDB library, signDetectionMode = Unsigned(from OpenVDB) | OpenVDB | HoleWindingRule, and then converts back using OpenVDB library (dual marching cubes), so result mesh is always closed

◆ orderIntersectionContours()

ContinuousContours orderIntersectionContours ( MeshTopology topologyA,
MeshTopology topologyB,
PreciseCollisionResult intersections )

Combines unordered input intersections (and flips orientation of intersected edges from mesh B) into ordered oriented contours with the properties:

  1. Each contour is a. either closed (then its first and last elements are equal), b. or open (then its first and last intersected edges are boundary edges).
  2. Next intersection in a contour is located to the left of the current intersected edge: a. if the current and next intersected triangles are the same, then next intersected edge is either next( curr.edge ) or prev( curr.edge.sym() ).sym(), b. otherwise next intersected triangle is left( curr.edge ) and next intersected edge is one of the edges having the current intersected triangle to the right.
  3. Orientation of intersected edges in each pair of (intersected edge, intersected triangle): a. the intersected edge of mesh A is directed from negative half-space of the intersected triangle from mesh B to its positive half-space, b. the intersected edge of mesh B is directed from positive half-space of the intersected triangle from mesh A to its negative half-space.
  4. Orientation of contours: a. left of contours on mesh A is inside of mesh B (consequence of 3a), b. right of contours on mesh B is inside of mesh A (consequence of 3b).

◆ pointsToMeshFusion()

Mesh pointsToMeshFusion ( PointCloud cloud,
PointsToMeshParameters params )

makes mesh from points with normals by constructing intermediate volume with signed distances and then using marching cubes algorithm to extract the surface from there

◆ pointUniformSampling()

VertBitSet pointUniformSampling ( PointCloud pointCloud,
UniformSamplingSettings settings )

Sample vertices, removing ones that are too close; returns std::nullopt if it was terminated by the callback

◆ relax()

boolean relax ( Mesh mesh,
MeshRelaxParams params )

applies given number of relaxation iterations to the whole mesh ( or some region if it is specified )

Returns
true if was finished successfully, false if was interrupted by progress callback

◆ relaxKeepVolume()

boolean relaxKeepVolume ( Mesh mesh,
MeshRelaxParams params )

applies given number of relaxation iterations to the whole mesh ( or some region if it is specified ) do not really keeps volume but tries hard

Returns
true if the operation completed successfully, and false if it was interrupted by the progress callback.

◆ remesh()

boolean remesh ( Mesh mesh,
RemeshSettings settings )

Splits too long and eliminates too short edges from the mesh.

◆ resampled() [1/2]

FloatGrid resampled ( FloatGrid grid,
number scaleX,
number scaleY,
number scaleZ )

resample this grid to fit voxelScale

◆ resampled() [2/2]

FloatGrid resampled ( FloatGrid grid,
number voxelScale )

resample this grid to fit voxelScale

◆ setValue()

void setValue ( FloatGrid grid,
Vector3i p,
number value )

sets given region voxels value

Note
region is in grid space (0 voxel id is minimum active voxel in grid)

◆ sharpOffsetMesh()

Mesh sharpOffsetMesh ( Mesh mp,
number offset,
SharpOffsetParameters params )

Offsets mesh by converting it to voxels and back post process result using reference mesh to sharpen features

◆ shrinkFaces()

FaceBitSet shrinkFaces ( MeshTopology topology,
FaceBitSet region )

returns given region without all faces sharing an edge with not-region face;

Parameters
stopEdges- neighborhood via this edges will be ignored

◆ shrinkVerts()

VertBitSet shrinkVerts ( MeshTopology topology,
VertBitSet region,
number hops )

◆ stitchHoles()

void stitchHoles ( Mesh mesh,
number a,
number b,
StitchHolesParams params )

Stitches two holes in Mesh

Build cylindrical patch to fill space between two holes represented by one of their edges each, default metric: ComplexStitchMetric

Next picture show, how newly generated faces can be smoothed MR::positionVertsSmoothly MR::subdivideMesh

Parameters
meshmesh with hole
aEdgeId which represents 1st hole (should not have valid left FaceId)
bEdgeId which represents 2nd hole (should not have valid left FaceId)
paramsparameters of holes stitching
See also
fillHole
StitchHolesParams

◆ subdivideMesh()

number subdivideMesh ( Mesh mesh,
SubdivideSettings settings )

splits edges in mesh region according to the settings;

Returns
The total number of edge splits performed

◆ suggestVoxelSize()

number suggestVoxelSize ( Mesh mp,
number approxNumVoxels )

computes size of a cubical voxel to get approximately given number of voxels during rasterization

◆ thickenMesh()

Mesh thickenMesh ( Mesh mesh,
number offset,
GeneralOffsetParameters params )

mapping between original mesh and thicken result

in case of positive offset, returns the mesh consisting of offset mesh merged with inversed original mesh (thickening mode); in case of negative offset, returns the mesh consisting of inversed offset mesh merged with original mesh (hollowing mode); if your input mesh is open then please specify params.signDetectionMode = SignDetectionMode::Unsigned, and you will get open mesh (with several components) on output if your input mesh is closed then please specify another sign detection mode, and you will get closed mesh (with several components) on output;

◆ trackRightBoundaryLoop()

Uint32Array trackRightBoundaryLoop ( MeshTopology topology,
number e0 )

returns closed loop of region boundary starting from given region boundary edge (region faces on the right, and not-region faces or holes on the left); if more than two boundary edges connect in one vertex, then the function makes the most abrupt turn to left

◆ triangulatePointCloud()

Mesh triangulatePointCloud ( PointCloud pointCloud,
TriangulationParameters params )

Creates mesh from given point cloud according params Returns empty optional if was interrupted by progress bar.