From MediaWiki.org
Jump to: navigation, search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
български • ‎čeština • ‎English • ‎español • ‎français • ‎日本語 • ‎português do Brasil • ‎русский • ‎中文
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status beta

3d extension screenshot.png
ImplementationTemplate:Extension#type Media
DescriptionTemplate:Extension#description Provides support for 3D file formats.
Author(s)Template:Extension#username Gilles Dubuc, Matthias Mullie, Mark Holmquist
Latest versionTemplate:Extension#version 0.0.1
MediaWikiTemplate:Extension#mediawiki 1.31.0+
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Hooks usedTemplate:Extension#hook

Translate the 3D extension if it is available at translatewiki.net

Check usage and version matrix.
Vagrant roleMediaWiki-Vagrant#Using roles three_d


Open tasks · Report a bug

The 3D extension gives the user of a wiki support for uploading and viewing 3D models. See [[<tvar|help>Special:MyLanguage/Help:Extension:3d</>|Help:Extension:3d]] for usage documentation.

It currently supports the STL file format, which is common in the 3D printing field.


1. Allow 3D file uploads[edit]

Tell MediaWiki that it can handle STL uploads. Add this to your LocalSettings.php

$wgTrustedMediaFormats[] = 'application/sla';
$wgFileExtensions[] = 'stl';

2. Install Extension:3D[edit]

  • Download and place the file(s) in a directory called 3D in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( '3D' );
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

3. Install 3d2png[edit]

3d2png is the thumbnail renderer for 3D files. It will render png thumbnails exactly like this extension will display the objects. To install, clone and install the 3d2png repository:

git clone ssh://gerrit.wikimedia.org:29418/3d2png
cd 3d2png
npm install

You'll also need to install a virtual framebuffer in order for 3d2png to be able to headlessly capture the 3D object.

apt-get install xvfb

After having successfully installed 3d2png, we'll need to tell Extension:3D how to call this thumbnail generator service. Add this to your LocalSettings.php, and make sure to update the paths to match your configuration:

$wg3dProcessor = [ '/usr/bin/xvfb-run', '-a', '-s', '-ac -screen 0 1280x1024x24' ,'/path-to-your-repository/3d2png.js' ];

4. Install Extension:MultimediaViewer[edit]

MultimediaViewer is not a hard dependency of the 3D extension, but you will need to install it if you want to interact (move, pan, zoom) with the 3D models. After installing MultimediaViewer, you will need to associate the STL file type with the correct viewer extension, by adding this to your LocalSettings.php file:

$wgMediaViewerExtensions['stl'] = 'mmv.3d';