Extension:3D

This page is a translated version of the page Extension:3D and the translation is 65% complete.
Outdated translations are marked like this.
MediaWiki 拡張機能マニュアル
3D
リリースの状態: ベータ
実装 メディア
説明 3Dファイルをサポートします。
作者
最新バージョン 0.0.1
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki >= 1.42
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
ヘルプ Help:Extension:3D/ja
  • $wgMax3d2pngMemory
  • $wg3dProcessEnviron
  • $wgAjaxPatentPreview
Quarterly downloads 78 (Ranked 74th)
Vagrant role three_d
問題点 未解決のタスク · バグを報告

3D拡張では、3Dモデルのアップロードと閲覧機能をサポートします。 使用法の説明文書は、Help:Extension:3d を参照してください。

現在は、3D印刷の分野で一般的なSTLファイルフォーマットをサポートしています。

インストール

3Dファイルのアップロード

STLアップロードを扱い可能にするためには、以下をLocalSettings.phpに追加してください :

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

拡張機能のインストール

  • ダウンロードして、ファイルをextensions/フォルダー内の3Dという名前のディレクトリ内に配置します。
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( '3D' );
    
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

3d2pngのインストール

3d2pngは3Dファイル用のサムネイルレンダラーです。当拡張機能のオブジェクトの表示と同じように、ブラウザではなくNode.jsで動作するJSライブラリでpngサムネイルをレンダリングします。

3d2pngをインストール・複製・アクティベートする :

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. 以下をLocalSettings.phpに追加し、ローカルの設定に合わせてパスを更新してください :

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

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';

設定

特許契約

特別:アップロード

Special:Uploadにライセンス契約の選択オプションを追加するためには、wikiのMediaWiki:3d-patentsページを使ってください。 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. 例としてcommons:MediaWiki:3d-patentsをチェックしてください。

コンテンツに追加されるテンプレートの作成は必須です。例 : Template:3dpatent

特別: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. 自分の3Dファイルをアップロードする際には、ファイルが自分のものであるかの確認も必要です。 アップロードコンテンツに追加されるテンプレートは、それぞれについて{{3dpatent}}{{3dpatent|ownwork}}です。

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 Category:Files_with_no_machine-readable_patent.

3dpatent以外のテンプレートを利用している場合、設定ができないので機能が役立ちません。