扩展:3D
3D 发布状态: 测试 |
|
---|---|
![]() |
|
实现 | 媒体 |
描述 | 為3D(立體)檔案格式提供支援。 |
作者 | |
最新版本 | 0.0.1 |
MediaWiki | 1.31.0+ |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下载 | |
翻译3D扩展如果在translatewiki.net可用 | |
检查使用和版本矩阵。 | |
Vagrant角色 | three_d |
问题 | 开放的工作 · 报告错误 |
The 3D extension gives the user of a wiki support for uploading and viewing 3D models. See Help:Extension:3d for usage documentation.
目前它支持STL文件格式,这在3D打印字段中最常见。
安装
1. Allow 3D file uploads
Tell MediaWiki that it can handle STL uploads. Add this to your LocalSettings.php
$wgTrustedMediaFormats[] = 'application/sla';
$wgFileExtensions[] = 'stl';
2. Install Extension:3D
- 下载文件,并将其放置在您
extensions/
文件夹中的3D
目录内。
- 将下列代码放置在您的LocalSettings.php的底部:
wfLoadExtension( '3D' );
- 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。
3. Install 3d2png
3d2png is the thumbnail renderer for 3D files. It will render png thumbnails exactly like this extension will display the objects, using the same JS libraries running in Node.js instead of the browser.
To install, clone and install the 3d2png repository:
git clone https://gerrit.wikimedia.org/r/3d2png
cd 3d2png
npm install
On Linux, 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
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';
Configuration
Patent agreement
Special:Upload
To add patent agreement selection options to Special:Upload, edit your wiki's MediaWiki:3d-patents
page.
Every line on that page will be turned into an <option>, where everything after the last |
character is the text, and everything before is the template that will be added to the upload content.
Check out commons:MediaWiki:3d-patents for an example.
Make sure to create the template(s) that will be added to the content. I.e. Template:3dpatent
Special:UploadWizard
Special:UploadWizard also supports patent agreement, though slightly less flexible. When uploading a third party STL file, a dialog will be displayed to confirm your upload does not infringe any patents. When uploading one of your own, it'll also ask to confirm the 3d objects depicted are your own work. The template added to the upload content will be Template:3dpatent or Template:3dpatent respectively.
To change the phrasing of these messages, these pages can be altered: MediaWiki:Mwe-upwiz-patent-dialog-text-warranty
& MediaWiki:Mwe-upwiz-patent-dialog-text-license
.
To change which file types require patent agreement, which template is added to the upload content or where the urls point to, change LocalSettings.php
. Below are the default settings:
$wgUploadWizardConfig['patents'] = [
'extensions' => [ 'stl' ],
'template' => '3dpatent',
'url' => [
'legalcode' => '//wikimediafoundation.org/wiki/Wikimedia_3D_file_patent_license',
'warranty' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
'license' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
'weapons' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing#Weapons',
],
];
Extension:CommonsMetadata
Lastly, Extension:CommonsMetadata provides a way to track 3D uploads without said patent license, though it is not configurable at all.
It will just check for uploads with a application/sla
mime type (currently the only ones supported by Extension:3D) that lack the 3dpatent
template. Matching files lacking this template in their content will automatically be added to to Category:Files_with_no_machine-readable_patent
.
If you use any other template than 3dpatent
, this will not be useful for you, as this is not currently configurable.
此扩展被用于一个或多个维基媒体项目上。 这可能意味着扩展稳定且工作良好,足以用在同等高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中寻找此扩展名称以查看安装它的网站。 详细的已安装扩展的完整列表可在wiki的Special:Version页面找到。 |