Rozšíření:3D
![]() Stav rozšíření: beta |
|
---|---|
![]() |
|
Zavádění | Média |
Popis | Poskytuje podporu pro soubory typu 3D. |
Napsal(i) | |
Nejnovější verze | 0.0.1 |
Zásady kompatibility | Vydání snímků následuje MediaWiki. Hlavní vývojová větev není zpětně kompatibilní. |
MediaWiki | 1.31.0+ |
Licence | GNU General Public License 2.0 nebo pozdější |
Zdrojový kód | |
Nápověda | Help:Extension:3D/cs |
|
|
Quarterly downloads | 61 (Ranked 106th) |
Vagrant role | three_d |
Problémy | Otevřené úkoly · Nahlásit chybu |
Rozšíření 3D umožňuje uživateli wiki možnost načítat a prohlížet 3D modely. Dokumentaci naleznete na stránce Help:Extension:3d .
Aktuálně podporuje souborový formát STL, který je v oblasti 3D tisku běžný.
Instalace
Povolení načítání 3D souborů
Řekne MediaWiki, že smí načítat STL soubory. Přidejte do svého LocalSettings.php
následující:
$wgTrustedMediaFormats[] = 'application/sla';
$wgFileExtensions[] = 'stl';
Instalace Rozšíření:3D
- Stáhněte soubor/y a vložte je do adresáře pojmenovaného
3D
ve vaší složceextensions/
. - Následující kód přidejte na konec vašeho souboru
LocalSettings.php
:wfLoadExtension( '3D' );
- Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
Instalace 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 activate 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'
];
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 {{3dpatent}} or {{3dpatent|ownwork}} 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, Rozšíření: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
.
If you use any other template than 3dpatent
, this will not be useful for you, as this is not currently configurable.
Toto rozšíření se používá na jednom nebo více Wikimediálních projektech. Pravděpodobně to znamená, že rozšíření je stabilní a funguje dostatečně dobře, aby jej mohly používat weby s tak vysokou návštěvností. Vyhledejte tento název rozšíření v konfiguračních souborech Wikimedie CommonSettings.php a InitialiseSettings.php, abyste viděli, kde je nainstalováno. Úplný seznam rozšíření nainstalovaných na konkrétní wiki lze vidět na stránce wiki Special:Version. |
Toto rozšíření je zahrnuto v následujících balíčcích a/nebo wiki farmách: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |