copy
object_name | optional, holds instance of the created Stl Viewer |
html element container | required, a reference to html element that will containt the Stl Viewer |
[optional] init parameters | all_loaded_callbackJavascript function to call after all 3D files were loaded (Default: null), See Events allow_drag_and_dropAllowing/not allowing user to drag and drop 3D files into viewer container (true/false; Default:true) auto_resizeSet camera to fit all 3D object in container (after all were loaded) (true/false; Default: true) auto_rotateAuto rotates camera if true (true/false; Default: false) mouse_zoomEnable mouse wheel zoom (true/false; Default: true) bgcolorBackground color for html container (String; Default: "transparent") cameraxCamera X axis position (Number; Default: 0) camerayCamera Y axis position (Number; Default: 0) canvas_widthWidth of the stl viewer (String represents css attribute; Default: "100%") canvas_heightHeight of the stl viewer (String represents css attribute; Default: "100%") load_three_filesLoad THREE.js lib files in the background (String represents relative path to files / or false to not load THREE js files ; Default: "" - assumes THREE js files are at the same folder as the page) loading_progress_callbackJavascript function to call during loading process (of one or more 3D files) (Default: null), See Events modelsArray of models to load (see here; Default:null) model_loaded_callbackJavascript function to call after (any) 3D file was loaded (Default: null), See Events load_error_callbackJavascript function to call after a loading error (Default: null), See Events on_model_dropJavascript function to call after 3D file was dropped into container (Default: null), See Events on_model_mouseclickJavscript function to call after mouse button was clicked on a model (Default: null), See Events send_no_model_click_eventWhether to trigger model click event when user clicked on nothing (no model) (Default: false) ready_callbackJavascript function to call after THREE.js files were loaded (Default: null), See Events zoomWhich zoom to use (relevant when auto_resize is set to false) (Number, -1 means auto zoom; Default: -1) center_modelsCenter model at the middle of parent element after loaded(true/false; Default: true) controlsCamera control type (0=OrbitControls, 1=TrackballControls; Default: 0) jszip_pathRelative path to jszip.min.js file, only needed when dealing with vsb or 3mf files (Default: null) jszip_utils_pathRelative path to jszip-utils.min.js file, only needed when dealing with vsb or 3mf files (Default: null) |
copy
[optional] models to load parameters |
idA uniqe id to indentify the model (Positive number (-1 for auto id), Default: -1)
filenameURL of file to load (String)
local_fileUser chosen local file to load (HTML file input element)
Working Example
meshExisting mesh to add (THREE.js mesh object)
xModel X-axis position (Number, Default: 0)
yModel Y-axis position (Number, Default: 0)
zModel Z-axis position (Number, Default: 0)
displayModel shading to display (String: "flat" / "smooth"/ "wireframe", Default: "flat")
colorModel color (String "#RRGGBB" represents RGB set, Default: "#909090")
scaleScale factor for all axises (Positive number, Default: 1)
scalexScale factor for X-axis (Positive number, Default: 1)
scaleyScale factor for Y-axis (Positive number, Default: 1)
scalezScale factor for Z-axis (Positive number, Default: 1)
rotationxRotation on world X-axis (Number represents radians, Default: 0)
rotationyRotation on world Y-axis (Number represents radians, Default: 0)
rotationzRotation on world Z-axis (Number represents radians, Default: 0)
opacityModel opacity (Number between 0 and 1, Default: 1)
view_edgesAdd edges on model (true/false, Default: false)
unitsModel units ('mm'/'inch', Default: 'mm')
animationApply animation on model (see here; Default:null)
copy |
copy
[rqeuired] delta/exact | deltaAdd (animation parameter's) values to current model position exactSet (animation parameter's) values of current model position |
[optional] animation parameters | msecAnimation time duration (how much time to animate?) (Number represents milliseconds, Default: 300) loopAnimation loop (relevant to 'delta' animation only) (true/false, Default: false) xX-axis end position (Number, Default: 0) yY-axis end position (Number, Default: 0) zZ-axis end position (Number, Default: 0) rotationxX-axis end rotation angle (Number represents radians, Default: 0) rotationyY-axis end rotation angle (Number represents radians, Default: 0) rotationzZ-axis end rotation angle (Number represents radians, Default: 0) scalexX-axis end scale factor (Positive number, Default: null) scaleyY-axis end scale factor (Positive number, Default: null) scalezZ-axis end scale factor (Positive number, Default: null) scaleEnd scale factor for all axises (Positive number, Default: null) |
copy
copy
copy
copy