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
619 stars 191 forks source link

REAL numbers written by ExportFileAsIFC() are in an invalid format #214

Closed brunopostle closed 1 year ago

brunopostle commented 2 years ago

Files created using ExportFileAsIFC() have invalid real numbers, validation of a file generated by the hello-world/examples/web-ifc-three/editing/ tool gives lots of errors like this:

$ python -m ifcopenshell.validate ~/Downloads/modified.ifc
For instance:
    #6=IfcCartesianPoint((0,0,0))
                         ^^^^^^^ 
With attribute:
    <type IfcLengthMeasure: <real>>
Value:
    0
Not valid

Here is how IfcOpenShell writes reals

Basically, whole number real numbers need to be written with a trailing '.', like so:

#6=IfcCartesianPoint((0.,0.,0.));

..and exponents need to be written with a 'E' not 'e', i.e. this:

#13=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.000000000000001e-05,#12,$);

should be:

#13=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.000000000000001E-05,#12,$);
brunopostle commented 2 years ago

Another error in the exported file, the FILE_NAME header should have 7 attributes not 5, i.e this is invalid:

FILE_NAME('no name', '', (''), (''), 'web-ifc-export');

See diagnosis in IfcOpenShell/IfcOpenShell#2358

aka-blackboots commented 2 years ago

::take

agviegas commented 2 years ago

🟒🟒🟒

::take

Hi, @aka-blackboots! Thanks for taking this bounty! The due date is November 1, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

aka-blackboots commented 2 years ago

::drop

agviegas commented 2 years ago

🟒🟒🟒

::drop

Hi, @aka-blackboots! Thanks for giving it a try! It’s now once again available for anyone to take.

Mivit commented 2 years ago

::take

agviegas commented 2 years ago

🟒🟒🟒

::take

Hi, @Mivit! Thanks for taking this bounty! The due date is November 17, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

agviegas commented 1 year ago

::done

agviegas commented 1 year ago

🟒🟒🟒

::done

Hi, @Mivit! Thanks for your contributions! Please submit an expense to IFC.js Open Collective. Then, tell us the invoice number via the ::expense::_____ command (replace the _____ with the invoice number).

Mivit commented 1 year ago

::expense::105043

agviegas commented 1 year ago

🟒🟒🟒

::expense::105043

Hi, @Mivit! Thanks for the confirmation! We’ll proceed to review the expense. Once it’s approved, the payment will be scheduled.

agviegas commented 1 year ago

🟒🟒🟒

Hi, @Mivit! Your expense has been approved!

agviegas commented 1 year ago

🟒🟒🟒

Hi, @Mivit! Your expense has been approved!

beachtom commented 1 year ago

This is now fixed