【MSCE UPDATE13】测试发现PolyfaceHeader里面的ComputeSingleSheetCutFill计算结果有误差

我测试发现下面的函数得到的mesh是封闭起来的,但是有误差,通过动态切图发现cut得到的开挖体与原始mesh面有空隙。

单独测试 PolyfaceQuery类下面的 ComputeCutAndFill 函数,可以发现计算结果没有误差,但是mesh边界上下不是封闭起来的
使用CloneWithSidePanel封闭面处理的效果如下:
请问如何做到计算结果没有误差,而且还能让mesh在边界处是封闭起来
我的测试代码如下:
void KeyinCommands::testMeshCmd(System::String^ unparsed)
{
	ElementId dtmEleID = 15678; 
	ElementId roadEleID = 15683;
	EditElementHandle dtmEh(dtmEleID, ACTIVEMODEL);
	EditElementHandle roadEh(roadEleID, ACTIVEMODEL);
	MeshHeaderHandler* dtmHeaderHandler = dynamic_cast<MeshHeaderHandler*>(dtmEh.GetDisplayHandler());
	MeshHeaderHandler* roadHeaderHandler = dynamic_cast<MeshHeaderHandler*>(roadEh.GetDisplayHandler()); 
	PolyfaceHeaderPtr dtmPoly, roadPoly;
	dtmHeaderHandler->GetMeshData(dtmEh, dtmPoly); 
	roadHeaderHandler->GetMeshData(roadEh, roadPoly); 

#pragma region use ComputeSingleSheetCutFill
	/*PolyfaceHeaderPtr fillvol;
	DVec3d viewVector = DVec3d::From(0, 0, -1);
	PolyfaceHeaderPtr tempCutPolyface;
	PolyfaceHeader::ComputeSingleSheetCutFill(*dtmPoly, *roadPoly, viewVector, tempCutPolyface, fillvol);
	EditElementHandle cutEh;
	if (tempCutPolyface.IsValid())
	{
		MeshHeaderHandler::CreateMeshElement(cutEh, NULL, *tempCutPolyface, true, *ACTIVEMODEL);
		cutEh.AddToModel();
	}*/
#pragma endregion


#pragma region MyRegion

	bvector<PolyfaceHeaderPtr> resultAaboveB, resultBaboveA;
	PolyfaceQuery::ComputeCutAndFill(*roadPoly, *dtmPoly, resultAaboveB, resultBaboveA);
	if (resultAaboveB.size() > 0)
	{
		EditElementHandle cutEh;
		if (resultBaboveA[0].IsValid())
		{
			MeshHeaderHandler::CreateMeshElement(cutEh, NULL, *resultBaboveA[0], true, *ACTIVEMODEL);
			cutEh.AddToModel();
		}
	}

#pragma endregion

	

}
测试案例如下:

iBugExample.dgn

Parents Reply Children
No Data