public WpfMeshGeometry3D(Material material, Material backMaterial = null, IIfcTextureCoordinate ifcTextureCoordinates = null) { WpfModel = new GeometryModel3D(new MeshGeometry3D(), material); IfcTextureCoordinates = ifcTextureCoordinates; if (backMaterial != null) WpfModel.BackMaterial = backMaterial; }
/// <summary> /// create the corresponding Texturemapping to a related texture coordinate element /// </summary> /// <param name="textureCoordinate"></param> /// <returns></returns> public static ITextureMapping CreateTextureMapping(IIfcTextureCoordinate textureCoordinate) { if (textureCoordinate is IIfcTextureMap) { return(null); } else if (textureCoordinate is IIfcTextureCoordinateGenerator generator) { TextureMapGenerationMethod method = (TextureMapGenerationMethod)Enum.Parse(typeof(TextureMapGenerationMethod), generator.Mode); switch (method) { case TextureMapGenerationMethod.SPHERE: return(new SphericalTextureMap()); default: return(null); } } else if (textureCoordinate is IIfcIndexedTriangleTextureMap triTextureMap) { return(new ManualTriangularTextureMapping(triTextureMap, triTextureMap.MappedTo.Coordinates.CoordList.Count)); } else { return(null); } }