sw11
(sw)
May 17, 2024, 8:32am
1
Hello, I would like to extract the rendering datas from a rhino file using openNurbs. This is my code.
ON_SimpleArray<const ON_Mesh*> meshs;
aBrep->GetMesh(ON::MeshType(4), meshs);
This is the original model.
This is the meshes I got.
I wonder how can I get the correct meshes? Thank you.
menno
(Menno Deij - van Rijswijk)
May 17, 2024, 1:51pm
2
Can you post the 3dm file where this is a problem? And is the object by any chance located very far from the orign? This may be a known limitation of meshes in single precision
https://www.wiki.mcneel.com/rhino/farfromorigin
dale
(Dale Fugier)
May 17, 2024, 7:08pm
3
Hi @sw11 ,
Here is a guide you might find helpful.
If not, then please post the 3dm file - thanks.
– Dale
sw11
(sw)
June 3, 2024, 3:24am
4
Yes, the position is about 3.6millions of units from origin. I have posted the file below.
sw11
(sw)
June 3, 2024, 3:26am
5
walkway.3dm (6.6 MB)
This is the original file.
sw11
(sw)
August 30, 2024, 2:35am
7
Hi @dale @menno ,
Since I have too much .3dm files with survey datas, is there any other way to solve this kind of accuracy problem without modifying the original model?
automapki
(Automapki)
September 1, 2024, 5:42pm
8
You can try to tesselate your BREP surfaces:
for (int faceIndex = 0; faceIndex < aBrep->m_F.Count(); ++faceIndex)
{
const int surfaceIndex = onface.SurfaceIndexOf();
if (surfaceIndex >= 0 && surfaceIndex < aBrep->m_S.Count())
{
ON_Surface* surface = aBrep->m_S[surfaceIndex];
if (surface)
{
ON_BrepLoop* outerLoop = onface.OuterLoop();
for (int loopIndex = 0; loopIndex < onface.LoopCount(); ++loopIndex)
{
ON_BrepLoop* loop = onface.Loop(loopIndex);
if (loop != outerLoop)
{
}
}
}
}
}
}
dale
(Dale Fugier)
September 4, 2024, 9:31pm
9
@sw ,
Your file looks correct when opened in Rhino with a shaded viewport, which uses the cached render mesh.
What problem are we trying to help you solve?
– Dale