Comments (1)
HI @CCT-Mukund-Thakare, yes you're right a doc would help. I'll make a few notes quickly here and hopefully we can revisit with a md doc:
Understanding the Projects / purposes
So high level, xbimEssentials is the core of xbim Toolkit. It's reads and writes IFC schema files in a variety of formats. It also provides some fundamental data structures for representing the Geometry and visual aspects of models (and a Tesselator to turn geometry into a mesh), but doesn't implement any geometry itself.
xbimGeometry is a separate repo that depends on Essentials, which translates the many IFC logical representations and their conventions into pure geometry, and incorporates a boolean library (OpenCascade) for fundamental shape operations. @Ibrahim5aad did a nice overview post of the fundamentals on LinkedIn
For an overview of the wider Toolkit dependencies see this (slightly out of date) section of the Readme
In a bit more detail, what the assemblies do
XbimEssentials
- Xbim.Common : defines foundational xbim types such as IPersistEntity, IModel, geometry primitives etc.
- Xbim.IO.Esent : an implementation of IModel with persistence backed by the (Windows only) Esent data store
- Xbim.IO.MemoryModel : an in-memory implementation of IModel - no persistence beyond native IFC formats
- Xbim.Ifc : Higher order implementations around IModel, e.g. IfcStore, and extensions to do things like persist wexbim Geometry
- Xbim.Ifc2x3 : code-generated entities for the Ifc2x3 schema
- Xbim.Ifc4: code-generated entities for the Ifc4 ADD2 TC1 schema. Includes the cross schema interfaces
- Xbim.Ifc4x3: code-generated entities for the Ifc4.3 schema
- Xbim.Tessellator: Supports generation of optimised tessellated meshes from xbim Geometry
XbimGeometry
- Xbim.Geometry.Engine: a CLI/C++ 'Mixed mode' library that implements the low level geometric operations on IfcRepresentations to Geometry shapes. Incorporates the OpenCascade C++ library etc.
- Xbim.Geometry.Engine.Interop : A C# wrapper assembly that handles correct deployment of the native Geometry Engine. It delegates all calls down to the core engine.
- Xbim.Geometry.Engine.Interop.Tests : Unit tests for Xbim.Geometry.Engine[.Interop] and Xbim.ModelGeometry.Scene
- Xbim.Geometry.Portable : Redundant. Ignore
- Xbim.Geometry.Regression: A test project used to test a set of models against a baseline
- Xbim.ModelGeometry.Scene: Implements a 3D scene, including placement, materials etc using Xbim.Geometry.Engine.Interop and Xbim.Tessellator. Introduces Xbim3DModelContext
Working with XbimGeometry - Debugging etc
Typically we target the develop branch (v5.1) but in the short term I recommend using feature/netcore (v6) as the base branch - as this will shortly become develop and any fix won't need back-porting to v6. It's also a lot easier / quicker to debug with.
Assumption: you can already build and test the XbimGeometry solution. See the Readme for pre-requisites.
To some extent your approach depends on how deep you are going but this is my typical workflow when I have to go into Geometry:
- Establish a minimal reproduction of the issue by stripping down an IFC to the minimal required elements.
Start by identifying the Ifcproduct(s) that cause the issue. Usually the logs will help you here. To create a mininal IFC test file,
I recommend using the 'Ifc Stripping' feature in XbimXplorer for this. Note you don't need to be able to visualise the model to strip out a product. Here's I'm stripping a single product (FlowTerminal #120371) out of an 18MB MEP model to create a 100k test sample.
![image](https://private-user-images.githubusercontent.com/923699/305052729-b5c7fedf-a35f-47e8-9c51-53f75c73aa30.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5OTU2MDYsIm5iZiI6MTcxODk5NTMwNiwicGF0aCI6Ii85MjM2OTkvMzA1MDUyNzI5LWI1YzdmZWRmLWEzNWYtNDdlOC05YzUxLTUzZjc1YzczYWEzMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMVQxODQxNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mOTI2MmEyN2EwYTA3ZDExZGViZmZiMDhmZWFhYzA1NTYxMmFjOWEzMzUyZTViOWFiNTU3Njk2NjUxZTA1YmVlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.TZcXRe6kokFhb6pYECs12UrfblBbouwjTvMppFCzNt8)
![image](https://private-user-images.githubusercontent.com/923699/305031262-1b56f166-1c2c-483b-9fc4-b81568d5bcc7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5OTU2MDYsIm5iZiI6MTcxODk5NTMwNiwicGF0aCI6Ii85MjM2OTkvMzA1MDMxMjYyLTFiNTZmMTY2LTFjMmMtNDgzYi05ZmM0LWI4MTU2OGQ1YmNjNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMVQxODQxNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xMWNjZmUyMjJmZTllM2RmNTAyYTVmMWVmMGU0MTZlMmFhMGFlZDNmYjU3ZDE1ZWIzYmUzNjUxMWIzODUzMzU4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.RJ3K0ms8ST1LitSsQrhz9hwZGiLWCf4BLXSQgxvWGGg)
![image](https://private-user-images.githubusercontent.com/923699/305051846-6300253c-f995-44f8-964c-29a67d2599eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5OTU2M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with
- Create a unit test exercising the code with that minimal file For example
- Debug from the unit test, and determine a fix, ensuring no regressions in the unit tests
(If there's a major change we'd also run the Xbim Regression test suite)
How to visualise
A couple of different approaches:
- Use
model.SaveAsWexBim(wexBimBinaryWriter)
to output a tessellated wexbim file, and load into the xbimWebUI viewer. This is probably the quickest way to view a scene, and means you don't need to create Nuget packages - Manually package the Xbim.ModelGeometry.Scene and Xbim.Geometry.Engine.Interop projects into a nupkg nuget file (
dotnet pack
etc or just use the IDE), host these in a local / private nuget repo, and integrate into XbimWindowsUI - or your own service. - Lastly for more advanced cases you can save individual objects to a Brep text format using WriteBrep() on a GeometryEngine instance and tools such as OpenCascade's CAD Assistant will render that file for you. e.g.
![image](https://private-user-images.githubusercontent.com/923699/305044987-3c09177d-ab5e-4f26-878f-43470eb19be0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5OTU2MDYsIm5iZiI6MTcxODk5NTMwNiwicGF0aCI6Ii85MjM2OTkvMzA1MDQ0OTg3LTNjMDkxNzdkLWFiNWUtNGYyNi04NzhmLTQzNDcwZWIxOWJlMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMVQxODQxNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03NGQ5NjViZmZkNzA0NjAzNmNjNjI1Y2ZmYzFmOTEyM2E5NjdkNjNhYmJiNGI1ZDgzZjZhMDU4OGJhNzE3YmNmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.PLTGKDnzpQI7Brz_XNT8fzg7lhKhn62XEJp8_i2vmNM)
Hope that's a good starting point.
from xbimgeometry.
Related Issues (20)
- net6.0 support HOT 4
- Cant create valid IfcSurfaceCurveSweptAreaSolid HOT 1
- Getting correct position of the model in world coordinates
- How to get outer Edges for an IfcEntity using Xbim library ? HOT 8
- Load Ifc File System.AccessViolationException HOT 4
- Big size of result IFC file HOT 3
- XbimShapeInstance.Transformation places instance in world coordinates HOT 1
- Setting model units HOT 3
- Is v6 geometry engine currently much slower than v5?? HOT 2
- System.OutOfMemoryException. Array dimensions exceeded supported range. HOT 5
- GetShellPoints of a component HOT 1
- Failed to load IFC file: failed to load Xbim.Geometry.Engine64.dll HOT 6
- We need to get plot line bounding box distance for all levels. HOT 1
- We need to get shellpoints of any Building elements. HOT 1
- How to get face points of any building element. HOT 1
- ShapeUpgrade_UnifySameDomain causes a freeze HOT 5
- How to find Width of IfcRamp element?
- Degenerate wire leads to crash (BRepAdaptor_CompCurve) HOT 1
- WexBim viewer is not showing the geometry correctly HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xbimgeometry.