Comments (9)
Thomas,
This is what I have come up with:
var productShape =
context.ShapeInstancesOf((IIfcProduct) element)
.Where(s => s.RepresentationType != XbimGeometryRepresentationType.OpeningsAndAdditionsExcluded)
.ToList(); // this also returns shapes of voids
if (!productShape.Any())
return;
XbimShapeTriangulation mesh = null;
foreach (var shapeInstance in productShape)
{
var geometry = context.ShapeGeometry(shapeInstance.ShapeGeometryLabel);
var ms = new MemoryStream(((IXbimShapeGeometryData) geometry).ShapeData);
var br = new BinaryReader(ms);
mesh = br.ReadShapeTriangulation();
mesh = mesh.Transform(((XbimShapeInstance) shapeInstance).Transformation);
..
then the mesh has easy access to mesh.Vertices and mesh.Faces
I haven't finished testing yet but getting good results when the ifc file processes
let me know how it goes.
jay
from xbimgeometry.
any update on this issue ?
from xbimgeometry.
Hello,
sorry for the delay.
Can you clarify what you are trying to do?
also the file that you refer to does not seem to be attached to the thread.
Thanks,
Claudio
from xbimgeometry.
Claudio,
Thanks for the reply. I didn't attach a file it happens to all my ifc files using the code fragments shown above.
I am trying to go though all the meshes and extract the vertices and faces to create a particular graphics representation. The code from 2.4.1 works fine but in cannot get the meshes in the latest to contain anything.
Any help you can provide is greatly appreciated.
thanks
jay
from xbimgeometry.
from xbimgeometry.
from the code above once I get the mesh as XbimMeshGeometry3D I just extract all the mesh.Positions and TriangleIndices to build another form I need of the mesh. The count of thee is now 0 in version later 2.4.1. If there is a better way to get the points and faces now I would love to get it. There is another question related to this posted by someone else.
thanks
again
jay
from xbimgeometry.
Claudio,
Do you have a better way now to get the vertices and faces of the meshes ? I could sure use it.
thanks
jay
from xbimgeometry.
Hi Jay,
Have you figured it out? I'm trying to perform a similar operation and would love to know how you solved the issue.
Cheers,
Thomas
from xbimgeometry.
That's awesome Jay!
That's exactly what I was looking for. Wasn't aware of the "ReadShapeTriangulation" function, was stuck with some binary information.
Thx a bunch.
Thomas
from xbimgeometry.
Related Issues (20)
- stackoverflow in Xbim3DModelContext.CreateContext() when trying to load IFC model with XBim.Geometry HOT 4
- 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
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.