Get Strange Extra Geometries by OpenNurbs?

Hello everyone. I’m using OpenNurbs to do geometry data exchange from *.3dm to my own mesh data format. It works well for a long time, but a problem occured yesterday. One of my users reported that his model looks very strange in my data format converted from 3dm format. And it seems that my OpenNurbs tool got extra geometries as the pictures below:


Could anyone do me a favor to figure out what the problem is? Thank you very much!!!

Maybe those were geometries on disabled layers? Or hidden geometries?

Thank you so much for your reply!!! @nathanletwory
I have used the ‘show object’ command and enable all the layers, but no more geometries appear. Either there’s no references or linked files in this model. The extra geometries seems to be some expanded blocks defined in the block manager. Is there anything to do with this?

Hi @shushenrui1996,

Can you post the 3dm file that your having difficulty reading?

– Dale

Hi Dale @dale
The file is too big so I deleted all the geometries to only 1 solid left, but the uploading process still failed. Could I deliver the file to you by e-mail?
Thank you very much!!!

You can use our upload service at Rhino - Upload to Support . Make sure to copy the link to this discussion into the comments section, then tech can assign to the right person.

Hi @nathanletwory @dale
Thanks!!! I’ve uploaded a simplified model: ReUpload_SimplifiledModel.3dm
The model is empty but I still get extra geometries:

Hi @shushenrui1996,

Can you run Rhino’s SystemInfo command and post the output?

Thanks,

– Dale

Hi @dale
The file is cretaed by my user’s Rhino and I’ve asked the support department to communicate with him. But no reply received yet.
Is it the problem of modelling , not the problem of openNURBS?

Hi @shushenrui1996,

The file you uploaded contains 398 instance definitions. My guess is the tool you wrote to read 3dm files, using openNURBS, is treating instance definition geometry the same as model geometry.

Instance definition geometry can be identified by those objects whose attribute’s IsInstanceDefinitionObject returns true.

ONX_Model model ...

ONX_ModelComponentIterator it(model, ON_ModelComponent::Type::ModelGeometry);
const ON_ModelComponent* model_component = nullptr;
for (model_component = it.FirstComponent(); nullptr != model_component; model_component = it.NextComponent())
{
  const ON_ModelGeometryComponent* model_geometry = ON_ModelGeometryComponent::Cast(model_component);
  if (model_geometry)
  {
    const ON_3dmObjectAttributes* model_geometry_attributes = model_geometry->Attributes(nullptr);
    if (model_geometry_attributes)
    {
      bool bIsInstanceDefinitionObject = model_geometry_attributes->IsInstanceDefinitionObject();
      if (bIsInstanceDefinitionObject)
      {
        // todo...
      }
    }
  }
}

Hope this helps.

– Dale

Hi @dale
It works!!! Thank you very much!!!