Open main menu

Extension:StlHandler

This Extension gives user the ability to view and manipulate with 3D objects in STL file format.

MediaWiki extensions manual
OOjs UI icon advanced.svg
StlHandler
Release status: experimental
Stlhandler.png
Description Enables the user to view 3D objects in the STL file format on MediaWiki file pages.
Author(s) Harri Alasi
Latest version 1.0
MediaWiki 1.25+
License GNU General Public License 3.0
Download
README
Translate the StlHandler extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

InstallationEdit

  • Download and place the file(s) in a directory called StlHandler in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'StlHandler' );
    $wgFileExtensions[] = 'stl'; 
    $wgTrustedMediaFormats[] = "application/sla";
    $wgTrustedMediaFormats[] = "application/octet-stream";
    
  • Add the following lines

application/sla stl
text/plain stl
application/octet-stream stl

to the beginning of the file mime.types located in the includes/ folder (if there is no mime.types in that folder, try includes/libs/mime folder)

ConfigurationEdit

You can set some variables in the "LocalSettings.php" file to configure the canvas that your model will be displayed onto:

$wgStlCanvasHeight (default = "480")
Assign height value to your canvas
$wgStlCanvasWidth (default = "600")
Assign width value to your canvas
$wgStlBackgroundImage (default = "")
full URL of canvas background image
$wgStlBackgroundColor (default = "lightgrey")
background color of your canvas. Color name, color HEX code and rgb(r,g,b) will all work
(See [1] for correct colour-names)

Known issuesEdit

  1.   Done Object rotation not working in Firefox
  2. File page shows object size 0px X 0px
  3. File page reports the file type as possibly harmful
  4.   Done Only works with binary STL files. If you see File extension ".stl" does not match the detected MIME type of the file (text/plain), save the STL as binary version.

Ideas about further developmentEdit

  1. Short user guide to display next to object canvas on file page (scroll to zoom etc)
  2. Make viewer touch-enabled