3 Replies Latest reply on Mar 22, 2017 3:55 AM by Ivan Dagès

    Scale problem when exporting parts to STL

    Ivan Dagès

      I am writing an addin to export assemblies in a custom XML-based format, containing the hierarchy of the assembly (subassemblies and parts), and the geometries of the parts as STL files. The XML file contains for each of the assembly's component :

      • its transform (rotation , translation, scale)
      • its mates
      • its material

      However when I import this into a JavaFX application, some components seem to be at the wrong place. This can be solved by changing the scale of the misplaced components to -1, knowing that the exported scale is always 1.

      Do I miss something ? Is there any other information that I do not take into account ?

        • Re: Scale problem when exporting parts to STL
          Amen Allah Jlili

          it may be that the model view transform is what's affecting your code.

          • Re: Scale problem when exporting parts to STL
            Jim Moses

            Hi,

             

            I was having a similar issue converting a robot cell for our simulation guys, every time it would move the origins and scale it to either inches or metric depending on what the component was originally created.

             

            From what I can tell and what I was told by a few of the older simulation guys is STL does not store or relate the file to things present in the assembly you are working.  So for us we saved it as a Parasolid and they then used a third party software that converted it to a format their simulation software could deal with.

             

            Doubt this helps, but hope it helps you figure out your options, I have yet to find a good use for a STL file as far as mechanical design you really can't use them for much other than show and tell. and even then you can't take measurements off of them from what I have found.

             

            Regards,

            • Re: Scale problem when exporting parts to STL
              Ivan Dagès

              I managed to get this working. In the end the components were misplaced because JavaFX and SolidWorks seem to use different coordinate systems (the y and z axes are inverted). When I apply a scale of (1, -1, -1) for each component before applying any other transform, everything is at the right place.