DE EN
tools

Converting STEP AP242 to GLB – 3D models for web pages

Converting STEP AP242 to GLB – 3D models for web pages
Tool
Download the STEP to GLB converter
Download ↓

The STEP to GLB converter turns a STEP file in schema AP242 into a GLB file. Assembly structure, part names and the colour of every individual part are preserved.

The result is a single binary file that any browser can display. A part can then be rotated and zoomed on a web page without the viewer having to install anything.

What AP242 carries

STEP under ISO 10303 defines several application protocols. AP242 is the one that suits this purpose, because it holds more than surfaces:

  • the complete assembly tree with its nesting
  • the names of all parts and subassemblies
  • the colour of each part, in some cases each face
  • the unit of measurement, properly declared

A look inside the file makes this plain. For a two-part rod end, it reads:

FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'));
COLOUR_RGB('', 1.0, 0.278431386, 0.247058824);
COLOUR_RGB('', 0.600000024, 0.600000024, 0.600000024);

Red and grey, written out as numbers. The information is there. It simply has to survive the trip.

Why GLB is the target format

For the web, glTF has become the standard, in its binary form GLB. The reasons are practical.

A single file holds geometry, materials and scene tree together. Nothing can be lost on upload or point nowhere after a rename. Every mesh carries its own material, and the tree from AP242 survives as nested nodes. Every browser renders it without additional software.

Then there is size. Binary rather than text makes a real difference: a rod end whose STEP file measures 42.7 KB becomes a 136 KB GLB, with colours, at medium tessellation.

The export

In the STEP export dialog, select schema AP242.

Before that, it pays to check the facet resolution, in Alibre Design under File → Properties → Display. This value leaves the STEP geometry untouched, which stays exact. It governs how finely that geometry is later broken into triangles, and therefore the size of the web model.

Tessellation and file size

The relationship is direct. Measured on an assembly of 299 parts whose STEP file comes to 9.5 MB:

SettingTrianglesGLB
Coarse272,9037.77 MB
Medium461,24812.13 MB
Fine1,008,12224.13 MB

A factor of three between coarse and fine. For a model embedded in a web page, even the coarse setting is generous at this assembly size. Publishing a complete assembly at fine resolution forces every visitor to download 24 megabytes.

For a single part the question is far more relaxed. The two-part rod end comes to 265 KB even at fine tessellation.

Embedding the GLB on a web page

Two things are needed for a browser to show the model: the server has to serve the GLB file, and a library has to render it. Here is what the result looks like, running inside this article:

The same GLB file, 265 KB, embedded with model-viewer Open in its own window ↗

Check the server first. Some hosts block unfamiliar file extensions. Opening the uploaded GLB's address in a browser is enough to tell: if it downloads rather than showing an error page, you are fine. A 403 or 404 means the extension has to be enabled by the host.

The simplest way to embed is Google's model-viewer web component, Apache-2.0 licence:

<script type="module" src="/path/to/model-viewer.min.js"></script>

<model-viewer src="/path/to/model.glb"
              alt="Rod end with ball joint"
              camera-controls
              auto-rotate
              style="width:100%;height:480px">
</model-viewer>

Host model-viewer.min.js on your own server rather than loading it from someone else's CDN. Otherwise every page view sends the visitor's IP address to a third party, which in Europe requires a legal basis. The file comes from the npm package @google/model-viewer; only dist/model-viewer.min.js is needed, around 1 MB.

One note on that bundle: it carries three hard-coded decoder addresses that are fetched for compressed models. As long as the GLB comes from this converter, none of them is requested. To be certain, set this before the script tag:

<script>
  window.ModelViewerElement = {
    dracoDecoderLocation: '/path/to/draco/',
    ktx2TranscoderLocation: '/path/to/ktx2/',
  };
</script>

In WordPress this cannot go into an ordinary paragraph, because the editor strips script. Three routes work: a plugin for glTF files, a custom HTML block combined with a plugin that permits scripts, or placing the model page as a separate static file and pulling it in with an iframe. The third is the most robust, because it does not depend on the editor.

The example page shows the full embedding source, ready to copy.

What does not survive

AP242 can carry PMI: tolerance data, dimensions, and geometric dimensioning and tolerancing applied directly to the model. glTF has no field for any of it. This information is lost in the conversion.

That is a property of the target format, not a shortcoming of the converter. glTF describes how something looks on a screen, not how it is manufactured. Anyone who needs PMI to travel with the model should stay with STEP.

Second point: parts with no colour assigned come out in a neutral grey. In the assembly mentioned above this affected more than half the parts, which only became apparent on inspecting the finished GLB file.

The converter

The tool runs entirely in the browser. A single HTML file: download it, double-click it, done.

The conversion happens on your own machine. Nothing is uploaded and no connection to the internet is opened. If you prefer, disconnect the network before opening the file and it will work exactly the same. For design data that must not leave the building, that is the point that matters.

Three steps to operate it: choose the STEP file, set the accuracy, convert. The preview shows the result with colours and assembly tree before anything is saved. In the parts list, clicking a name hides that part, clicking a swatch changes its colour, so a model exported without colours does not have to go back to CAD. You can then save either the GLB file on its own or a ready-made viewer to send to someone. The interface is available in German and English.

The converter with preview, key figures and the parts list with colour swatches

The limits belong in the picture too. Conversion takes time: the 299-part assembly above ran between 12 and 19 seconds depending on the setting, and the interface is sluggish while it does. Very large assemblies can exhaust the browser's memory. The tool is built for individual parts and mid-sized assemblies.

Sending the model to someone

Besides the GLB file, the converter can produce a ready-made viewer. One click on "Save viewer" packs three things into a ZIP: an HTML file with the model embedded, the GLB itself, and a short readme.

The recipient unzips and double-clicks. The browser opens with the model, rotatable, with a parts list and dimensions. Nothing is installed, nothing is fetched from the internet, and no network connection is needed.

One point that matters when sending to third parties: a GLB holds only the tessellated surface, that is triangles. The exact geometry with faces, edges and design intent stays behind in the STEP file. Whoever receives a GLB can look at the part and turn it, but cannot readily carry on with it as an editable CAD model. For quotes, design reviews and previews that makes it the more suitable format to hand out.

For the rod end used in this article the ZIP comes to 540 KB. That passes through any mail server accepting attachments of that size. As a plain HTML file it would be 1.1 MB, and many mail servers reject HTML attachments outright.

To see it without converting anything yourself: gabelkopf-viewer.zip (540 KB). That is exactly what arrives at the other end.

Licences

Open CASCADE Technology reads the STEP file, integrated through occt-import-js, both under LGPL-2.1. three.js handles the preview and the output, under the MIT licence.

The full licence texts are inside the tool itself, with the source code linked from there. No tracking, no fonts from third-party servers, no external addresses.

Changes

1.1 – 14 August 2026 Viewer for sending, packed as a ZIP. Parts can be hidden in the preview. Colours can be changed afterwards and reset to the values from the STEP file.

1.0 – 13 August 2026 First release: STEP AP242 to GLB, four accuracy settings, preview with assembly tree.

← Back to overview