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, 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.
- 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.
- 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, 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.