Code Monkey home page Code Monkey logo

xbimdemo's Introduction

Stories in Ready

XBimDemo

A short demo of using the XBim toolkit to process models, generate geometry and extract semantic and geometric data

Uses XBimEssentials and XBimGeometry to open, parse and generate xbim and wexbim semantic and geometric models.

Using that it shows how to get bounding boxes of all products in the model and show their dimensions and placement.

xbimdemo's People

Contributors

andyward avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xbimdemo's Issues

Is there any way I can find the height of each layer of the wall?

Hi All,

Is there anyway I can find the height of each layer of the wall?

Right now the code I am using is as follows:

IfcMaterialLayerSetUsage ifcMaterialLayerSetUsage = (IfcMaterialLayerSetUsage)ifcWall.GetMaterial();
                
                if (null != ifcMaterialLayerSetUsage)
                {
                    IfcMaterialLayerSet layerSet = ifcMaterialLayerSetUsage.ForLayerSet;
                    if (null != layerSet)
                    {
                        IItemSet<IfcMaterialLayer> lstMaterLayer = layerSet.MaterialLayers;


                        //If three layers, then it is external
                        if (null != lstMaterLayer)
                        {
                            int noOfLayers = lstMaterLayer.Count();
                            if (noOfLayers == 3)
                            {
                                var externalLayer = lstMaterLayer.First();
                                externalLayerThickness = externalLayer.LayerThickness;

                                var midLayer = lstMaterLayer.ElementAt(1);
                                cavityThickess = midLayer.LayerThickness;

                                var innerLayer = lstMaterLayer.ElementAt(2);
                                steelThickness = innerLayer.LayerThickness;
///**** doubt steelLayerHeight = innerLayer.????

                            }
                            //One layer assume it is steel, may be buggy but now this is an assumption
                            else
                            {
                                steelThickness = layerSet.TotalThickness;
                            }
                        }
                    }
                }

Best regards,
Jojo

Finding four coordinates of each wall

Hi Andy,

Thanks very much for your effort.

I am in the process of finding four bottom coordinates of the wall. My code follows works for most of the cases.

foreach (var shapeInstance in productShape)
{
var shapeGeometry = context.ShapeGeometry(shapeInstance.ShapeGeometryLabel);

       XbimMatrix3D transformation = shapeInstance.Transformation;
       XbimPoint3D location = shapeGeometry.BoundingBox.Location;
       XbimRect3D boundingBox = shapeGeometry.BoundingBox;              

       XbimPoint3D point1 = transformation.Transform(location);
       XbimPoint3D point2 = ProjectTo(point1, transformation.Right, boundingBox.SizeX);
       XbimPoint3D point3 = ProjectTo(point2, transformation.Up, boundingBox.SizeY);
       XbimPoint3D point4 = ProjectTo(point3, transformation.Left, boundingBox.SizeX);

}

My ProjectTo is:
static public XbimPoint3D ProjectTo(XbimPoint3D p, XbimVector3D dirn, double dist)
{
XbimPoint3D p1;
p1 = p + dirn * dist;
return (p1);
}
However when transformation becomes an identity, it is not giving the correct coordinates. I have attached my IFC file. Can you please tell what I am missing here?

Best regards,
JJ

SeanOuterProb.txt

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.