Page MenuHomePhabricator

Allow specifying the orientation of a 3D model when creating a thumbnail
Open, LowPublic

Description

The renderer for the 3D thumbnails should allow additional parameters to set the orientation, in which the model is rendered as thumbnail. (Like you can specify the page for PDF files, etc.) E.g. something like [[File:Foo.stl|thumb|alpha=30|This is rotated by 30° from the default]].

Event Timeline

dr0ptp4kt claimed this task.
dr0ptp4kt triaged this task as Low priority.
dr0ptp4kt added subscribers: MarkTraceur, dr0ptp4kt.

Providing customization on pages - setting the priority to Low for now. There are multiple technical and scaling challenges (getting the orientation done based on the file spec, updating supported parser file types for example in Parsoid, having to re-render which is computationally expensive) that make this hard. This said @MarkTraceur is looking into whether there's a simple fix for the default orientation, as the files seem to be laid out in a manner inconsistent with their presentation in other viewers (e.g., the lion had the orientation you would expect elsewhere).

Right, I think that the default orientation isn't the de facto standard seen elsewhere. Fixing that first should be a priority. Is there a task for it?

Adding a new thumb option as described here is feasible, but wouldn't solve the default orientation seen on the file page itself. That being said, it's definitely very useful in itself for static thumbnails showing different sides of the same thing.

One could reuse the "seek" or "page" thumbnail parameter currently used by video and multipage documents for this, passing it camera coordinates and direction and/or rotation of the object around the 3 axis.

That file also seems to have its geometry "inside out"; I'm seeing the backward-facing surfaces rendered, not the front faces. The file may be a little funky to begin with. :)

That file also seems to have its geometry "inside out"; I'm seeing the backward-facing surfaces rendered, not the front faces. The file may be a little funky to begin with. :)

That was hilarious, I just ruined the fun by fixing it :(

Thanks @matmarex. :) Now renders correctly, just with the unexpected initial orientation.

I would say that it is a very important issue. Asking to change the orientation of the original file is not reasonable. The thumbnail creation must be controlled by the user. See for example this file, https://commons.wikimedia.org/wiki/File:Laurana.stl

Another related issue is the zoom level. See this object as an example: https://commons.wikimedia.org/wiki/File:Dice_3D_print_model.stl

I think the problem there is the near frustum on the camera being set too close for the scale of the file, causing the closest parts of the mesh to be cut off -- had similar problems with glTF file testing, where the units used were a very different scale from most of the STL files.