Sample code for a visual comparison of two sets of nodes.
In this sample, load two models to each node using loadSubtreeFromModel
and compare two nodes with startComparison and endComparison.
Sample code:
comparison_example.zip (369.7 KB)
Sample code for a visual comparison of two sets of nodes.
In this sample, load two models to each node using loadSubtreeFromModel
and compare two nodes with startComparison and endComparison.
Sample code:
comparison_example.zip (369.7 KB)
Hi, I try your sample code, But there seems to be a problem with the white meshes, they are not changing the color:
Is this a bug? Or has some settings for this?
Thanks!
Hey @namtrung921 –
First off, welcome to the forum, we’re glad to have you here! I believe the original code is from @rie, so she may be able to better help answer your question.
Hello @namtrung921, thanks for your reply.
In the sample. the similar color is used to the meshes. I tried with different colors, the meshes are colored with ComparisonConfig.sameColor. So it looks working as expected.
var comparisonConfig = {
sameColor: Communicator.Color.red(),
only1Color: Communicator.Color.green(),
only2Color: Communicator.Color.yellow(),
};
_this._viewer.view.startComparison(Nodes1,Nodes2,comparisonConfig);
Hi, thank you for your reply.
But I using comparisonConfig, but the white mesh still did not change when compared, The picture you took seems to be due to the reflection effect, so the inner cylinder is red (however you can see the edges of the white part):
I also tried 2 other scz files and the results were the same, the polylines and meshes (text) were white and didn’t change color when starting the comparison. (You change the background color to make it easier to see)
You can download 2 scz sample files here:
SCZ sample compare.zip (383.8 KB)
Please help us try again. This is an important feature of our product.
Thanks!
Hello @namtrung921,
Thank you for sharing the details.
I have been able to reproduce the problem. Are you a partner? If yes, you can submit a issue in our support portal. But I will look into it a bit more.
Hi, @rie .
Yes, We are your partner. I will submit this issue to your support portal.
I found this topic and sample code, so I thought I’d put a question here everyone can read and discuss.
More information:
Also, I have a few more questions:
Thank you!
Hi,
just to quickly answer your question regarding more info on the comparison function. It is indeed implemented as you described, basically rendering the two sets of nodes on top of each other with a blending function that ensures that differences are rendered in a specific color. It is not a geometry level comparison, so it won’t be able to return specific details on the nodes involved in the comparison.
Please let us know if you require more functionality in that regard. It is worth nothing that HOOPS Exchange does have various geometry level comparison functions you could leverage yourself if you are a HOOPS Web Platform partner.
Thanks
Thank your confirm and your suggestion. We has a license HOOPS Exchange.
But it’s not very familiar to me. I have seen some APi to compare 2 models at BREP/FACEs Level in Hoops exchange. But it seems that it will need Exchange ID when exporting SCZ/SCZ to link the information together.
I will learn more and will probably need your support.
Regarding the above color issue, I will create a ticket on your support portal.
Thanks again!
Just as an additional suggestion, there are obviously a few things you can do fairly trivially to determine “sameness” of entities in HC
Beyond that, it really depends on what you are trying to achieve.
Thank you, I will pay attention to those issues when I start to learn Hoops Exchange.
However, I am currently trying to evaluate the compare 2 node function (2 model scz) with Hoops Communicator first.
I would like to ask for a few more ideas:
And result when compare:
SCZ Models for testing:
sc_models.zip (1.6 MB)
Thank you a lot!
I don’t think you can necessarily expect the same tessellation for objects of same topology but different sizes but as long as the underlying brep definition hasn’t changed I would expect the same tessellation to be applied. Keep in mind that in some cases the tessellation might come directly from the CAD system.
With regard to the blending issues, not sure what is going on there. It does not seem to be correct. I suggest you file a bug report in our support system.
Many thanks for your information.
I have already created a bug report in your support system a few days ago. I will update “blending issues” in that ticket.
Thanks again!