ComfyUI Node
CV Mesh From 3D Model
Reads the GEOMETRY of a 3D model file into plain arrays: vertices (Nx3) and triangle indices (Mx3), ready for 'cv2 rapid rapid', 'CV ICP Register', 'CV PPF Pose Estimation' or 'CV Point Cloud Normals'. Every triangle primitive of the default scene is merged into ONE indexed mesh with the node transforms baked in - the same parser 'CV Preview 3D (Calibrated Camera)' renders with, so what you see and what you measure cannot drift apart. Materials, UVs and normals are dropped; positions and connectivity only. GLB is the reliable format (a .gltf with external buffers will not resolve them). Failure tolerant: an unreadable or non-triangle model returns empty arrays with loaded=false rather than halting.
CV Mesh From 3D Model
- model_3d
- pts3d
- tris
- center
- diameter
- vertex_count
- triangle_count
- loaded
◄axis_conventionOpenCV (Y down, Z into the scene)►
◄recenterkeep model origin►
◄scale1.00►
Categoryimage/CV/low-level
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_3d | FILE_3D_GLB,FILE_3D_GLTF,FILE_3D | Model from a 3D loader node ('Load 3D', 'Load 3D (Advanced)'). GLB is the format that actually works: a .gltf with external buffers will not resolve them from the temp folder. | |
| axis_convention | COMBO | OpenCV (Y down, Z into the scene) | glTF stores Y up and Z toward the viewer; OpenCV's camera looks down +Z with Y down. Leave this on the OpenCV setting whenever the mesh feeds solvePnP, cv2.rapid or projectPoints alongside a real camera pose - it negates Y and Z, exactly the flip 'CV Camera Pose To 3D View' applies in the other direction. Pick the glTF setting only to compare against the viewer's own coordinates. |
| recenteropt | COMBO | keep model origin | Where the returned points put the origin. The model origin is what a pose solved against this mesh will refer to, so keep it unless you specifically want the object's own centre (a pose then means 'centre of the object', which is usually what an annotation anchor wants). 'centroid' averages the vertices, so dense regions pull it. |
| scaleopt | FLOAT | 1.000.000001–1000000 | Multiplies every coordinate. Use it to put the mesh in the SAME units as the camera pose - a model authored in centimetres needs 0.01 against a calibration in metres, and a scale mismatch shows up as a pose that is right in direction and wrong in depth. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| pts3d | NPARRAY | Nx3 float32 vertices. This is the 'pts3d' input of the cv2.rapid nodes and a valid Nx3 point cloud for 'CV Point Cloud Normals' / ICP / PPF. |
| tris | NPARRAY | Mx3 int32 triangle indices into pts3d - the 'tris' input of the cv2.rapid nodes. Winding follows the file; cv2.rapid's backface culling depends on it, so a model exported with flipped normals silhouettes inside out. |
| center | NPARRAY | 1x3 bounding-box centre of the RETURNED points (after recentre and scale). Wire it to 'CV Transform Points 3D' or use it to place an annotation anchor. |
| diameter | FLOAT | Bounding-box diagonal of the returned mesh, in the same units. The natural scale reference: an edge budget for 'CV Mesh Split Long Edges' is a fraction of this, and PPF's sampling steps are fractions of it too. |
| vertex_count | INT | Number of vertices (0 when loaded=false). |
| triangle_count | INT | Number of triangles (0 when loaded=false). |
| loaded | BOOLEAN | False when the file could not be read or holds no triangles. Gate the rest of the graph on it with an 'If/Else Switch' instead of letting empty arrays reach a solver. |