GithubHelp home page GithubHelp logo

How to set up local development environment to fix bug's and create PR to contribute in xbim repositories. about xbimgeometry HOT 1 OPEN

CCT-Mukund-Thakare avatar CCT-Mukund-Thakare commented on August 19, 2024
How to set up local development environment to fix bug's and create PR to contribute in xbim repositories.

from xbimgeometry.

Comments (1)

andyward avatar andyward commented on August 19, 2024 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:

  1. 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 image image image image
  1. Ensure all tests pass to start with
  2. Create a unit test exercising the code with that minimal file For example
  3. 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:

  1. 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
  2. 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.
  3. 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

Hope that's a good starting point.

from xbimgeometry.

Related Issues (20)

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.