I use next codes to get a split brep, when I use AddBrepObject to scene,the return rb is equal 0.
the attachment has the whole test codes and a test file,please help me to see why this happen?
ON_Brep sbrep=RhinoSplitBrepFace(brep,i,cs,1.0,true);
if(sbrep)
{
*CRhinoBrepObject*rb=context.m_doc.AddBrepObject(sbrep);
if(rb==0)
{
MessageBox(GetForegroundWindow(),L"Add Brep fail",L"hint",MB_OK);
}
}
sorry forget uplode the attachement files
RhinoSplitBrepFace.rar (11.6 MB)
dale:
I can’t open the link you provided,can you upload the test project ,thanks
See attached…
dale:
your test code is work fine
but I still don’t what problem of my test codes
the diffrent between my codes and your test codes are:
My codes AddObject with params ON_brep,and Your codes AddObject with params CRhinoBrepObject
My sample uses the document’s absolute tolerance for splitting. My example also don’t leak memory.
dale, these are realy the diffrent of of your example,but I think these are not the reason led to rb is 0
*CRhinoBrepObject*rb=context.m_doc.AddBrepObject(sbrep);
I do not understand your response. But my example seems to work on your sample file, right?
yes,dale,but if just chang your chodes
AddObject with params CRhinoBrepObject,to AddObject with params ON_brep
will also get zero object