GithubHelp home page GithubHelp logo

Meshes coming back empty about xbimgeometry HOT 9 CLOSED

xbimteam avatar xbimteam commented on August 18, 2024
Meshes coming back empty

from xbimgeometry.

Comments (9)

jv112602 avatar jv112602 commented on August 18, 2024 1

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.

jv112602 avatar jv112602 commented on August 18, 2024

any update on this issue ?

from xbimgeometry.

CBenghi avatar CBenghi commented on August 18, 2024

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.

jv112602 avatar jv112602 commented on August 18, 2024

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.

CBenghi avatar CBenghi commented on August 18, 2024

from xbimgeometry.

jv112602 avatar jv112602 commented on August 18, 2024

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.

jv112602 avatar jv112602 commented on August 18, 2024

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.

ThomasTrinelle avatar ThomasTrinelle commented on August 18, 2024

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.

ThomasTrinelle avatar ThomasTrinelle commented on August 18, 2024

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)

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.