Large errors in p-curves

I used Rhino 5 to read .step files and save them as .3dm files. The geometry information in .3dm files is then extracted with openNURBS.

I visualised the model in a way such that each trimmed surface is visualised separately, that is, each trimmed surface is bounded by the images of its p-curves in 3D, instead of the 3D intersection curves. I found that the p-curves computed in Rhino present very large errors in some cases, especially when the dimension of a untrimmed model is much larger than that of a trimmed one. This leads to unanticipated large gaps in the visualisation in our own viewer.

The figures below show two examples with large gaps due to ‘incorrect’ p-curves. The first figure shows large gaps between adjacent trimmed surfaces; the second figure shows the pink surface is somewhat away from its adjacent trimmed surface. I expect that there will be inevitably tiny imperfections in trimmed regions, but not as large as what it’s showed here.

There is no information of p-curves in .step files, so p-curves should be computed in Rhino when exporting the geometry as .3dm files. Basically I just used ‘SaveAs’ in Rhino to save the .step file as .3dm file. I am wondering the reason why we get p-curves with so large errors for these models. Is there something that I missed when I exported the geometry with Rhino and read it with openNURBS?

I attached the files of the first model. One is the original .step file, and the other is the .3dm file I exported from Rhino 5.

24.step (100.3 KB)

24.3dm (122.6 KB)

Thank you in advance for your help.

@chuck - is this something you can help with?

Hi. I’m not sure I understand what you are doing. If I open the step file in V5, I get a good model, with units in meters. If I save as 3dm and reopen, I get the same thing. Your 3dm has no unit system, and seems to be scaled up by 1000, so you must have done something else. Can you explain exactly what you are doing to create the 3dm file?

Hi Chuck~ Thank you for your reply! Yes, I scaled the geometry by 1000 (that is, the unit of meters is changed to millimeters) in Rhino, and then save it as 3dm file.

I actually don’t have a problem when visualising it in Rhino as well. Am I understanding correctly that the 3D images of p-curves are actually not displayed in Rhino? The figures I showed above plot the 3D images of p-curves which are stored in the .3dm file. In other words, I evaluated the 2D parametric trims of each trimmed surfaces in 3D. They are unexpectedly quite far away from the intersection curves.

When I check the .3dm model with the function ‘isValid()’ in ONX_Model, it prints the following message, though ONX_Model::isValid() returns true:

m_object_table[0].m_object->IsValid() = false.
Distance from end of ON_Brep.m_T[24] to 3d edge is 0.0516562. (edge tol = 0.000103312, trim tol ~ 0).

Does this mean that there is a large error in the 2D parametric trim? BTW, I also tried with not scaling the model by 1000, it seems to have the same issue.

The 3D images of the trim curves are represented by the 3D edge curves, and they should be visible unless you’ve turned them off. For nonplanar surfaces, there will generally be some error between the true image of the 2D trim curves and the 3D edge curves. This should be bounded by edge tol. Scaling does not refit any of the curves, so if you scale by 1000, the error will also be scaled by 1000. That would explain the large error you’re seeing after scaling. You’ve imported a step file that is accurate to 0.0001m. This accuracy is generally the bound on the deviation. If you change to mm, then the file’s accuracy is still 0.0001m, which is 0.1mm.

I don’t know why you would see a problem if you don’t scale. I do not see this problem. Are you doing something besides opening the step file and saving the result as 3dm?