Why is this Brep not a Solid?

Hi,

I think I have exhausted the diagnostic tools available in OpenNurbs to find out what is wrong with this Brep, and I can’t figure it out.

Topologically, it’s a cylinder, but the top and bottom are pieces from surfaces of revolution and the mantle and edges are more complicated NURBS shapes of high degree. The edges and trims are precise to arithmetic precision and changing the tolerances doesn’t seem to make a difference.

The readouts of the testing functions are:

isSolid false
isManifold true
isOriented false
hasBoundary false
IsValidGeometry true
IsValidTopology true
IsValidTolerancesAndFlags true

I also tried running these automatic setting functions, to see if any of them changed anything, but none did:

SetTrimBoundingBoxes true
SetTrimIsoFlags true
SetTrimTolerances true
SetTrimTypeFlags true
SetVertexTolerances true

Although my understanding is that being oriented is not necessary, I used face.Transpose(); to make sure all face normals point outwards.

As an aside, SetEdgeTolerance seems to be broken in OpenNurbs requiring a namespace called TL_Brep. Without it, it appears to assign ON_UNSET_VALUE to any edge that is part of a trim, rendering the edge (and with it the brep) invalid.


nurbsgen.3dm (39.2 KB)

By trial and error I found that reversing the one of the curves that was used to create created a trim at one side (and adjusting the trim to accept a reversed curve) solved the issue.

I am not completely clear as to why this is.

Hi @samuel.sudhof,

A good way of diagnosing Brep errors is to use ON_Brep::IsValid.

  ON_wString text;
  ON_TextLog text_log(text);
  if (!brep.IsValid(&text_log))
  {
    // Dump error to command line...
  }

– Dale

Thank you for your reply.

In this case textlog didn’t give any output, because the brep was valid. It just wasn’t a solid.