如何获取 XbimShapeInstance 的颜色

问题描述

我使用此代码来获取我需要的 IfcElement 几何:

//Получаем XbimShapeInstances для данного IfcElement
List<XbimShapeInstance> shapeInsts = (from t in m_ShapeInsts // определяем каждый объект из teams как t
                                      where t.IfcProductLabel == EntLabel //фильтрация по критерию                                                 
                                      select t).ToList(); // выбираем объект

if (shapeInsts == null || shapeInsts.Count == 0) return;

//Обрабатываем все XbimShapeInstance данного IFCElement
foreach (var instance in shapeInsts)
{
        var transfor = instance.Transformation; //Transformation matrix (location point inside)
        XbimShapeGeometry geometry = m_3DMdlContext.ShapeGeometry(instance);   //Instance geometry
        XbimRect3D box = geometry.BoundingBox; //bounding box you need

        byte[] data = ((IXbimShapeGeometryData)geometry).ShapeData;

        //Получим сетку треугольников
        using (var stream = new MemoryStream(data))
        {
              using (var reader = new BinaryReader(stream))
              {
                    var mesh = reader.ReadShapeTriangulation();

                    List<XbimFaceTriangulation> faces = mesh.Faces as List<XbimFaceTriangulation>;
                    List<XbimPoint3D> vertices = mesh.Vertices as List<XbimPoint3D>;
              }
         }

但是如何获得 XbimShapeInstance 的颜色? 感谢您的回答。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)