VRML from FreeCAD is not loaded by three.js. Anyone know why?

I was hoping to use three.js to provide a preview feature on a web site that provides a library of free 3D ECAD models.

Our ECAD models are in FreeCAD, from where I can export VRML and in three.js there is an interesting sounding
three.js/examples/js/loaders/VRMLLoader.js
which I can get to show the house demo file, but nothing exported out of FreeCAD.

I created a small test case thats just a single cube (VRML Cube test case)

The loader issues the same warnings on the cube as with the house demo file, but with the cube just shows an empty scene.
Cube Scene

Any suggestions as to whats going on here gratefully received.

I had quick look into this and it seems that some line breaks in your file are problematic. After cleaning up it seems to work. Compare the following with your original file and you will see the differences.

#VRML V2.0 utf8
WorldInfo {
  title "Exported triangle mesh to VRML97"
  info ["Created by FreeCAD"
        "<http://www.freecadweb.org>"]
}

Transform {
  scale 1 1 1
  rotation 0 0 1 0
  scaleOrientation 0 0 1 0
  center 0.000 0.000 0.000
  translation 0.000 0.000 0.000
  children
    Shape {
      appearance Appearance {
        material Material {
          diffuseColor 0.8 0.8 0.8
        }
      }
      geometry IndexedFaceSet {
        coord Coordinate {
          point [
            0.000 10.000 10.000,
            0.000 10.000 0.000,
            0.000 0.000 10.000,
            0.000 0.000 0.000,
            10.000 0.000 10.000,
            10.000 10.000 0.000,
            10.000 10.000 10.000,
            10.000 0.000 0.000
          ]
        }
        coordIndex [
          0, 1, 2, -1,
          1, 3, 2, -1,
          4, 5, 6, -1,
          4, 7, 5, -1,
          3, 7, 4, -1,
          2, 3, 4, -1,
          6, 5, 1, -1,
          6, 1, 0, -1,
          3, 1, 5, -1,
          7, 3, 5, -1,
          6, 0, 2, -1,
          6, 2, 4, -1
        ]
      }
    }
}

Can you please check if the exported file of your tool is actually valid according to the VRML standard? Besides, even if i load the updated version of the file, the winding order of the triangles does not look correct.

Um, it’s obviously a problem of VRMLLoader. I was able to import your file in sketchfab with no visual errors. Do you mind creating an issue at github for this? :innocent:

Thanks for looking at this. I have logged it on GitHub as you suggest.