TPA KKS GmbH is an internationally recognized and globally active company in the fields of pressure equipment, non-destructive testing, liquid gas, cathodic corrosion protection and occupational safety. It is a 100% subsidiary of the TÜV AUSTRIA Group.
TPA KKS GmbH contacted us with a request to develop a prototype for an STL-to-STP converter. This resulted in the AlpConvert project, which was implemented in collaboration with Daniel Waschmann. The difficulty of the task is that the volume information is not retained when exporting from the proprietary CT scanner software. As a result, conventional (online) converters and renowned providers of 3D editing software (such as Autodesk, Blender or FreeCAD) encounter problems.
The experience gained in the field of 3D computer graphics, e.g. through hobby projects such as Gameengine or the 3D Scanner APP, played a decisive role in the further development.
The initial plan was clearly structured: The task was to load an STL file, form a three-dimensional model from it and save it in a suitable format. After a phase of intensive creative work, a detailed plan was developed that closely followed the original idea. In the course of the project, some important steps were added as a result of the knowledge gained.
![simplerPlan](https://images.ctfassets.net/svc6ykuhyo5y/WnmtlKViZWuRaVYOthp7T/b0a3cda0779ef1349830e99a1e1357da/simplerPlan.png?w=1694&h=529&q=50&fm=png)
The two main aspects concern the (re)construction of surfaces from a grid. A process known as Poisson surface reconstruction is used for this purpose. This makes it possible to calculate a 3D model from the existing points.
![poisson Surface Reconstruction](https://images.ctfassets.net/svc6ykuhyo5y/3Ymd8GzXcRrbm6899ob6q/e6f6d331611407214cffddc5a9462258/poisson_Surface_Reconstruction.png?w=615&h=313&q=50&fm=png)
After restoring the volume information, it quickly became clear that the ISO standard 10303-21 is very comprehensive and that numerous different storage schemes exist. The focus was on schema 242, as it is used in the automotive and aviation industries and therefore corresponds most closely to the use case under discussion. However, the text volumes were quite complex and comprehensive, which is why an explorative approach was chosen to examine the file format with test objects.
The first step was to analyze a simple rectangle in STL format.
![Viereck-model](https://images.ctfassets.net/svc6ykuhyo5y/4Ak3iuk5ZUGltLbJraingo/5c575b5e0c6d2f8cdb0b5950fc6c3b0c/Viereck.stp.png?w=1174&h=339&q=50&fm=png)
The STL format is a text-based file format and stores geometric information structured in plain text.
![STL-Code](https://images.ctfassets.net/svc6ykuhyo5y/5SUx9xtI6dQMl7ktwWG217/f1604041e5efacc5e553965d8a498adc/STL-code.png?w=585&h=630&q=50&fm=png)
This information was compared with the same object in STP format. Test and comparison files of HOOPS software were provided. HOOPS acts as the '3D engine' behind applications from Hexagon®, Trimble®, Ansys®, SOLIDWORKS™, Autodesk® and many more. The test files created by HOOPS in STP format were used to reverse engineer the AP242 schematic. Due to the high cost of the software, it was decided not to use it directly, which saved the customer considerable license fees.
![STP-code](https://images.ctfassets.net/svc6ykuhyo5y/64GIU2CsJu8vYPNOeopEWU/90b9a8f65461f0e377301b6f26899a9d/STP-code.png?w=1252&h=931&q=50&fm=png)
The conversion of simple objects from STP to STL enabled a pragmatic analysis of the file format.
![Viereck mit Dreiecken](https://images.ctfassets.net/svc6ykuhyo5y/60gYOth1Q1CBbl2rD682jU/a837d84efdeb7e0e0fc6180a76040954/Viereck_mit_Dreiecken.png?w=1418&h=409&q=50&fm=png)
In the formats mentioned, 3D objects consist of small triangles that are lined up and joined together to form a 3D object.
![Viereck transformation](https://images.ctfassets.net/svc6ykuhyo5y/LbBB0kYWMPGZ6KvqFlh1D/7512d2775a7ab48cad155a8c537ab661/Viereck_transformation.png?w=1417&h=407&q=50&fm=png)
The triangles were deleted, added, moved or changed, and each change was analyzed in the STP reference file. From the resulting changes, it was possible to deduce how the file format works. This made it possible to develop a solution that saves the customer time and money.
In addition to the logic, a simple interface was also developed to simplify working with AlpConvert:
![AlpConvert GUI](https://images.ctfassets.net/svc6ykuhyo5y/13zmjVg6JkeOTNiOTT0bAj/424354f017c049dc98cd56df2b41f463/AlpConvertGUI.png?w=1726&h=840&q=50&fm=png)
External open source components used in the application:
Many thanks to Daniel Waschmann for his extraordinary and committed cooperation!