Open an .obj or .ply file
A .obj or .ply file in the code browser opens in the 3D viewer, the same one an .stl uses. Beside the view the
facts list Vertices, Faces, (for an .obj) Groups, Triangles and the Box (its size in the file's own units, shown as mm).
The first paint carries them: the server reads the file (up to 2 MB) and renders the rows, so they show with
JavaScript off. For a larger file the viewer fills them in once it has fetched and read it.
- Vertices are the points the file lists; Faces are the polygons, before they are cut into triangles.
- Groups are the distinct named objects and groups (
o,glines) in an OBJ; a repeated or empty name counts once or not at all. - Dropped faces: a face that names a vertex the file does not have is left out and counted, as
6 (1 face dropped). - Over the cap: a part of more than 5,000,000 triangles is counted but not drawn. The facts stay, and the view says "This part has more triangles than can be drawn here; download it to open it elsewhere." with a Download button.
- Not readable: a truncated file, a big-endian PLY, or a header that claims more than the bytes hold is refused with a plain note and Download; nothing is partly drawn. Reading never spends time on a claimed count, only on bytes.
- OBJ falls back to source: an OBJ over 20 MB, or one that is not readable (a vertex that is not three numbers, bytes that are not text), is shown as source with one sentence,
and the viewer says the same sentence for a large file it fetched itself (
OBJ_TOO_BIG,OBJ_BROKENinsrc/web/render/obj.ts). - PLY: ASCII and binary little-endian; only
vertex(x, y, z) andface(vertex_indices) are read.
The terminal (both doors): the workspace screen's file view shows the same file as
3D model · OBJ over 12 triangles · 1 × 1 × 1 mm · 8 vertices · 6 faces · 2 groups (groups only when an OBJ names some), and not a readable PLY file for one it cannot read.
The facts come from the same parsers as the page (src/web/render/model-facts.ts).
Try it: commit part.obj or part.ply to a repository and open it under Code.
Pinned by test/render-obj-ply.test.ts and test/render-obj.test.ts.
Collada (.dae)
A .dae file opens in the same viewer. Every <mesh>'s <triangles>, <polylist> and <polygons> are read as one mesh,
with the same Vertices, Faces, Triangles and Box rows beside it (<unit meter> is applied; the box is shown as mm).
A file over 20 MB, one without a <COLLADA> root, or one with no triangles is shown as source with one sentence
(DAE_TOO_BIG, DAE_BROKEN in src/web/render/collada.ts); it never errors the page. Not read: scene-graph transforms,
materials, lines, and the up axis.
Pinned by test/render-collada.test.ts.