Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some objects (walls, slabs) are not being displayed and a possible solution #497

Open
santiagoIT opened this issue Aug 15, 2024 · 0 comments

Comments

@santiagoIT
Copy link

If you open the IFC file with XBimExplorer (compiling the master branch) you will notice that the walls are not being displayed:

image

I doubt this is the proper solution, but it might give a hint as to what might be wrong.
But if the code changes listed are applied, then the walls do display:
image

Btw, XbimXplorer version 4 does display the walls. So this is some sort of regression.

Let me know how to proceed. If this should be the proper solution, I can make a pull request, otherwise please give me some hints as to where the problem might be. I spent a lot of time, trying to figure this out, so any help/advice is appreciated.

This is in XbimGeometryCreator.cpp. Just added code to support XBimSolidSets.

void XbimGeometryCreator::WriteTriangulation(BinaryWriter^ bw, IXbimGeometryObject^ shape, double tolerance, double deflection, double angle)
{

	XbimOccShape^ xShape = dynamic_cast<XbimOccShape^>(shape);
	if (xShape != nullptr)
	{
		xShape->WriteTriangulation(bw, tolerance, deflection, angle);
		return;
	}

	/// START
	/// NEW CODE -> workaround for the problem of the walls not being displayed
	XbimSolidSet^ xSolidSet = dynamic_cast<XbimSolidSet^>(shape);
	if (xSolidSet != nullptr)
	{
		// create an XBimCompound out of the XBimSolidSet
		TopoDS_Compound compound;
		BRep_Builder b;
		b.MakeCompound(compound);

		for each (IXbimSolid^ solid in xSolidSet)
		{
			if (!solid->IsValid)
			{
				continue;
			}

			XbimSolid^ solid2 = dynamic_cast<XbimSolid^>(solid);
			if (solid2 != nullptr) {
				b.Add(compound, solid2);
				//GC::KeepAlive(solid);
				XbimCompound^ compound2 = gcnew XbimCompound(compound, true, tolerance);
				compound2->WriteTriangulation(bw, tolerance, deflection, angle);
			}
		}
	}
	/// END
	/// NEW CODE
}

Thank you!
xBim-Issue.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant