Comments (4)
EDIT: Ignore all the above, I'm an idiot. Okay, so I now worked out how to populate the models thus 👎
var context = new Xbim3DModelContext(model);
context.CreateContext();
And can now see all the shapes with cutouts and voids already applied with what appears to be vertices and triangle data inside the ShapeGeometries.ShapeData
So my question now is simply, how do I get the values back out of ShapeData ?
I can get the counts of the vertices and triangles thus
var tri = XbimShapeTriangulation.TriangleCount(((IXbimShapeGeometryData)item).ShapeData);
var vert = XbimShapeTriangulation.VerticesCount(((IXbimShapeGeometryData)item).ShapeData);
But how do I get the individual values for each triangle and vertex?
I can see the basic storage mechanism for the vertices and triangles inside the binary blob, but surely there must be a built-in method in the library to avoid all this low level hacking?
from xbimgeometry.
@daveime,
you are right, we have been quite brainiacs (derogatory use) about this.
I'll see if this can be rectified.
Thanks for the feedback.
from xbimgeometry.
I would be interrested in the same and am unsure what the comment means: Is this already easily possible and just not well documented, or this this a feature that might be added in the future?
from xbimgeometry.
@thorade It is possible but requires some custom code - there's nothing built in to the XbimShapeTriangulation class to convert the binary ShapeData blob back into vertices, triangles and normals.
If you're interested, check out http://marikinacgi.com/XBIM/convert.txt
The function takes the shapedata as a byte[] array, references to the lists of vertices, triangles and normals you want to extract, an XbimMatrix3D matrix to convert the points directly to world coordinates, and a double onemeter which can be parsed from the model data so that the points are expressed in meters.
@CBenghi if you're interested to add this to the XbimShapeTriangulation class or just add to the documentation as an example of how to parse the data, please feel free.
from xbimgeometry.
Related Issues (20)
- 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
- 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
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.