Skip to content

saveMesh

ptcloudfunctionOpenCV 5.0.0
import { saveMesh } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSfilename, vertices, indices, normals
FUNCTIONsaveMesh
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Saves a mesh to a specified file.

The function saves mesh to the specified file. File format is chosen based on the filename extension.

saveMesh(filename: EmbindString, vertices: Mat, indices: MatVector, normals: Mat, colors: Mat, texCoords: Mat): void;
4 available overloads
saveMesh(filename: EmbindString, vertices: Mat, indices: MatVector): void;
saveMesh(filename: EmbindString, vertices: Mat, indices: MatVector, normals: Mat): void;
saveMesh(filename: EmbindString, vertices: Mat, indices: MatVector, normals: Mat, colors: Mat): void;
saveMesh(filename: EmbindString, vertices: Mat, indices: MatVector, normals: Mat, colors: Mat, texCoords: Mat): void;
filename

Name of the file.

vertices

vertex coordinates, each value contains 3 floats

indices

per-face list of vertices, each value is a vector of ints

normals

per-vertex normals, each value contains 3 floats

colors

per-vertex colors, each value contains 3 floats

texCoords

per-vertex texture coordinates, each value contains 2 or 3 floats

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.