# How can the two IDs of the same face be matched? 

**URL:** <https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867>\
**Category:** HOOPS Visualize Web\
**Created:** [September 11, 2025, 8:14pm UTC](https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867 "2025-09-11T20:14:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![38422985](https://avatars.discourse-cdn.com/v4/letter/3/34f0e0/32.png) [@38422985](https://forum.techsoft3d.com/u/38422985)\
**Post date:** [September 11, 2025, 8:14pm UTC](https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867/1 "2025-09-11T20:14:21Z")

</div>

The main issue with Hoops Communicator now is that it is concentrated on a single point. For example, if a user has a cube named partA, with six faces each having its own ID, when converting it to a sc.file, the cube’s name remains partA. However, the IDs of the six faces should be assigned by the SC library or HWV itself. How can the two IDs of the same face be matched? The same issue applies to points/lines.

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [September 11, 2025, 8:21pm UTC](https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867/2 "2025-09-11T20:21:54Z")

</div>

Hello,

It’s not clear what you mean by:

> _six faces each having its own ID_

Are you referring to metadata in the mesh geometry itself? If you have a CAD file to test, that would be helpful. If the file is not too big, you can send to me via a direct message (by clicking my profile name). Also please share any code snippet that you using.

Thanks,  
Tino

---

<div class="post-metadata">

**Author:** ![38422985](https://avatars.discourse-cdn.com/v4/letter/3/34f0e0/32.png) [@38422985](https://forum.techsoft3d.com/u/38422985)\
**Post date:** [September 12, 2025, 12:30am UTC](https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867/3 "2025-09-12T00:30:02Z")

</div>

Hello,Tino!  
Thanks for your reply!

For example, i created a cube in my software. I managed the IDs of Point or Line or Face in my software. Then, i upload the cube to the webpage by SC File and show in the Hoops webViewer(hwv), the IDs of Point or Line or Face is managed by the hwv system. How can i match the id in the hwv with my software one by one?  
Thanks a lot!

Best!

Jenson

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [September 12, 2025, 4:46pm UTC](https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867/4 "2025-09-12T16:46:17Z")

</div>

The ID for a face is the index in the vector container for the [Mesh.face\_elements](https://docs.techsoft3d.com/communicator/latest/api_ref/data_import/libsc/classSC_1_1Store_1_1Mesh.html#_CPPv4N2SC5Store4Mesh13face_elementsE) when the face was created. In the Web Viewer, the face index can be retrieved using the function [FaceEntity.getCadFaceIndex](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/FaceEntity.html#FaceEntity.getCadFaceIndex). More information on the face element through the MeshData object.

As an example, below is Javascript code with gets the face index from a selection and then retrieves specific point information for the face:

```auto
hwv.setCallbacks({
    selectionArray: async function (selections) {
        if (selections.length > 0) {
            for (const selectionEvent of selections) {
                var selection = selectionEvent.getSelection();
                var nodeid = selection.getNodeId();
				console.log("Selected Node: " + nodeid);
				
				if (selection.getFaceEntity() != null) {
					let faceIndex = selection.getFaceEntity().getCadFaceIndex();
					console.log("Face ID: " + faceIndex);
					
					let data = await hwv.model.getNodeMeshData(nodeid);
					let face = data.faces.element(faceIndex);
					let pp = face.iterate();

					console.log("face elements: " + JSON.stringify(face));
						
					for (let j = 0; j < face.vertexCount; j++) {           
						let rawpoint = pp.next();
						console.log("points array: " + JSON.stringify(rawpoint));
					}
				}
            }
        }
    },
})

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/d/de01e7f7b4133bee03ce5866f9ad2cd0e91ff8bc.png)

---

<div class="post-metadata">

**Author:** ![38422985](https://avatars.discourse-cdn.com/v4/letter/3/34f0e0/32.png) [@38422985](https://forum.techsoft3d.com/u/38422985)\
**Post date:** [September 13, 2025, 3:22am UTC](https://forum.techsoft3d.com/t/how-can-the-two-ids-of-the-same-face-be-matched/4867/5 "2025-09-13T03:22:14Z")

</div>

Hello，Tino：

Thanks a lot for your guidance! You’re truly a sage!
