If hoops does not support static interference detection for models? So, how do we implement this static interference function? For example, how do we export the data of the interference nodes, and which third-party library should be used for the interference check of the model nodes?
Can you please provide details on what this is exactly?
As shown in the figure, in the model, the volumes of the two parts overlap. Then, can we use hoops to detect them and highlight the overlapping part?
The closest analogue is the Clash Detection library:
Please be aware that this functionality is strictly provided as a proof-of-concept and it is not officially supported. Its purpose is to serve as a point of origin for developers to explore their own custom implementation or assist in evaluating potentially adding a non-HOOPS third-party library.
OK. This is indeed very helpful. However, when I started to verify the problem, I found that if I traversed all the BodyInstances in the model and obtained their NodeProperties, and if there were too many nodes, the browser would crash directly. What’s the reason for this?
And I have already performed the bounding box elimination first, then conducted the precise detection, and then compared each pair of nodes. If the model is very large or has tens of thousands of nodes, the comparison efficiency would be very low and it would directly crash and fail.
Per the GitHub repo overview states:
The code is optimized for building/AEC type of models (IFC, Revit, NW, DWG), and has not been widely tested with generic “CAD” models.
So it’s possible that you are overwhelming the algorithm given the very large CAD model.
OK, I understand. But I would like to ask if there is a way to calculate the distance between a known node and the nearest node in the model? And calculate the shortest distance
My data const interferenceJson = {
“interference_region”: {
“vertices”: [
-174.12316621171985, 0.0, -99.66778564453125,
38.60649382245984, 0.0, -99.66778564453125,
38.60649382245984, 20.0, -99.66778564453125,
-174.12316621171985, 20.0, -99.66778564453125,
-174.12316621171985, 0.0, 99.66777972333594,
38.60649382245984, 0.0, 99.66777972333594,
38.60649382245984, 20.0, 99.66777972333594,
-174.12316621171985, 20.0, 99.66777972333594 ],
“indices”:[0,1,2,0,2,3,4,5,6,4,6,7,0,1,5,0,5,4,2,3,7,2,7,6,0,3,7,0,7,4,1,2,6,1,6,5],
“netMatrix”:[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]] }
};
await drawInterferenceRegion(hwv.model, interferenceJson);
My approach: Why is the rendering not displayed on the page? It keeps reporting an error: Uncaught (in promise) TypeError: meshData.addFace is not a function async function drawInterferenceRegion(model, interferenceJson) {
if (! interferenceJson || ! interferenceJson.interference_region) {
console.warn(“Error in JSON format of the interference area”); return;
}
const region = interferenceJson.interference_region;
const vertices = region.vertices; // Flat Vertex Array const indices = region.indices; // Triangle Index const netMatrixArr = region.netMatrix; // 4x4 Matrix
//
Expand the vertex array to explicitly list each triangle’s three vertices const expandedVertices = ;
for (let i = 0; i < indices.length; i++) {
const idx = indices[i];
expandedVertices.push(
vertices[3idx],
vertices[3idx + 1],
vertices[3*idx + 2]
);
}
//
Create MeshData const meshData = new Communicator.MeshData();
meshData.addFace(expandedVertices, null, null); // Normal and color can be null meshData.setFaceWinding(Communicator.FaceWinding.Clockwise);
//
Create Mesh const meshId = await model.createMesh(meshData);
//
Construct the matrix const netMatrix = new Communicator.Matrix();
netMatrix.setFromArray(netMatrixArr.flat());
//
Create MeshInstanceData const meshInstanceData = new Communicator.MeshInstanceData(
meshId,
netMatrix,
null,
Communicator.Color.create(255, 0, 0, 128), // Semi-transparent red
Communicator.Color.create(0, 0, 0) // Black border line );
//
Create a Mesh instance and insert it into the scene const instanceNodeId = await model.createMeshInstance(meshInstanceData);
console.log(“Interference area Mesh instance creation successful. Node ID:”, instanceNodeId); return instanceNodeId;
}
I know why. But I’m wondering if there are any other ways to create it in HOOPSCommunicatorTemplate.html (the single-file template)?
If you are using this single-file template (which is usually the exported or packaged pure viewer), you cannot use these advanced APIs for dynamically creating and manipulating the mesh. If you need to use MeshData-related functions (such as dynamically creating meshes, modifying mesh instances, etc.), you must use the full version of the HOOPS Visualize Web SDK development environment instead of the single-file template. In summary: | Usage Scenario | Whether MeshData and createMesh() functions are supported |
|----------------------------|---------------------------------------|
| HOOPSCommunicatorTemplate.html (Single File Template) | Not Supported |
| Complete HOOPS Visualize Web SDK Development Environment | Supported | If you want to use the dynamic grid feature in the single file template, it is recommended to switch to the full version SDK, or use the official provided development environment and sample projects
The monolithic HTML export is a self-contained, pre-processed HTML designed for offline viewing. As such, it is not designed for dynamic updates to the Web Viewer (such as, creating meshes).
Then, may I ask if this convert_file.bat can be used in a batch mode to execute the conversion process?
And multiple calls… Will there be any performance issues, such as memory usage or memory access out-of-bounds problems?
Batch conversion is available, please see this section in our docs:
An example XML file can be found in the directory HOOPS_Visualize_Web_2025.X.x\authoring\converter\example\sample_batch.xml
I don’t anticipate any performance issues with batch conversion.
Also, it would be preferable if a new thread is created if the topic is materially different from the original post (collision detection != monolithic HTML export != batch conversion). This helps keep the forum easier to search and threads easier to follow.
Hello, I used this library for collision detection, but it gave me a warning that the model version does not match. So, which version of Hoops Communicator is needed to use this library for detection?
In the browser dev console, you can run this command:
hwv.getViewerVersionString();
The Web Viewer cannot load Stream Cache files converted by a more recent converter version than the version returned from the function.
Hello Tino, I used this integrated HTML to export the mesh grid of the model. However, when I tried to perform volume overlap (collision detection) in a third-party library such as OpenCascade, it prompted me that this grid is not closed and is a shell? Does that mean that the mesh obtained by the getNodeMeshData() function can only be used for display and cannot be used for volume detection or collision detection?
Looking forward to your reply
Admittedly, I’m not familiar with collision detection as implemented by OpenCascade. That being said, a mesh object is the geometric representation of the model. So a mesh isn’t just for display.
I think you’ll have to do more research on what OpenCascade is expecting as a data structure to represent the geometry of the model.
Hello, Tino. Could you please confirm whether the data obtained by getNodeMeshData is a solid mesh rather than a rendered mesh? Is there any zero-area / degenerate triangle among them, such as when the three points of the same triangle are collinear, there are duplicate vertices, or illegal indices? Because when I used the industrial geometry detection library (FCL / CGAL) for detection, I found that such meshes were not accepted.
Converter imports CAD files and generates Stream Cache files. The data is processed as-is from the source CAD file. Can you confirm if the source data is itself an open or closed solid?
Here, all of them are closed entities. Then, when looking at the models drawn through a third-party library, it was found that the density of some nodes in the models is inconsistent with the normal density. Why is this so? As shown in the figure, for example, this screw has a cylindrical surface that is not consistent with the normal hole surface. This leads to a problem that when the program calculates whether there is overlap, it calculates that there is overlap, but in reality, there is none. The reason is that there are many surfaces for the drawing of the screw, which results in overlapping situations between the screw and the hole. Is there a way to control the accuracy of the exported mesh?






