Giter Club home page Giter Club logo

web-ifc-three's People

Contributors

agviegas avatar aka-blackboots avatar beachtom avatar d4ve-r avatar delorie avatar donmccurdy avatar eng-luciano-julien avatar harrycollin avatar jaeseokk avatar jespa007 avatar kaplas80 avatar laranhee avatar myoualid avatar quimmoya avatar sampovuori avatar tiberiog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-ifc-three's Issues

Loading ifc file impossible

Hi, I have an ifc file which can't be loaded with web-ifc-three (it's working with other viewers). I'can't share it publicly, so I sent it privately.

Capture d’écran 2021-09-30 à 10 34 28

Thanks !

Make npm repository for easier testing

I'm aware that in the future almost everyone will either use web-ifc-viewer or Three.js directly, but right now having it in npm would be convenient to test the last changes in web-ifc-viewer directly

Highlighting IfcSpace.

Hi !
Can you highlight IfcSpace? If yes, is there any way?
I got all the expressIDs of IfcSpace in the working model.

getSpatialStructure is inefficient

The current implementation of getSpatialStructure is very generic: it gets the children of the project, then the children of the site, etc. Instead of doing that, it would be better to get all the IfcRelAggregates and all the IfcRelContainedInSpatialStructure and create the spatial tree in one single iteration.

getSpatialStructure with include Properties true could return translated IFC TYPE

  getSpatialStructure(modelID: number, includeProperties?: boolean) {
        return this.properties.getSpatialStructure(modelID, includeProperties);
    }

now each object has a 'type' property that is an ID and not an IFCTYPE string. (like in the previous versions).
Screen Shot 2021-11-05 at 11 44 05

so after getting the spatial structure I still have to iterate through all elements setting the IFCTYPE using the dictionary IfcElementsMap or the function getIfcType.

Maybe when passing true on includeProperties param we could already include the translated IFCTYPE.
What do you think?

Implement web-ifc-three interface in web-ifc

In order to use web-ifc when graphical interfase is not requerid it would be useful to implement the same interface that web-ifc-three has.
Of course just an interfase subset, all fumcrions related to graphical interfase has no meaning.

Loading IfcOpening (and IfcSpace) geometry

Hi !
I'd like to select some ifcOpening elements in a 3D model.
At the moment, I can access these elements' properties thanks to the getItemProperties method.
However, I can't access there geometries, for example using the subsets related methods.

Managing openings elements is a tricky part in a construction project. That would be great if the ifc.js library could be used to manage this use case !!

Note

  • the same goes for ifcSpaces :-)

some models are not centralized.

Hello

After testing with some models, I've notest some of them load very far away from 0,0.

I wonder if there is a way to change the coordinate system to make them centralized?

For now, I will try to get world position of every object and bring all of them closer to 0

Thank you,

Antonio

Using subsets to translate/rotate/scale ifc elements meshes individually

viewer
After implementing @agviegas sugestion -" If you want to allow the user to select objects and edit them, you can create the subsets of the objects the user want to modify lazily. This means that when the user clicks on a wall, you hide the wall using the visibility functions of the API, and create a subset of only that wall. From the user's perspective, he's able to click and modify any element in the model.", I encountered some problems, 1º- I can't click in the new created subsets and 2º- I cannot have the original material.

Clean up bloated methods

Some methods are too big and unmaintainable. Extract them in smaller methods. Also, merge modelID, mapFaceindexID and mapIDFaceIndex into a single state object that represents the data of a single model.

Some child elements are missing from getSpatialStructure()

Taking a Curtain Wall as an example, it should have some glazing (Plate) as child elements.

See BIMVision screenshot:

We're not getting the child elements array from the getSpatialStructure()

Model has been uploaded in Discord :)

Code comments

Hello there! This library is opensource. Ok. Even if a well-written code does not need comments, it would be very useful for me to find comments. On the contrary, these comments seem to be very few. I would like to understand and also learn, through an example like this, the best js programming techniques. For this I ask you if it is possible to add other comments to the code in the open source spirit, aimed at everyone. Thanks for your time.

IFC export

I need to export generated Mesh from threejs to IFC file format. How i can do that?

memory access out of bound

Hello as mention in the title with the file in
Duplex Apartment.zip causes a memory out of bounds exception.
Uncaught RuntimeError: memory access out of bounds at http://localhost:5000/web-ifc.wasm:wasm-function[930]:0x4f3a4 at http://localhost:5000/web-ifc.wasm:wasm-function[931]:0x4ff87 at Object.GetLine (eval at new_ (http://localhost:5000/bundle.js:1:1), <anonymous>:9:10) at IfcAPI.GetRawLineData (http://localhost:5000/bundle.js:36157:28) at IfcAPI.GetLine (http://localhost:5000/bundle.js:36109:28) at IfcLoader.getItemProperties (http://localhost:5000/bundle.js:70365:29) at HTMLCanvasElement.selectObject (http://localhost:5000/bundle.js:72048:29) (anonymous) @ web-ifc.wasm:0x4f3a4 (anonymous) @ web-ifc.wasm:0x4ff87 GetLine @ VM354:9 GetRawLineData @ web-ifc-api.js:45366 GetLine @ web-ifc-api.js:45318 getItemProperties @ IfcLoader.js:128 selectObject @ web-ifc-scene.js:114

I am not really sure if its a problem with the usage of the web-ifc api or the api itself.

Edit.: it only happens when you try to select specific parts of the model (e.g. parts of the roof)

test of A02 - AUSTEN CCT.ifc

I downloaded to test the ifc Sam Romeo file . I tried to upload it locally. If I load it from the js folder it works. If I load it from the jsm folder, nothing is seen. What should I do to see the js console from Chrome? .... I always right click on browser page and then inspect ... but in this case the right click doesn't work

Can this be run in a vue project

ERROR Failed to compile with 1 error 9:01:25 AM

error in ./src/views/3Dengine/web-ifc-api.js

Module parse failed: Unexpected token (660:23)
File was processed with these loaders:

  var path = import.meta.url.substring(0, import.meta.url.lastIndexOf("/") + 1);

| var wasmBinaryFile = path + "web-ifc.wasm";
|

@ ./src/views/3Dengine/IFCLoader.js 8:0-42 12:17-23
@ ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.2.2@babel-loade
r/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.9.6@vue-loader
/lib??vue-loader-options!./src/views/3Dengine/IFCmodel.vue?vue&type=script&lang=js&
@ ./src/views/3Dengine/IFCmodel.vue?vue&type=script&lang=js&
@ ./src/views/3Dengine/IFCmodel.vue
@ ./src/router.js
@ ./src/main.js
@ multi ./node_modules/_webpack-dev-server@3.11.2@webpack-dev-server/client?http://192.168.0.101:1337/sockjs-node (webp
ack)/hot/dev-server.js ./src/main.js

Separate getItemProperties in native and indirect (psets)

Getting geometry properties is a heavy process, and something that users will rarely want. Separating native properties and psets will allow users to get the only the psets recursively, thus improving the performance of getting properties.

indexed buffer geometry

Hi there,

I saw you made the viewer more optimized by merging the model into a single geometry. really nice!

I have a problem now, I wonder how to enable/disable single parts of the model with this approach.

I saw its possible if the buffer geometry is indexed and then you can pass a drawRange to the it, so it draws only what you want.

Do any of you maybe have a direction I could pursue, or maybe its not possible? I should go back to working with simple geometries if I want to manipulate the model?

Thank you,

Antonio

Extract IFC Loader logic in multiple files

The IfcLoader file is getting too big. Extracting it into smaller, more maintainable files is necessary. This also requires configuring rollup to bundle the final file.

Some 3D objects are not highlighted

Some 3D objects of ifc products are not highlighted when selecting them. This may be a problem when constructing the bufferGeometry (these vertices might not be sorted correctly).
image

IFCGRID in IfcElements

I tried to get the info of model item using getSpacialStructure. But it returns following error.

IFCModel.ts:54 Uncaught TypeError: Cannot read property 'toString' of undefined
at PropertyManager.newNode (IFCModel.ts:54)
at IFCModel.ts:35
at Array.map ()
at PropertyManager.getChildren (IFCModel.ts:17)
at PropertyManager.getSpatialNode (TypeManager.ts:31)
at IFCModel.ts:36
at Array.map ()
at PropertyManager.getChildren (IFCModel.ts:17)
at PropertyManager.getSpatialNode (TypeManager.ts:31)
at IFCModel.ts:36
at Array.map ()
at PropertyManager.getChildren (IFCModel.ts:17)
at PropertyManager.getSpatialNode (TypeManager.ts:31)
at IFCModel.ts:36
at Array.map ()
at PropertyManager.getChildren (IFCModel.ts:17)
at PropertyManager.getSpatialNode (TypeManager.ts:31)
at PropertyManager.getSpatialStructure (PropertyManager.ts:123)
at IFCManager.getSpatialStructure (IFCManager.ts:107)
at IfcManager.getSpatialStructure (ifc-manager.ts:84)

It is because of missing IfcGrid. IfcGrid is related element to IfcRelContainedInSpatialStructure.
image
But it is not in IfcElements.
I suggest, IFCGRID will be added into IfcElements like following image.
image

Substituition for setModelDisplay()

Hi,
Great project!
I am looking for guidance about the change in the library of the functions setModelDisplay() which was deleted.
I was using setModelDisplay to configure transparency of the whole model and setItemsDisplay to color some elements to highlight.
Its seems the function createSubset() substitutes setItemsDisplay(), is there a way to setModelDisplay() or is it planned to implement similar function?

Thanks in advance

Keep instantiated classes intact when using web workers

I've noticed that when using methods such as IfcManager.getPropertySets(modelID, expressID, true), the returned value is serialized and thus the instances of IfcPropertySet, IfcPropertySingleValue and so on ... are lost.

It would be a game changer to keep the data correctly instantiated (when using web workers) and to keep the typing intact. Currently the return type of IfcManager.getPropertySets() is Promise<any[]> but it could maybe then be Promise<IfcPropertySet[]>.

getSpatialStructure error

Adding this code to https://github.com/IFCjs/examples/blob/main/simple-react/src/App.js#L43

this.viewer.ifcManager.loader.getSpatialStructure()

(here for ref: pablo-mayrgundter/examples@da6eff8)

Causes this error and no useable IFC elements.

TypeError: Cannot convert "undefined" to unsigned int
    at Object.toWireType (web-ifc-api.js:3985)
    at Object.GetLineIDsWithType (eval at new_ (web-ifc-api.js:3734), <anonymous>:7:26)
    at IfcAPI.GetLineIDsWithType (web-ifc-api.js:45377)
    at PropertyManager.getChunks (TypeManager.ts:19)
    at PropertyManager.getSpatialTreeChunks (TypeManager.ts:13)
    at PropertyManager.getSpatialStructure (PropertyManager.ts:117)
    at IFCManager.getSpatialStructure (IFCLoader.ts:206)
    at IFCLoader.getSpatialStructure (IFCLoader.ts:61)
    at App.onDrop (App.js:45)

Also tried with web-ifc-viewer 1.0.20, same result.

Compilation errors

hello everyone, I am starting contributing to the library
I just got lot of TS issues when compiling it and errors with rollup imports.
this after running npm install on both dirs and npm run build on the root.
Do we have a stable branch to start with?
Can I contribute fixing the TS errors ?

Info:
Node.js v15.12.0
MacOS

Running IFC.js in a Java WebEngine browser

I have been trying to run IFC.js in a Java WebEngine browser. I have compressed the IFC.js demo folder into a WAR file and successfully started up a Jetty local sever and IFC.js runs happily on localhost:8080 in a regular browser. In the Java browser the index page displays and I can select a model but no model or 3D space appears. Do any of you have any ideas on what additional HTML or browser settings are used in a regular browser to make this work, that may not be set in my Java WebEngine browser?
I have run out of things to try. The Java WebEngine is clearly not running the JavaScript in the referenced bundle.js, even though WebEngine should happily run JavaScript in the HTML page.

sample_Java.txt

My username on Discord is SilentBob.

Tutorial update request

Hello!

As I asked before in the discord, I hope you can update the documentation with tutorials on how to extract geometric information (e.g. position, width, length and height) and semantic information (e.g. material and storey).

I would be very grateful for this!

Path to web-ifc.wasm file

To implement a Vue.js component that loads IFC files the path to web-ifc.wasm has to be specified with setWasmPath(./foo/bar/).
The problem is that this method prefixes the specified path and doesn't accept an absolute path or a URL.
Would it be possible to provide more functions to set the wasm path?

In my case, if I set the path to the web-ifc.wasm file with ifcLoader.ifcManager.setWasmPath("./") my web app will perform a GET request to https://localhost:9200/home/vasco/Desktop/cernbox/web/node_modules/web-ifc/web-ifc.wasm, which results in a 404.
Since I have the web-ifc.wasm in the root of my build directory, I have to set the path to the web-ifc.wasm with ifcLoader.ifcManager.setWasmPath("../../../../../../../"). This way the web app performs a GET request to https://localhost:9200/web-ifc.wasm and everything works fine.
The problem here is that for different deployment environments the relative path will be different.
A method to set the wasm path with a URL or an absolute path would solve this problem.

Problem when rendering IfcBuildingElementProxy which are rectangle extruded shapes

Note

Initially ThatOpen/engine_web-ifc#69

Context

In this construction project, one company (company A) is managing all the openings changes from one Revit digital mockup. Every time a change occurs, the company A shares one IFC files with all the up-to-date openings. Consulting companies, like structural engineering consultants, need to update the execution blueprints from this IFC.

Problem

When using the web-ifc-three lib to render the openings in 3D, the opening shapes do not appear to be regular rectangles. However, this is the case with the BIMcollab software.

element

The openings are mainly extruded shapes.

openings

Notes

Problem in one dimension

Using the orthographic camera in the Y and X direction, it appears that the "weird" shapes pb is limited to the view from above. It is like the extrusion did not work correctly.

orthographic

Files

openings.ifc.zip

Note

The model is globally translated far away from the origin... To be sure to view it with Three.js, the camera should target the center of its bounding box.

Position and quaternion of IFC model do not reflect matrix values

Hi!

And thank you for this awesome library.

I just have an issue when loading a model. When I traverse the children Meshes, the position and the quaternion are always all zeros, even though the position and the rotation of the object is not zero in the Matrix of the Mesh. Is it intended ? If yes, can you explain me why ? If not, I guess a fix is just doing the following before returning the loaded model in load:

loadedModel.traverse((child) => {
  child.matrix.decompose(child.position, child.quaternion, child.scale);
});

I cannot upload the model I tested with (the .ifc file format is not supported), but you can download it here.

Also, it looks like the world transform of the children Meshes is already baked in the geometry of the corresponding child Mesh, right ? Actually I was wrong, it doesn't. Apparently the issue was coming from three.js not perfect support of the interleaved buffer attribute you use for your geometries.

Does not load IFC models while using OCULUS QUEST 2

Describe the bug

Does not load IFC models while using OCULUS QUEST 2 (I could try only with this device)

To Reproduce
Run the threejs example of ifc loader from OCULUS QUEST 2.
S

Screenshots

If applicable, add screenshots to help explain your problem (drag and drop the image).

Platform:

  • Device: OCULUS QUEST 2
  • Three.js version: current

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.