Comments (6)
Hi @martin-loucka , creatimg geometry is very complex task. What you need to do is to take the representation of IfcWall and pass it to geometry engine if you want to do it this way. You will also need to consider product placement which has to be applied to the representational geometry. Also mapped items need to be transformed one or more times. All this results in a hierarchy of transformations and possibly repeated geometry representations. At the end - yes, you can do geometry intersection on these objects. I'm not sure what the engine will return for intersection between space and wall because as you said quite rightly yourself it is touching not intersecting. Or the intersection should be a 2D plane in 3D space. Have a look at XbimScene to see how transformations are used.
from xbimgeometry.
Hello.
In fact, what you really need is supposed to already exists in your Ifc files (wall areas touching an ifcSpace) as it is exactly what IfcRelSpaceBoundary are for.
I did something similar few weeks ago. Here is a piece of code that'll show you how to get geometry of boundaries of a space that are linked to a wall.
In hope it may help.
XbimGeometryEngine engine = new XbimGeometryEngine();
foreach (IfcRelSpaceBoundary rel in sp.BoundedBy.Where(r => (r.RelatedBuildingElement is IfcWall)))
{
IfcWall w = rel.RelatedBuildingElement as IfcWall;
IfcConnectionSurfaceGeometry geom = rel.ConnectionGeometry as IfcConnectionSurfaceGeometry;
IfcSurfaceOrFaceSurface surface = geom.SurfaceOnRelatingElement;
IXbimFace face = null;
IXbimShell shell = null;
if (surface is IfcSurfaceOfLinearExtrusion)
{
var res = engine.CreateShell(surface as IfcSurfaceOfLinearExtrusion);
if(res != null) { face = res.Faces?.First; }
}
else if(surface is IfcCurveBoundedPlane)
{
face = engine.CreateFace(surface as IfcCurveBoundedPlane);
IfcCurveBoundedPlane pl = surface as IfcCurveBoundedPlane;
// On replace les coordonnées en dehors du repère local de la courbe pour placer le contour dans le repère de la pièce
XbimMatrix3D transfPlane = pl.BasisSurface.Position.ToMatrix3D();
face = face.TransformShallow(transfPlane) as IXbimFace;
}
else if (surface is IfcSurface)
{
face = engine.CreateFace(surface as IfcSurface);
}
else if (surface is IfcFaceSurface)
{
face = engine.CreateFace((surface as IfcFaceSurface).FaceSurface);
}
else if (surface is IfcFaceBasedSurfaceModel)
{
shell = engine.CreateShell((surface as IfcFaceBasedSurfaceModel).FbsmFaces.First);
}
if (face != null)
{
// Congrats ! you got a face between a space and a wall
}
else if (shell != null)
{
foreach (var f in shell.Faces)
{
// Congrats ! you got a face between a space and a wall
}
}
}
from xbimgeometry.
Thank you guys for you answers! The whole xBim team is doing a great job!
I will try to implement it now
from xbimgeometry.
Hello mwymwy
The problem is that we are comparing more ifcs from different sources... lets say somebody makes the walls and somebody else model the rooms (IfcSpace) so there is not the room wall link between those files..
This is the reason why I am trying to intersect the walls (IfcWall) and rooms (IfcSpace)
Best Martin
from xbimgeometry.
@martin-loucka
I get the point, indeed without any kind of relation between space and wall it is much more complicated.
It seems weird to me that Spaces may be modeled or designed outside all kind of boundary logic thing :-/
It creates the needs to implement much more heavy geometric algorithms that should not be needed in the first place as all they would do would be the exact inverse thing that was made when defining what space is between what physical limits.
That's kinda using Ifc philosophy of splitting things in different files, against the other Ifc philosophy of keeping things related to each other to answer such needs !
If you succeed at implementing what you need, I'll be really happy to give a little look to know how it's done ;)
from xbimgeometry.
Closing as this is an Ifc not an Xbim issue
from xbimgeometry.
Related Issues (20)
- Iternal loop in XBim3DModelContext.cs
- Bulding xBim v6 HOT 2
- Different exception behaviour between Debug and Release builds HOT 7
- Xbim.Geometry.Engine64.dll And Xbim.Geometry.Engine32.dll build folder issue. HOT 4
- AccessViolationException when loading a IFC file HOT 6
- Resolving native assemblies from UNC file share fails under NetFramework
- Some IXbimSolid elements don't exist when performing boolean operations HOT 4
- How to get color of IfcSpace? HOT 3
- net6.0 support HOT 4
- Cant create valid IfcSurfaceCurveSweptAreaSolid HOT 1
- Getting correct position of the model in world coordinates
- How to set up local development environment to fix bug's and create PR to contribute in xbim repositories. HOT 1
- 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
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.