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.
