opensourceBIM / bimvie.ws

Javascript client for Building Information Modelling, using open standards like IFC, BCF and BIMSie. Using Bootstrap, BIM Surfer, etc..
GNU Affero General Public License v3.0
171 stars 87 forks source link

Can't get geometries using query #81

Open pinsonnj opened 7 years ago

pinsonnj commented 7 years ago

Hi Ruben,

When making a query using bimvie, geometries are not included. For example using

AllObjects

{
  "type": "IfcProduct",
  "includeAllSubtypes": true
}

I get using IFC XML a file containing only Ids, Names, Descriptions and Types

        <IfcBeam id="i66400">
            <GlobalId>05DBA5kGLE382Z841CkTQb</GlobalId>
            <Name>B1010--*default beam*</Name>
            <Description>0, brep_beams_opening.dgn, 3D Model:2223</Description>
            <ObjectType>B1010:*default beam*</ObjectType>
        </IfcBeam>

whereas I get Representation and ObjectPlacement while using the download button in three dropdown.

        <IfcBeam id="i66400">
            <GlobalId>05DBA5kGLE382Z841CkTQb</GlobalId>
            <OwnerHistory><IfcOwnerHistory xsi:nil="true" ref="i1770297"/></OwnerHistory>
            <Name>B1010--*default beam*</Name>
            <Description>0, brep_beams_opening.dgn, 3D Model:2223</Description>
            <ObjectType>B1010:*default beam*</ObjectType>
            <ObjectPlacement><IfcLocalPlacement xsi:nil="true" ref="i17566138892"/></ObjectPlacement>
            <Representation><IfcProductDefinitionShape xsi:nil="true" ref="i12085560172"/></Representation>
        </IfcBeam>

Is there an argument missing in my query ? I also tested others parsers and got the same result...

Thank you

rubendel commented 7 years ago

To get geometry, you have to explicitly put it in your query, like this:

{
  "type": "IfcProduct",
  "includeAllSubtypes": true,
  "includes": [
    "validifc:OwnerHistory",
    "validifc:Representation",
    "validifc:ObjectPlacement"
  ]
}

This will include all subtypes of IfcProduct. For every IfcProduct it will also include the OwnerHistory (required to make it a valid IFC file), Representation (the geometry) and the ObjectPlacement (rqeuired to get the object in the right 3D place/orientation).

Mind you, the IFC XML serialization has not been tested well lately, so expect bugs, we will however make sure it's fully working when we release 1.5.

pinsonnj commented 7 years ago

ok thanks for the input :)

Actually since the 3D view is refreshing I was expecting the same render in my output file. It's a bit confusing.

I got a correct XML this time but it apears old serializers are buggy as you said like collada one : GeometryInfo geometryInfo = ifcProductObject.getGeometry(); return null whatever parameters I set...

https://github.com/opensourceBIM/Collada/blob/master/Collada/src/org/bimserver/collada/ColladaSerializer.java#L214

rubendel commented 7 years ago

The Collada plugin is even older, we hope one day someone will adopt the project. For our projects we don't need a Collada serializer anymore, so not really an incentive there.

On the geometry, the thing is that BIMvie.ws is doing 2 separate queries for performance reasons, that's why you don't have to include it in the initial query. Basically by clicking the "Eye" icon, you alter the query that is eventually executed.