ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
573 stars 170 forks source link

[Feat]: GetLocalPlacement from typescript instead of wasmModule #872

Open RyugaRyuzaki opened 1 week ago

RyugaRyuzaki commented 1 week ago

What is your idea?

I'm integrating this feature. For example, i want to move a model to objectPlacement with this info : image

From typescript, i can not get it, so is there any vase that wasmModule can export this. for typescript to use ?

beachtom commented 1 week ago

We can - but it may not do what you think - because the LocalPlace is then changed using various scalings and other things - to be the final placement.

What is it you are wanting to do?

RyugaRyuzaki commented 1 week ago

We can - but it may not do what you think - because the LocalPlace is then changed using various scalings and other things - to be the final placement.

What is it you are wanting to do?

hi @beachtom , i want to get all IfcGrid ( as i remember the library has not integrated get geometry2D yet). Now i can get all IfcGridAxis2D . but i need to move it to coordination.

#369= IFCGRID('.......',#22,'........',$,$,#180,#364,(#270,#280,#290,#300,#310,#320,#330),(#182,#200,#210,#220,#230,#240,#250,#260,#340),$);
beachtom commented 1 week ago

Hi - not that won't do it. You need to run it through all the transforms.

You would need to add it to the GeometryProcessor and then return it as a 2D mesh.

Can you list all of the IFC types that are needed? Then I can look at it... or someone else can. Whoever gets time

RyugaRyuzaki commented 1 week ago

Hi - not that won't do it. You need to run it through all the transforms.

You would need to add it to the GeometryProcessor and then return it as a 2D mesh.

Can you list all of the IFC types that are needed? Then I can look at it... or someone else can. Whoever gets time

hi @beachtom when i call api.GetLineIdWithType(modelID,WEBIFC.IFCGRID) here : image

From each i get 1(start) and 2(end) point then i can draw a line in threejs. Looks like this : image

The issue is now when i get all, but they are not match with origin coordination of IfcBuilding or IfcSite.

beachtom commented 1 week ago

Can you try multiplying it by the model wide coordination matrix

ifcApi.GetCoordinationMatrix(modelId)

does that work?

RyugaRyuzaki commented 1 week ago

Can you try multiplying it by the model wide coordination matrix

ifcApi.GetCoordinationMatrix(modelId)

does that work?

Can you try multiplying it by the model wide coordination matrix

ifcApi.GetCoordinationMatrix(modelId)

does that work?

Well, it only worked with rotation but point did't. I have a post in community. , and here is logic (worked with rotation)

beachtom commented 1 week ago

Hmm ok - I will need to look in more detail