xBimTeam / XbimEssentials

A .NET library to work with data in the IFC format. This is the core component of the Xbim Toolkit
https://xbimteam.github.io/
Other
486 stars 172 forks source link

Can I change the units of a project? #445

Closed ido-cu closed 1 year ago

ido-cu commented 1 year ago

Hi, I'd like to change the units of my IFC project, in a way that will also affect the coordinates, lengths and volumes of my elements. For example: I have a wall that is located at (100, 100, 100) and my project is in meters.

I'd like to change the units to millimeters and have my wall located at (100,000, 100,000, 100,000).

Is it possible? Is there an easy way to do it?

andyward commented 1 year ago

Yes, you can see how in this issue: https://github.com/xBimTeam/XbimEssentials/issues/379#issuecomment-824619982

ido-cu commented 1 year ago

ok, does that answer say that it's enough to change the unit of project.UnitsInContext to make my wall located at (100,000, 100,000, 100,000) or do I need to manually change the values of each point in the geometry of the elements?

andyward commented 1 year ago

No you'd need to refactor the quantities across the model. With complex parametric geometry this could get "gnarly".

Make sure you understand why you're doing this. For 3D accuracy purposes Meters might actually be a better unit than mm at world scale. These are floating point numbers so precision can can be un-intuitive.

If you just wanted to present measurements in a different unit for the user, I'd probably convert it further up the stack.

ido-cu commented 1 year ago

ok, thanks!