IfcOpenShell / IfcOpenShell

Open source IFC library and geometry engine
GNU Lesser General Public License v3.0
1.88k stars 735 forks source link

Support rounding in spatial decomposition elevation field #5461

Open manuvarkey opened 2 months ago

manuvarkey commented 2 months ago

image

Decimal values entered in elevation field are not rounded and displays large number of decimal places.

manuvarkey commented 2 months ago

@Moult (as per discussion on matrix)

Is this the way to address this ? or what is the best approach ?

https://github.com/IfcOpenShell/IfcOpenShell/commit/2fdf97477c230db308e15c5fdb31a9952ed9ebb5

Moult commented 2 months ago

I don't think this is the right approach. I think we should implement a new function in util.unit perhaps which rounds to the precision value already defined in the IFC - of which the purpose is to show the precision of this type of length value (I think, ping @aothms )

manuvarkey commented 2 months ago

@Moult Where is precision defined in IFC ?

Moult commented 2 months ago

In the Precision attribute of IfcGeometricRepresentationContext - it'll be the Model context since it's a 3D coordinate.

theoryshaw commented 2 months ago

What if you have 5 different people working on the same IFC file and they want to change the tolerance of this read out in the ui?

Moult commented 1 month ago

Yes, we need both, but we need precision first, and then user-configurable "display" later on.

manuvarkey commented 1 month ago

@Moult Is the following implementation ok ?

https://github.com/IfcOpenShell/IfcOpenShell/pull/5532