GithubHelp home page GithubHelp logo

xbimteam / xbimgeometry Goto Github PK

View Code? Open in Web Editor NEW
247.0 36.0 126.0 154.99 MB

XbimGeometry contains the CLR interop libraries and the c++ engine used to compute the 3D geometry of models.

Home Page: https://xbimteam.github.io/

License: Other

C++ 93.98% C# 1.16% C 4.83% Tcl 0.01% Lex 0.01% Yacc 0.02%
ifc geometry 3d

xbimgeometry's Introduction

Branch Build Status MyGet NuGet
Master Build Status master
Develop Build Status -

XbimGeometry

XbimGeometry is part of the Xbim Toolkit.

It contains the the Geometry Engine and Scene processing, which provide geometric and topological operations to enable users to visualise models in 3D models, typically as a Tesselated scene or mesh.

The native Geometry Engine is built around the open source Open Cascade 7.3 library which performs much of the boolean operations involve in generating 3D solids. This technology is included under a licence which permits the use as part of a larger work, compatible with our open source CDDL licence.

Compilation

Visual Studio 2017 or 2019 is recommended. Prior versions of Visual Studio are unlikely to work on this solution.

The free VS 2019 Community Edition will be fine.

In order to compile this solution which includes C++ projects you'll need the following additional components installed:

  • Visual C++ Core desktop features
  • VC++ 2017 v141 tools
  • Windows 10 SDK (10.0.17134.0)

The XBIM toolkit uses the NuGet for the management of our published packages. We have custom MyGet feeds for the master and develop branches of the solution which are automatically updated during our CI builds. The nuget.config file should automatically add these feeds for you.

Acknowledgements

We'd like to acknowledge OpenCascade for the use of their library, which is permitted under clause 6 of their Licence.

The XbimTeam wishes to thank JetBrains for supporting the XbimToolkit project with free open source Resharper licenses.

Thanks also to Microsoft Azure DevOps for the use of Azure Pipelines to automate our builds.

Getting Involved

If you'd like to get involved and contribute to this project, please read the CONTRIBUTING page or contact any member of the @xbimTeam

xbimgeometry's People

Contributors

andyward avatar bekraft avatar benjymous avatar cbenghi avatar fomayette avatar gcoulby avatar guenter1holzeder avatar hsbsantiago avatar lloydpickering avatar martin1cerny avatar stevelockley avatar xbimci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xbimgeometry's Issues

XbimGeometryEngine Initialization Problem

Hi. I want to acces the geometry of IFC files, but I can't instantiate XbimGeometryEngine

I believe the problem is at this line in the constructor:
ObjectHandle oh = Activator.CreateInstance(assemblyName,"Xbim.Geometry.XbimGeometryCreator");

The exception is something like that:

Unmanaged Exception in ntdll.dll : dammaged memory.

I tried with 32 and 64 bits dlls.
Notice : the Andyward' demo here don't work.

BTW, if you know the easiest way to access the bounding boxes of IfcProducts, I'm interested.

2d geometry

Hi
I need to get 2d geometry data from IFC. So that I can create floor plans from it. Is it possible now

Door openings not generated & inverted faces

Hello,

Recently I've come across this problem using the latest release of XbimWindowsUI. No door openings have been generated for this wall (and couple more inside the building). Also, some face inversion is noticeable with some walls when viewed in non-xBIM viewers (as shown in screenshot). I guess you cannot see such artifacts in Xbim Explorer because of cull settings.

Any ideas what can be done here? I'm ok to go into the code myself, but I don't even know where to start looking. :D

IFC sample file and screenshots are below.

BIMhouse_ARK_info4.zip
screenshot-solibrimodelviewer
screenshot-xbimexplorer
screenshot-customviewer-twosidedoff
screenshot-customviewer-twosidedon

WexBim file size?

Hi.
I'm using a standard in-session IFC export from revit.
My IFC File size in about 30M.
The output wexbim file size is 160M
This is wired cause in most cases wexbim size is about 10% of IFC.
What should I check?

Dror

Get IXbimMeshGeometry3D from XbimShapeGeometry

assuming that the IfcStore as already been opened as var Model = ...

the call of :

var context = new Xbim3DModelContext(Model); var geometries = context.ShapeGeometries(); foreach (IXbimShapeGeometryData geometry in geometries { context.ShapeGeometryMeshOf(geometry as XbimShapeGeometry); }

returns an empty set of Meshes, Normals, Positions and TriangleIndices

The model is readable on WebUI and WindowsUI
So i've tried using the method read(byte[] shapedata) of windowsUI which works fine in Xbim.Presentation.MeshGeometry3DExtensions

1° I haven't checked but does ShapeGeometries() is supposed to do the same work as read().
2° did you ever get a similar issue?

Thanks you

Extract Tree structure and geometry from IFC files

I am looking to load a .ifc file and relpicate the tree structure (hierarchy) in a game engine for developing Virtual Reality apps for AEC projects.

My interest is to load an IFC file in Unity and rebuild the whole model with exact geometry in Unity. Please point me to right direction to get started. I am a total newbie to xBIM and IFC in general.

The process I want to implement is somewhat like this:

  1. load IFC files using xBIM.
  2. Parse through the tree structure and replicate that in Unity (need geometric information and parent-child relation ship of each node in the IFC file)
  3. For each IFC ENTITY (visible geometry), extract the transforms, triangulated mesh data and materials.
  4. Use the info from step 3 to create meshes in Unity for further processing.

Meshes coming back empty

We have been using the 2.4.1 version for some time and I recently ported my code to the very latest 4.0 versions and my code my logic to extract the faces of all the meshes in an ifc file is no longer working and the meshes all come out with zero faces, points etc.

My original code was as follows:

        if (element.== null || !(element is IfcProduct)) return;
        if (element != null)
        {
            IEnumerable<XbimShapeInstance> shapes = context.ShapeInstancesOf(element);
            foreach (XbimShapeInstance shape in shapes)
            {
                if (mesh == null)
                {
                    mesh = context.ShapeGeometryMeshOf(shape) as XbimMeshGeometry3D;
                }
                else
                {
                    mesh.Add(context.ShapeGeometryMeshOf(shape));
                }
            }

Porting to version 4 it appears as

        var productShape = context.ShapeInstancesOf((IIfcProduct) element);

        if (!productShape.Any())
            return;
        foreach (var shapeInstance in productShape)
        {
            if (mesh == null)
            {
                mesh = context.ShapeGeometryMeshOf(shapeInstance) as XbimMeshGeometry3D;
            }
            else
            {
                mesh.Add(context.ShapeG

eometryMeshOf(shapeInstance));
}
}

I have created the context prior to this. Any thoughts as to why the meshes come back (not null btw) with 0 faces. I attached my very small sample file.

thanks for your consideration.

Intersect IfcWall vs IfcSpace

Hello guys

I am working on script which would return wall areas touching an ifcSpace. In order to make it I would need an IfcWall - IfcSpace intersection.

I could easily use IfcSpace with CreateSolid(IIfcExtrudedAreaSolid ifcSolid)
but the IfcWall remains problematic because the wall geometries are really complex (openings, changing heigt etc...)

Do you guys have an idea how to intersect IfcWall - IfcSpace with xBim?

Would XbimShell CreateShell(IIfcConnectedFaceSet shell); -> IXbimGeometryObjectSet Intersection(IXbimSolid toCut, double tolerance);
be an option?
Is there an example how to create IIfcConnectedFaceSet from IfcWall?

Thank you !
Martin

Joining walls with rectangular profiles

I created ifcWalls with ifcrectangleprofiledef... Now I want to join/trim the corners... Is there a simple way to do this?
Here's a screen shot for what it looks like
image

Wexbim file size increased compared to original IFC file

Hello,

I was wondering if anyone has a clue why the converted wexbim file size is > then the IFC file. What could be possible reason and what can we do to reduce the size because such a large size means it will not display in the webUI.

Thanks.

Guidance on net40 build

Hi, I'm trying to build XbimGeometry for .net 4.0 but not getting very far. Can you confirm I'm doing the right thing.

I get the Net40 branch and load Xbim.Geometry.Nuget.sln in vs2013.
Attempt build. The NuGet package restore fails Xbim.Essentials 3.1.0:

NuGet Package restore failed for project Xbim.Geometry.Engine.Interop: Unable to find version '3.1.0' of package 'Xbim.Essentials'..
NuGet Package restore failed for project Xbim.ModelGeometry.Scene: Unable to find version '3.1.0' of package 'Xbim.Essentials'..
NuGet Package restore failed for project Xbim.Geometry.Engine.Tests: Unable to find version '3.1.0' of package 'Xbim.Essentials'..
NuGet Package restore failed for project Xbim.Geometry.Profiler: Unable to find version '3.1.0' of package 'Xbim.Essentials'..
NuGet Package restore failed for project XbimRegression: Unable to find version '3.1.0' of package 'Xbim.Essentials'..

I don't think I want the nuget packages anyway as I think you only have the net4.5 versions on there?

So I build the net40 branch of Xbim.Essenitals, which works.
In Xbim.Geometry.Engine.Interop I replace the Xbim.Essentials DLL references with my builds.
Try build again and get:

1>------ Skipped Build: Project: Xbim.Geometry.Engine, Configuration: Debug CarveCSG Win32 ------
1>Project not selected to build for this solution configuration 
2>------ Build started: Project: Xbim.Geometry.Engine.Interop, Configuration: Debug CarveCSG Any CPU ------
2>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xbim.Common". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xbim.Ifc.Extensions". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xbim.Ifc2x3". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xbim.IO". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2>  BRepBuilderAPI_FastSewing.cxx
2>  TopOpeBRepTool_PROJECT.cxx
2>  XbimCompound.cpp
2>  XbimCurve.cpp
2>c:\projects\xbimteam\xbimgeometry\xbim.geometry.engine\XbimGeometryObject.h(3): error C2653: 'XbimGeometry' : is not a class or namespace name (XbimCurve.cpp)
...  lots more errors

I can not understand the "Could not locate the assembly" errors. The references are correct and exist. Is this perhaps some hangover from nuget dependencies? Not had any luck removing the references.

Regardless, this then apparently leads to the mass of errors.

At this stage wondering if I'm doing this right or if there is a different procedure to follow?

Binaries in repository

Hi @SteveLockley,
did you add Output\Debug\x64\Xbim.Geometry.Engine64.dll and Output\Debug\x86\Xbim.Geometry.Engine32.dll to the tracked files on purpose?
Should they be there?
Claudio

Converting triangulated polygon to outer and inner circles.

I am dealing with an Ifcscpace with IfcFacetedBrep representation that has been triangulated. (The schema is 2x3.)

I can use XbimGeometry to find all the edges, but it cannot detect which edges are on the inside and which edges are on the outside.

Is this something you have support for? The code below shows how I got the data in a test.

Thank you.

using (var model = IfcStore.Open(ifcLongFile))
{
    foreach(var floor in model.Instances.OfType<IfcBuildingStorey>())
    {
        foreach(var space in floor.Spaces)
        {
            if (space.Name != "04100")
                continue;

            var item = space.Representation.Representations.First.Items.First as IfcFacetedBrep;
            var solid = _xbimGeometryCreator.CreateSolidSet(item);

            foreach(IXbimEdge point in solid.First.Edges){
               ...
            }
        }
    }
}

What i have to do to obtain the geometry of Walls, columns, slabs, etc?

Hello, I'm not sure it is the correct place to ask it, if it's not please redirect me:

I'm new in Xbim, and I need to obtain all the geometric data of an object in order to represent it. At the moment i'm using the next code

        if (OpenFile.ShowDialog() != DialogResult.Cancel)
        {
            Wnd.IFCModel.CreateFrom(OpenFile.FileName, "temp.xbim");
            Wnd.IFCModel.Close();
            Wnd.IFCModel.Open("temp.xbim", Xbim.XbimExtensions.XbimDBAccess.ReadWrite);
            var TotalColumns = Wnd.IFCModel.Instances.OfType<Xbim.Ifc2x3.SharedBldgElements.IfcColumn>();
            int num = TotalColumns.Count();
            for (int i = 0; i < num; i++)
            {
                //Now what i have to do to obtain columns, walls, slabs, geometry??
            }
        }

But i'm completely blocked at this point, i have no idea what to do now, i tried it by myself, but after spending many days without result i need help. I need something to began with, at least to obtain the cartesian points and the 3dplacement coordinates.

Thank you in advance.

40mb IFC file converted to 110mb wexbim?

Hello,

I was trying to convert an IFC file of around 40mb size to load in the web browser but the resulting file size was 110mb ( .wexbim) and webUI could not load that file.

Is there anything wrong with the latest geometry solution. For other .IFC files, it is doing conversion like 4MB to 200Kbs. If I open this file in other IFC viewers like Tekla or Trimble, they are able to render it properly....

Thanks
Ravi

Impossible de charger le fichier ou l'assembly 'Xbim.Geometry.Engine64'

hello,
I have read the topic "Problem trying to run XbimGeometryEngine" and I saw that it wrks for him after installing c++ runtime.
I did it but I still have the issue...
I got the message :
image

even if I have the visual c++ installed :
image

and the engine dll in reference (manually) :
image

if I don't add them manually in reference, I have the error message of missing visual c++....

thanks

olivier

How to get the final matrix for an element?

Hi,

The code is as below:

IEnumerable toDraw = refModel.InstancesLocal.OfType().Where(t => !(t is IfcFeatureElement));
TransformGraph graph = new TransformGraph(refModel);
graph.AddProducts(toDraw); //load the products as we will be accessing their geometry

public static void ReadBuilding(IfcBuildingStorey f)
    {
        foreach (IfcRelContainedInSpatialStructure p in f.ContainsElements)
        {
            foreach (IfcProduct t in p.RelatedElements)
            {
                if (t is IfcColumn)
                {
                         XbimMatrix3D matrix = graph[t].WorldMatrix();
                         .....
                }
                 else if (t is IfcBeam)
                 {

                 }
                 else if (t is IfcSlab)
                 {

                 }
              }
          }
   }

I use graph[t].WorldMatrix() to access the matrix of the element and it is working fine for every elements such as IfcColumn, IfcBeam and IfcWall. Except the IfcSlab where after multiply the geometry with graph[t].WorldMatrix() it returns a wrong orientation. May I know what is the problem? Is there any alternative way to get the final matrix or geometry correctly? Thanks in Advance.

Get incorrect solid of IfcSweptDiskSolid

I got a rebar.ifc as attached below but couldn't show reinforcingbars/meshes correctly in xBim, showing only small disks at starting points.

I tried to get a solid of IfcSweptDiskSolid (#2866 in the attached ifc file, with R=6.35, L=3500), and inspect its three faces, which areas are 39.90, 126.68, 126.68.

Since 126.68 = 6.35 x 6.35 x 3.14, the last two faces are up and down faces. And the 39.90 should be the lateral area.

39.90 = 6.35 x 2 x 3.14 = R x 2 x PI x L, so the actual length "L" of the solid is 1 instead of 3500.

Conclusion: when generating solid of IfcSweptDiskSolid, the length parameter is incorrectly set.

I guess it is incorrectly set to the endparam of IfcSweptDiskSolid, which is 1.0 and means that solid is swept to the end of the directrix.

rebar.ifc.txt

ReinforcingMesh in xBim (wrong)
rebar

ReinforcingMesh in IfcViewer (right)
_20160904181911

Esnet PermissionDenied exception on trying to save as wexbim

I have downloaded the pre release of xbim.geometry and essentials from https://www.dropbox.com/sh/srhs5jfc1nwavqb/AADOvjwclPIGnxq5h27Rkbfna following one of the discussions on github as I had the same issue with unable to find xbim.geometry.engine32.dll.

I am currently referencing the pre-release and I have manually copied x64 and x86 folders in to my calling project which is a web api project. I am getting a PermissionDeniedEception which leaves me clueless.

error

Objects missing when opening IFC file

Hello, first of all i want to say that you are doing a great job.

Now the problem i find:
I have an IFC file that Xbim seems unable to load properly. When i open this IFC file using XbimXplorer many objects are missing. But these objects are visible using SOLIBRI.
If i could send this file to you, then maybe you will be able to detect where is the problem.

Thank you!!

Problem occur in Deployment on another PC

Hi ,

I am trying to deploy my application on another PC where visual studio 2013 is not installed .I have installed 4.5.1 & 4.5.2 both framework. But still conversion of ifc to wexbim is not done .

Cannot compile against build of XbimEssentials from git master

I cloned and compiled XbimEssentials from the git master branch. Now I have cloned XbimGeometry and I'm trying to compile it by referencing those assemblies (not the Nuget XbimEssentials package), but the Xbim.Geometry.Engine C++ project complains about missing methods for classes implementing some of the interfaces. e.g. IXbimGeometryObject

Where can I get the updated C++ code please?

Weird vertices values for IfcSlab with OpeningAndAdditionsExcluded

Hi,

first of all I think xBim is a great project and I couldn't find any other library as good or even close to it.

I need to know the wcs vertices of an IfcSlab and its openings.
The first part (ifcslab without openings) is working fine, but the second part is not.

  1. XbimGeometryRepresentationType.OpeningsAndAdditionsExcluded: I get correct (wcs) values.
  2. XbimGeometryRepresentationType.OpeningsAndAdditionsOnly: I don't get any values.
    3. XbimGeometryRepresentationType.OpeningsAndAdditionsIncluded: I get weird values.

I don't understand this behaviour and its probably because I dont really get how the geometry works here, so any help is very much appreciated.

My code to get wcs vertices (which is from stackoverflow). I don't apply the transformation as I concluded the problem is not the transformation (transformation works fine for OpeningAndAdditionsExcluded).

public void CalculateZeichenkoerper(IfcProduct product) {

  var productShape = 

context.ShapeInstancesOf(product) .Where(p => p.RepresentationType == XbimGeometryRepresentationType.OpeningsAndAdditionsExcluded) .Distinct();

if (productShape.Any()) {
    foreach (var shapeInstance in productShape) {
        Console.WriteLine("New ShapeInstance");
        var geometry = Bauelement.context.ShapeGeometry(shapeInstance);
        var data = ((IXbimShapeGeometryData)geometry).ShapeData;
        using (var stream = new MemoryStream(data)) {
            using (var reader = new BinaryReader(stream)) {
                XbimShapeTriangulation mesh = reader.ReadShapeTriangulation();

                //mesh = mesh.Transform(product.Transform()); // apply the absolute wcs transform to the mesh to get the absolute vertices
                foreach (var v in mesh.Vertices.OrderByDescending(p => (p.Z))) {
                    Console.WriteLine(v);
                }
            }
        }
    }
}

}`

For OpeningsAndAdditionsExcluded I get these values which are correct. (I checked them after applying the transform of the ifcslab)

33,5999984741211 48,4000015258789 0,319999992847443
52 48,4000015258789 0,319999992847443
52 17,2000007629395 0,319999992847443
70,7799987792969 17,2000007629395 0,319999992847443
70,7799987792969 0 0,319999992847443
9,9475983006414E-14 0 0,319999992847443
0 48,4000015258789 0,319999992847443
18,3999996185303 48,4000015258789 0,319999992847443
18,3999996185303 25,6000003814697 0,319999992847443
33,5999984741211 25,6000003814697 0,319999992847443
52 48,4000015258789 -3,99680288865056E-15
33,5999984741211 48,4000015258789 -3,99680288865056E-15
52 17,2000007629395 -3,99680288865056E-15
70,7799987792969 17,2000007629395 -3,99680288865056E-15
70,7799987792969 0 -3,99680288865056E-15
9,9475983006414E-14 0 -3,99680288865056E-15
0 48,4000015258789 -3,99680288865056E-15
18,3999996185303 48,4000015258789 -3,99680288865056E-15
18,3999996185303 25,6000003814697 -3,99680288865056E-15
33,5999984741211 25,6000003814697 -3,99680288865056E-15

For OpeningAndAdditionsIncluded I am getting these values which seem like absolute/wcs coordinates in respect to Z-Coordinates but X should be around 200 and Y about 500.

-189,744216918945 139,919387817383 20,4500007629395
-171,344223022461 139,919387817383 20,4500007629395
-189,744216918945 117,119384765625 20,4500007629395
-171,344223022461 108,719383239746 20,4500007629395
-204,944229125977 139,919387817383 20,4500007629395
-206,744216918945 133,594375610352 20,4500007629395
-205,194229125977 133,594375610352 20,4500007629395
-223,344223022461 139,919387817383 20,4500007629395
-206,744216918945 129,619384765625 20,4500007629395
-205,194229125977 129,619384765625 20,4500007629395
-204,944229125977 117,119384765625 20,4500007629395
-196,369216918945 105,069381713867 20,4500007629395
-196,369216918945 102,419380187988 20,4500007629395
-191,119216918945 92,7693862915039 20,4500007629395
-196,369216918945 92,7693862915039 20,4500007629395
-196,369216918945 91,8193817138672 20,4500007629395
-203,969223022461 98,8193817138672 20,4500007629395
-205,219223022461 98,8193817138672 20,4500007629395
-205,219223022461 91,8193817138672 20,4500007629395
-223,344223022461 91,5193862915039 20,4500007629395
-189,494216918945 133,594375610352 20,4500007629395
-187,944229125977 133,594375610352 20,4500007629395
-189,494216918945 129,619384765625 20,4500007629395
-187,944229125977 129,619384765625 20,4500007629395
-152,564224243164 91,5193862915039 20,4500007629395
-152,564224243164 108,719383239746 20,4500007629395
-189,469223022461 108,419380187988 20,4500007629395
-189,469223022461 102,419380187988 20,4500007629395
-190,819229125977 102,419380187988 20,4500007629395
-191,119216918945 102,419380187988 20,4500007629395
-189,469223022461 98,8193817138672 20,4500007629395
-189,469223022461 91,8193817138672 20,4500007629395
-190,819229125977 91,8193817138672 20,4500007629395
-191,119216918945 91,8193817138672 20,4500007629395
-203,969223022461 91,8193817138672 20,4500007629395
-190,819229125977 108,419380187988 20,4500007629395
-191,119216918945 105,069381713867 20,4500007629395
-190,819229125977 98,8193817138672 20,4500007629395
-171,344223022461 139,919387817383 20,1299991607666
-189,744216918945 139,919387817383 20,1299991607666
-189,744216918945 117,119384765625 20,1299991607666
-171,344223022461 108,719383239746 20,1299991607666
-187,944229125977 133,594375610352 20,1299991607666
-187,944229125977 129,619384765625 20,1299991607666
-189,494216918945 129,619384765625 20,1299991607666
-189,494216918945 133,594375610352 20,1299991607666
-190,819229125977 98,8193817138672 20,1299991607666
-191,119216918945 102,419380187988 20,1299991607666
-189,469223022461 98,8193817138672 20,1299991607666
-196,369216918945 102,419380187988 20,1299991607666
-191,119216918945 92,7693862915039 20,1299991607666
-190,819229125977 91,8193817138672 20,1299991607666
-191,119216918945 91,8193817138672 20,1299991607666
-190,819229125977 102,419380187988 20,1299991607666
-191,119216918945 105,069381713867 20,1299991607666
-190,819229125977 108,419380187988 20,1299991607666
-152,564224243164 91,5193862915039 20,1299991607666
-152,564224243164 108,719383239746 20,1299991607666
-189,469223022461 108,419380187988 20,1299991607666
-189,469223022461 102,419380187988 20,1299991607666
-189,469223022461 91,8193817138672 20,1299991607666
-196,369216918945 91,8193817138672 20,1299991607666
-203,969223022461 91,8193817138672 20,1299991607666
-203,969223022461 98,8193817138672 20,1299991607666
-205,219223022461 91,8193817138672 20,1299991607666
-223,344223022461 91,5193862915039 20,1299991607666
-204,944229125977 117,119384765625 20,1299991607666
-196,369216918945 105,069381713867 20,1299991607666
-204,944229125977 139,919387817383 20,1299991607666
-205,194229125977 129,619384765625 20,1299991607666
-205,194229125977 133,594375610352 20,1299991607666
-206,744216918945 129,619384765625 20,1299991607666
-223,344223022461 139,919387817383 20,1299991607666
-196,369216918945 92,7693862915039 20,1299991607666
-205,219223022461 98,8193817138672 20,1299991607666
-206,744216918945 133,594375610352 20,1299991607666

Context Creation Failing

Greetings team,

I'm having difficulties opening the submitted IFC file. Xbim is failing at geometry context creation. Tried with newest Xbim Windows UI version (master and develop).

Any help appreciated.
Best regards,
Uros

image

140056.zip

Missing dlls

I'm getting the below errors when running Bim.Geometry.Nuget solution:

Could not copy Xbim.Geometry.Engine32.dll because it was not found
Could not copy Xbim.Geometry.Engine64.dll because it was not found

Any help would be appreciated.

Entity Faces and Edges

From @miosepayo on February 24, 2016 20:3

Hi,

I plan to retrieve faces and edges (not triangulated) for physical entity (Wall, Beam etc ...). I guess this is releated to XBimShapeInstance but after searched the code for couple of day but don't get the best to way to achieve this. Any help ?

Is this related to MeshGeometry3DExtensions read method ? Case command for faces is empty ...

Thanks for your work on this project.

Copied from original issue: xBimTeam/XbimWindowsUI#25

Converting faces to Unity style vertices + triangles?

I'm trying to convert each type of ShapeRepresentation into a format suitable for Unity i.e. meshes with vertices + triangles.

Right now I'm looking at the Extruded Area Solid, and can already convert this to an IXbimSolid that contains N Faces and N Vertices using :-

XbimGeometryEngine geom = new XbimGeometryEngine();
IXbimSolid solid = geom.CreateSolid((IIfcExtrudedAreaSolid)shape);

Now I note that each Face has an OuterBound which describes the outside edge, and 0..N InnerBounds which describe inner voids contained wholly inside the OuterBound that also don't overlap each other.

For clarification - can a Face only contain either 3 or 4 edges, or is there a possibility of more? Right now, I'm assuming only 3 or 4 edges, and the conversion of the OuterBound to 1 or 2 triangles is easy enough.

However, what happens when a face has one or more InnerBounds, that need to be cut out of the face while creating the triangle mesh?

Does the geometry library offer any functionality to do this conversion of Faces to a vertices + triangles type construct? And if not, what would you recommend in terms of 3rd party libraries that do offer this functionality?

ShapeGeometryMeshOf bug based on CultureInfo

Hi.
I'm trying to convert ifc file into Vertices, Triangles structure. I'm using ShapeGeometryMeshOf. I discover that on some machines this is working perfectly on other I obtain point list that is corrupted. After hours of research I found that I can simulate this problem by changing number format in windows settings. If the decimal separator is set to ".", it is working. When I change id to "," (like it is used in many countries) the point list is broken. So in some part of code (I do not have any idea where) numbers are parsed badly if decimal separator is set to "," ("Control Panel" -> "Change date, time, or number formats" -> "Additional Settings" -> "Decimal Separator"). If you need my code to reproduce the error let me know. If some languages settings can be passed into library, let me know.

Error in ShapeGeometryMeshOf() method

Hello,
@martin1cerny @SteveLockley
I am trying to extract triangulated meshes of all geometries in an IFC file using this code
I have already loaded the model with ifcstore.open...

`var context = new Xbim3DModelContext(model);
context.CreateContext();

            //var geometries = context.ShapeGeometries();
            //XbimShapeTriangulation mesh = null;
            var geometries = context.ShapeInstances();

            foreach (var g in geometries)
            {
                //var ms = new MemoryStream(((IXbimShapeGeometryData)g).ShapeData);
                //var br = new BinaryReader(ms);
                //mesh = br.ReadShapeTriangulation();
                ////mesh = mesh.Transform(((XbimShapeInstance)g).Transformation);

                //Console.WriteLine(g.Format + " | " + g.ShapeLabel);
                //Console.WriteLine(mesh.Faces.Count() + " | " + mesh.Vertices.Count());

                var tri = context.ShapeGeometryMeshOf(g);
                Console.WriteLine(tri.TriangleIndexCount + " | " + tri.ToString());
               
            }

`
If I'm using the commented part of the above code, the mesh returns without being triangulated. The format is PolyHedronBinary.

If I use the context.ShapeGeometryMeshOf() method, there is an exception thrown : invalid geometry type .

image

Please help me with triangulating the geometries of the model.

I have also read about the method "read" in XbimWindowsUI/Xbim.Presentation/MeshGeometry3DExtensions.cs, but I am not able to figure out what I have to pass as the "m3d" parameter ?

/// <summary> /// Reads a triangulated model from an array of bytes and adds the mesh to the current state /// </summary> /// <param name="m3D"></param> /// <param name="mesh">byte array of XbimGeometryType.PolyhedronBinary Data</param> /// <param name="transform">Transforms the mesh to the new position if not null</param> public static void Read(this MeshGeometry3D m3D, byte[] mesh, XbimMatrix3D? transform = null)

It will be great if anybody could provide/ point me to example usage of this method.

I need to rebuild the IFC model in Unity and hence I need the triangulated mesh data.

Also suggest if there is anyway to achieve this more efficiently and/or in a simpler way!

Many Thanks in advance,
Ani

Issues with XBIM 32bit dll

I have developed a BIM application that integrates with another application (let’s say application B). Now application B uses a 32bit dll. In order for this application to work I need to enable 32 bit applications to true in IIS application pool. But here lies the problem. XBIM source consists of two dll’s (32-bit and 64-bit). The dll is responsible for converting IFC file – XBIM – WEXBIM. Now both these processes need to happen together in my application.

For application B to run , it’s mandatory that the condition remains true in IIS. However whenever this condition is true the XBIM uses the 32bit dll automatically which fails to convert ifc files over the size of 900 mb.(to be specific the XBIM conversion stops at 880 mb). I need to convert a 1gb(or even more) ifc file. The error that is shown is (stack overflow at the 32bit XBIM dll). However when I set the condition (enable 32bit application) to false in IIS, XBIM uses the 64 bit dll and successfully converts IFC – XBIM – WEXBIM.

Now I need the condition to be set to true all the time for my App B to work. Is there any way that this 32 bit XBIM Conversion dll can be bypassed and we can force it to use the 64 bit dll all the time even if the condition in IIS is true??
Need urgent help on this!!

The Solution "Xbim.Geometry.Nuget" does not compile

Hi guys

I am using Visual Studio 2012 and trying to build the sample solution "Xbim.Geometry.Nuget"
Unfortunately, it is not possible to compile it . There are following Errors coming.

Do you know what can help?

Thank you
Martin

ERRORS:

Error 17 Metadata file 'C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Output\Debug\Xbim.ModelGeometry.Scene.dll' could not be found C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.Geometry.Engine.Tests\CSC Xbim.Geometry.Engine.Tests

Error 18 Metadata file 'C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Output\Debug\Xbim.ModelGeometry.Scene.dll' could not be found C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.Geometry.Profiler\CSC Xbim.Geometry.Profiler

Error 19 Metadata file 'C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Output\Debug\Xbim.ModelGeometry.Scene.dll' could not be found C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.Geometry.Regression\CSC XbimRegression

Error 15 Metadata file 'C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Output\Debug\Xbim.Geometry.Engine.Interop.dll' could not be found C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.ModelGeometry.Scene\CSC Xbim.ModelGeometry.Scene

Error 16 Metadata file 'C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Output\Debug\Xbim.Geometry.Engine.Interop.dll' could not be found C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.Geometry.Engine.Tests\CSC Xbim.Geometry.Engine.Tests

Error 14 'Xbim::Geometry::XbimWire' : illegal member initialization: 'XbimWire' is not a base or member C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.Geometry.Engine\XbimWire.cpp 102 Xbim.Geometry.Engine.Interop

Error 13 'Xbim::Geometry::XbimVertex' : illegal member initialization: 'XbimVertex' is not a base or member C:_DEV_IMRoomWallPOC\packages\XbimGeometry-master\XbimGeometry-master\Xbim.Geometry.Engine\XbimVertex.cpp 33 Xbim.Geometry.Engine.Interop

Error 12 'Xbim::Geometry::XbimSolidSet::_isSimplified': only static data members can be initialized inside a ref class or value type (XbimSolidSet.cpp) c:_dev_imroomwallpoc\packages\xbimgeometry-master\xbimgeometry-master\xbim.geometry.engine\XbimSolidSet.h 40 Xbim.Geometry.Engine.Interop

Error 2 'Xbim::Geometry::XbimSolidSet::_isSimplified': only static data members can be initialized inside a ref class or value type (XbimSolid.cpp) c:_dev_imroomwallpoc\packages\xbimgeometry-master\xbimgeometry-master\xbim.geometry.engine\XbimSolidSet.h 40 Xbim.Geometry.Engine.Interop

Error 3 'Xbim::Geometry::XbimSolidSet::_isSimplified': only static data members can be initialized inside a ref class or value type (XbimShellSet.cpp) c:_dev_imroomwallpoc\packages\xbimgeometry-master\xbimgeometry-master\xbim.geometry.engine\XbimSolidSet.h 40 Xbim.Geometry.Engine.Interop

Error 6 'Xbim::Geometry::XbimSolidSet::_isSimplified': only static data members can be initialized inside a ref class or value type (XbimShell.cpp) c:_dev_imroomwallpoc\packages\xbimgeometry-master\xbimgeometry-master\xbim.geometry.engine\XbimSolidSet.h 40 Xbim.Geometry.Engine.Interop

etc....

Tearing in geometry for IfcExtrudedAreaSolid

From @Jero9999 on August 15, 2016 4:34

I am coming across examples of tearing in the geometry for extruded area solids (though it might be for other things too)
First example: Looking at the end of an extruded solid. See the edges tearing. Note: the profile here is a composite curve.
image

Second example: This is slightly different in that it is not the end tearing away from the 'extrusion' but the different parts of the extrusion itself
image
Note: the profile here is a simple polyline and doesn't seem to have a problem. The extrusion here is actually a revolved area solid

Here is the IFC file for the first example
CurvedFaceTests.Ifc.txt

Version note:
my version of xbim xplorer reports it is 3.2.1.0.
File version: 3.2.1601.19255

Copied from original issue: xBimTeam/XbimWindowsUI#28

Moving all geometry element during federation ?

Hi team
We have problem in the federation loading file step
Ifc file are not correctly in the same place
but they are in Revit :
xbimissue

As you can see, some entities (IfcSpace, ifcDistributionElement...) are outside the building
xbimissue2

we think problem due to Revit

we tryied to modify directly the ifc file with notePad++ 😄 without succes

the only way we think good could be to move the entire geometry during createContext

Do you have any idea to do it easily ?

Regards

ifcFile.zip

Documentation doesnt have info on xBIM.ModelGeometry.Scene

Hello @SteveLockley ,
I have been unsuccesful in finding any documentation on xBIM.ModelGeometry here.

Is it missing or am I looking at the wrong documentation version?!

This class seems very helpful for my task but I cannot find any documentation on that.

As a side note, when I tried to build the xbim.docs solution on VS 2015, it failed saying its incompatible with my version of VS.

Help a noob!

Thanks in advance,
Ani

Wexbim file fails to display

Hello,

I'm facing an issue where some IFC files (mostly the ones that are small in size) are converted successfully to wexbim and displayed in the viewer, however other IFC files are failing to display (although their wexbim files are generated, they seem to be corrupt).

I'm using Xbim.Geometry.3.1.14 package. Below is the code I'm using to convert the files to wexbim:

 using (var wexBimFile = new FileStream(wexBimFileName, FileMode.Create))
            {
                using (var binaryWriter = new BinaryWriter(wexBimFile))
                {
                    using (var model = new XbimModel())
                    {
                        model.CreateFrom(ifcFileFullName,xbimFile, null, true, false);
                        Xbim3DModelContext geomContext = new Xbim3DModelContext(model);
                        geomContext.CreateContext(XbimGeometryType.PolyhedronBinary);
                        geomContext.Write(binaryWriter);
                    }
                }
            }

Any help/suggestion as to why the wexbim files are generated corruptly ,would be highly appreciated.

IfcSweptDiskSolid trim bug

Hello all,

I've isolated the case where IfcSweptDiskSolid geometry is not generated correctly.
The problem seems to be caused by trim parameter values not being in radians.

Take a look at attached images. The first image shows correct geometry inside Solibri Model Viewer.
The second image shows the same IFC loaded in Xbim.
The third image shows workaround which causes Xbim to generate the correct geometry.

rebar-solibri
rebar-xbim
ifcsnippet

REBAR.zip

IfcOpenShell invalid cast exception

Hi, this is my test code.

var store = IfcStore.Open(file, null, null); var storeGem = store.GeometryStore; if (storeGem.IsEmpty) { var context = new Xbim3DModelContext(store); context.CreateContext(); } foreach (IReferencedModel model in store.ReferencedModels) { if (model.Model == null) continue; if (!model.Model.GeometryStore.IsEmpty) continue; var context = new Xbim3DModelContext(model.Model); context.CreateContext(); }

However, on Xbim3DModelContext line 1160,
var shape = (IIfcGeometricRepresentationItem)Model.Instances[shapeId];
would throw an invalid cast exception, when the shape is type of ifcopenshell.

added:
also I got many error logs like
ERROR Xbim.Geometry.XbimGeometryCreator [(null)] - GeomEngine: #1494000=IfcCartesianPoint [Geometry Representation of Type IfcCartesianPoint is not implemented]

Any suggestions?

Cheers.

Problem trying to run XbimGeometryEngine

From @IFChaos on June 11, 2015 18:13

Hello, i'm new in Xbim, i need to load the geometry of an IFC file, but i obtain this error.

"Could not load file or assembly 'Xbim.Geometry.Engine32.dll' or one of its dependencies. The specified module could not be found."

The same problem emerges when i try to open a IFC file using XbimXplorer

Any ideas on what i'm doing wrong?

Copied from original issue: xBimTeam/XbimWebUI#16

How to shift element IDs

I am converting IFC files to wexbim using Xbim3DModelContext. Works.
But when I show multiple wexbim files in the browser, the IDs interfear.

Ist there a simple way to shift the IDs by a certain amount during wexbim conversion? On which stage?

     static public void ConvertIfcToWexbim(string projectName, string path)
     {
            var modelname = path+ projectName + ".xBIM";
            var fileName = path + projectName+".ifc";

            using (XbimModel model = GetModel(fileName))
            {
                if (model != null)
                {
                    var context = new Xbim3DModelContext(model);
                    context.CreateContext(geomStorageType: XbimGeometryType.PolyhedronBinary);

                    var wexBimFilename = Path.ChangeExtension(fileName, "wexBIM");
                    using (var wexBiMfile = new FileStream(wexBimFilename, FileMode.Create, FileAccess.Write))
                    {
                        using (var wexBimBinaryWriter = new BinaryWriter(wexBiMfile))
                        {
                            context.Write(wexBimBinaryWriter);
                            wexBimBinaryWriter.Close();
                        }
                        wexBiMfile.Close();
                    }
                }
            }
        }

        private static XbimModel GetModel(string fileName)
        {
            XbimModel openModel = null;
            try
            {
               var model = new XbimModel();
               model.CreateFrom(fileName, null, null, true);
               openModel = model;
            }
            catch (Exception e)
            {
            }
            return openModel;
        }

Problem with getting Space Geometry

Sorry if this is the wrong place. I'm trying to retreive the geometry information for IFCSpace products, and having a bad time, as I can't figure out how to get this information for these objects. There's a similar issue open from in june, but the solution offered there did not work for me. What I'd like to know is if there's any way of getting a mesh out of it. I can provide a model if that's helpful. This is the kind of thing I'm trying.

         using (XbimModel model = ParseModelFile(path, xbimFileName, false))
            {
                var context = new Xbim3DModelContext(model);                                                   
                IEnumerable<IfcProduct> products = model.Instances.OfType<IfcSpace>(true);                    
                 foreach (var product in products)
                 {
                    var productShape =
                        context.ShapeInstancesOf(product)
                        .Distinct();

                    if (productShape.Any())
                    {
                        //always null
                    }
                 }
            }

IfcSweptDiskSolid along IfcPolyLine

Hello,

It appears that there is possibly another bug with IfcSweptDiskSolid.
The attached model is a rebar with swept disk along polyline geometry.

The first image is from Solibri Model Viewer, the second one is from latest Windows UI develop build.
I'm preparing another file where this kind of issue is even more evident.

circular-rebar-solibri

circular-rebar-xbim

circular-rebar.zip

Problem with IfcFastener bolt holes

Hi xBimTeam,

I am part of a team developing a system to fabricate steel beam assemblies using 6 axis robots.
Our system is driven by data imported from IFC files.
We have some existing IFC import code but it is poorly written and slow and doesn't support Tekla 21 IFC export.
Your code looks much better and we are in the process of incorporating it into our system.
Great job guys.

I currently have a problem with IfcMechanicalFasteners.
For our system, in some cases we need to generate part meshes with fastener holes included.
In other cases, we need to generate meshes without the holes, so we can calculate the intersections with the fasteners and instruct the robots to cut the holes.

We are hoping to move to IFC files exported by Tekla Structures 21.0, these have a feature where the fastener bolt holes can be included as a void in the triangle part mesh.

Hovever the mesh geometry generated by your geometry engine often seems to incorrectly generate the meshes with bolt holes. For some parts it works correctly but not for all. If I import the same IFC file in Solibri viewer the holes are all generated correctly.

Can you tell me if this is a known issue?

I am using Xbim.Geometry.Engine V3.1, the master branch on NuGet.

I have included a small IFC file which I think demonstrates the problem.

Any help is greatly appreciated.

Regards,

Richard.

testv2_ifc.txt

weird meshes

I use XbimGeometry and FBXSDK to export fbx from ifc. However, I got some weird meshes in the model. This also happened when view this ifc in XbimXplorer. The description image and ifc file are attached here. Any suggestions? Thanks in advance.

test
CJ_1.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.