language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
mrdoob
three.js
e4e8ed68bcf6595eb7b7c4e2a41be47ff83dffbb.json
Update code style
examples/webgl_geometry_colors_lookuptable.html
@@ -72,7 +72,7 @@ uiScene = new THREE.Scene(); - updateColorEvent = {type : 'updateColor'}; + updateColorEvent = { type: 'updateColor' }; var width = window.innerWidth; var height = window.innerHeight; @@ -124,14 +124,18 @@ var gui = new dat.GUI(); - gui.add( params, 'legendLayout', [ 'vertical', 'horizontal' ] ).onChange( function(){ + gui.add( params, 'legendLayout', [ 'vertical', 'horizontal' ] ).onChange( function () { + updateLegend(); render(); + } ); - gui.add( params, 'colorMap', [ 'rainbow', 'cooltowarm', 'blackbody', 'grayscale' ] ).onChange( function(){ + gui.add( params, 'colorMap', [ 'rainbow', 'cooltowarm', 'blackbody', 'grayscale' ] ).onChange( function () { + updateColors(); render(); + } ); } @@ -167,10 +171,12 @@ // default color attribute var colors = []; - for(var i = 0, n = geometry.attributes.position.count; i < n; ++i){ - colors.push(1,1,1); + for ( var i = 0, n = geometry.attributes.position.count; i < n; ++ i ) { + + colors.push( 1, 1, 1 ); + } - geometry.addAttribute('color', new THREE.Float32BufferAttribute(colors,3 )); + geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) ); mesh.geometry = geometry; updateColors(); @@ -179,7 +185,7 @@ // vertical legend var verticalLegend = lut.setLegendOn(); - verticalLegendGroup.add(verticalLegend); + verticalLegendGroup.add( verticalLegend ); var labels = lut.setLegendLabels( labelParams ); @@ -193,10 +199,10 @@ } // horizontal legend - var horizontalLegend = lut.setLegendOn({layout : 'horizontal'}); - horizontalLegendGroup.add(horizontalLegend); + var horizontalLegend = lut.setLegendOn( { layout: 'horizontal' } ); + horizontalLegendGroup.add( horizontalLegend ); - var labels = lut.setLegendLabels( labelParams); + var labels = lut.setLegendLabels( labelParams ); horizontalLegendGroup.add( labels[ 'title' ] ); @@ -207,32 +213,37 @@ } - uiScene.addEventListener('updateColor', function(){ - lut.updateCanvas(horizontalLegend.material.map.image); - lut.updateCanvas(verticalLegend.material.map.image); + uiScene.addEventListener( 'updateColor', function () { + + lut.updateCanvas( horizontalLegend.material.map.image ); + lut.updateCanvas( verticalLegend.material.map.image ); horizontalLegend.material.map.needsUpdate = true; verticalLegend.material.map.needsUpdate = true; - }); + + } ); // vertical layer = 0, horizontal layer = 1 - horizontalLegendGroup.traverse(function(obj) - { - if(obj.layers) - { - obj.layers.set(1); + horizontalLegendGroup.traverse( function ( obj ) { + + if ( obj.layers ) { + + obj.layers.set( 1 ); + } - }) + + } ); updateLegend(); render(); + } ); } function updateColors() { - lut.setColorMap(params.colorMap); + lut.setColorMap( params.colorMap ); lut.setMax( 2000 ); lut.setMin( 0 ); @@ -242,7 +253,7 @@ var colors = geometry.attributes.color; for ( var i = 0; i < pressures.array.length; i ++ ) { - var colorValue = pressures.array[i]; + var colorValue = pressures.array[ i ]; var color = lut.getColor( colorValue ); @@ -252,14 +263,15 @@ } else { - colors.setXYZ(i, color.r, color.g, color.b); + colors.setXYZ( i, color.r, color.g, color.b ); + } } colors.needsUpdate = true; - uiScene.dispatchEvent(updateColorEvent); + uiScene.dispatchEvent( updateColorEvent ); } @@ -269,18 +281,19 @@ if ( params.legendLayout === 'horizontal' ) { - orthoCamera.layers.set(1); + orthoCamera.layers.set( 1 ); } else { - orthoCamera.layers.set(0); + orthoCamera.layers.set( 0 ); } } } + </script> </body>
true
Other
mrdoob
three.js
9f3e01895e2b218f91c61d015e98098c90dc1a8c.json
update favicon path
docs/index.html
@@ -5,6 +5,7 @@ <title>three.js / documentation</title> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <link type="text/css" rel="stylesheet" href="index.css"> + <link rel="shortcut icon" href="../favicon.ico" /> </head> <body>
true
Other
mrdoob
three.js
9f3e01895e2b218f91c61d015e98098c90dc1a8c.json
update favicon path
editor/index.html
@@ -6,6 +6,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <link rel="apple-touch-icon" href="images/icon.png"> <link rel="manifest" href="manifest.json"> + <link rel="shortcut icon" href="../favicon.ico" /> </head> <body ontouchstart=""> <link rel="stylesheet" href="css/main.css">
true
Other
mrdoob
three.js
9f3e01895e2b218f91c61d015e98098c90dc1a8c.json
update favicon path
examples/index.html
@@ -4,7 +4,7 @@ <title>three.js / examples</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> - <link rel="shortcut icon" href="favicon.ico" /> + <link rel="shortcut icon" href="../favicon.ico" /> <style> @font-face {
true
Other
mrdoob
three.js
8f2a6d4e374575ce568f36357661c982519e2aa1.json
Update code style
examples/js/math/Lut.js
@@ -38,24 +38,24 @@ THREE.Lut = function ( colormap, numberofcolors ) { }; var defaultLegendParamters = { - layout : 'vertical', - position : new THREE.Vector3(), - dimensions : {width : 0.5, height: 3} + layout: 'vertical', + position: new THREE.Vector3(), + dimensions: { width: 0.5, height: 3 } }; var defaultLabelParameters = { - fontsize : 24, - fontface : 'Arial', - title : '', - um : '', - ticks : 0, - decimal : 2, - notation : 'standard' + fontsize: 24, + fontface: 'Arial', + title: '', + um: '', + ticks: 0, + decimal: 2, + notation: 'standard' }; var defaultBackgroundColor = { r: 255, g: 100, b: 100, a: 0.8 }; - var defaultBorderColor = { r: 255, g: 0, b: 0, a: 1.0 }; - var defaultBorderThickness = 4; +var defaultBorderColor = { r: 255, g: 0, b: 0, a: 1.0 }; +var defaultBorderThickness = 4; THREE.Lut.prototype = { @@ -278,11 +278,15 @@ THREE.Lut.prototype = { setLegendPosition: function ( position ) { - if(position.isVector3){ - this.legend.position.copy(position); + if ( position.isVector3 ) { + + this.legend.position.copy( position ); + + } else { + + this.legend.position.set( position.x, position.y, position.z ); + } - else{ - this.legend.position.set( position.x, position.y, position.z );} return this.legend;
true
Other
mrdoob
three.js
8f2a6d4e374575ce568f36357661c982519e2aa1.json
Update code style
examples/webgl_geometry_colors_lookuptable.html
@@ -45,7 +45,6 @@ <script src="js/libs/dat.gui.min.js"></script> <script> - if ( WEBGL.isWebGLAvailable() === false ) { document.body.appendChild( WEBGL.getWebGLErrorMessage() ); @@ -75,28 +74,28 @@ var width = window.innerWidth; var height = window.innerHeight; - perpCamera = new THREE.PerspectiveCamera(60, width / height, 1, 100); - perpCamera.position.set(0, 0, 10); + perpCamera = new THREE.PerspectiveCamera( 60, width / height, 1, 100 ); + perpCamera.position.set( 0, 0, 10 ); // sized camera to legend dimenions - orthoCamera = new THREE.OrthographicCamera( -6, 6, 2, -2, 1, 10 ); - orthoCamera.position.set(3, 0, 10); + orthoCamera = new THREE.OrthographicCamera( - 6, 6, 2, - 2, 1, 10 ); + orthoCamera.position.set( 3, 0, 10 ); var ambientLight = new THREE.AmbientLight( 0x444444 ); scene.add( ambientLight ); - mesh = new THREE.Mesh(undefined, new THREE.MeshLambertMaterial( { + mesh = new THREE.Mesh( undefined, new THREE.MeshLambertMaterial( { side: THREE.DoubleSide, color: 0xF5F5F5, vertexColors: THREE.VertexColors - } )); - scene.add(mesh); - - params = { - numberOfColors : 16, - colorMap : 'rainbow', - legendLayout : 'vertical' - } + } ) ); + scene.add( mesh ); + + params = { + numberOfColors: 16, + colorMap: 'rainbow', + legendLayout: 'vertical' + }; loadModel( ); var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.7 ); @@ -112,24 +111,25 @@ window.addEventListener( 'resize', onWindowResize, false ); var controls = new THREE.OrbitControls( perpCamera, renderer.domElement ); - controls.addEventListener('change', render); + controls.addEventListener( 'change', render ); var gui = new dat.GUI(); - gui.add( params, 'legendLayout', ['vertical', 'horizontal'] ).onChange(updateLegend); - gui.add( params, 'colorMap', [ 'rainbow', 'cooltowarm', 'blackbody', 'grayscale' ] ).onChange(updateColors); - gui.add( params, 'numberOfColors', 2, 64 ).step(1).onChange(updateColors); + gui.add( params, 'legendLayout', [ 'vertical', 'horizontal' ] ).onChange( updateLegend ); + gui.add( params, 'colorMap', [ 'rainbow', 'cooltowarm', 'blackbody', 'grayscale' ] ).onChange( updateColors ); + gui.add( params, 'numberOfColors', 2, 64 ).step( 1 ).onChange( updateColors ); + } function onWindowResize() { - var width = window.innerWidth; + var width = window.innerWidth; var height = window.innerHeight; perpCamera.aspect = width / height; perpCamera.updateProjectionMatrix(); - renderer.setSize(width, height ); + renderer.setSize( width, height ); render(); } @@ -152,12 +152,13 @@ mesh.geometry = geometry; updateColors(); + } ); } - function updateColors() - { + function updateColors() { + var lutColors = []; lut = new THREE.Lut( params.colorMap, params.numberOfColors ); @@ -189,20 +190,21 @@ geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( lutColors, 3 ) ); updateLegend(); + } - function updateLegend() - { + function updateLegend() { + if ( params.legendLayout ) { - uiScene.traverse(dispose); + uiScene.traverse( dispose ); uiScene.children.length = 0; var legend; if ( params.legendLayout === 'horizontal' ) { - legend = lut.setLegendOn( { 'layout': 'horizontal' }); + legend = lut.setLegendOn( { 'layout': 'horizontal' } ); } else { @@ -223,33 +225,31 @@ } - var box = new THREE.Box3(); - uiScene.traverse(function(obj) - { - if(obj.geometry){ - obj.geometry.computeBoundingBox(); - box.union(obj.geometry.boundingBox); - } - }); - console.log(box); render(); + } - + } - function dispose(obj) - { - if(obj.geometry){ + function dispose( obj ) { + + if ( obj.geometry ) { + obj.geometry.dispose(); + } - if(obj.material){ + if ( obj.material ) { + obj.material.dispose(); - if(obj.material.map) - { + if ( obj.material.map ) { + obj.material.map.dispose(); + } + } + } </script>
true
Other
mrdoob
three.js
2f367c48e5e8cbc01cb9ded7f85f126b8e80c943.json
remove unnecessary set side
examples/webgl_materials_nodes.html
@@ -1581,8 +1581,6 @@ mtl.environment = new THREE.ColorNode( 0xFFFFFF ); mtl.alpha = clouds; - defaultSide = THREE.FrontSide; - // GUI addGui( 'color', mtl.environment.value.getHex(), function ( val ) {
false
Other
mrdoob
three.js
5f00c11ac4451b2212000ed293246b40a23a150d.json
remove unused variable
examples/js/loaders/LDrawLoader.js
@@ -271,18 +271,6 @@ THREE.LDrawLoader = ( function () { }, onProgress, onError ); - function subobjectLoad( url, onLoad, onProgress, onError, subobject ) { - - var fileLoader = new THREE.FileLoader( scope.manager ); - fileLoader.setPath( scope.path ); - fileLoader.load( url, function ( text ) { - - processObject( text, onLoad, subobject ); - - }, onProgress, onError ); - - } - function processObject( text, onProcessed, subobject ) { var parseScope = scope.newParseScopeLevel();
false
Other
mrdoob
three.js
46a7f48db043c296bcd97a208608244538309366.json
Fix name to lowercase
examples/js/loaders/LDrawLoader.js
@@ -291,7 +291,7 @@ THREE.LDrawLoader = ( function () { var parentParseScope = scope.getParentParseScope(); // Add to cache - var currentFileName = parentParseScope.currentFileName; + var currentFileName = parentParseScope.currentFileName && parentParseScope.currentFileName.toLowerCase(); if ( scope.subobjectCache[ currentFileName ] === undefined ) { scope.subobjectCache[ currentFileName ] = text; @@ -1043,10 +1043,10 @@ THREE.LDrawLoader = ( function () { if ( line.startsWith( '0 FILE ' ) ) { // Save previous embedded file in the cache - this.subobjectCache[ currentEmbeddedFileName ] = currentEmbeddedText; + this.subobjectCache[ currentEmbeddedFileName.toLowerCase() ] = currentEmbeddedText; // New embedded text file - currentEmbeddedFileName = line.substring( 7 ).toLowerCase(); + currentEmbeddedFileName = line.substring( 7 ); currentEmbeddedText = ''; } else { @@ -1408,7 +1408,7 @@ THREE.LDrawLoader = ( function () { if ( parsingEmbeddedFiles ) { - this.subobjectCache[ currentEmbeddedFileName ] = currentEmbeddedText; + this.subobjectCache[ currentEmbeddedFileName.toLowerCase() ] = currentEmbeddedText; }
false
Other
mrdoob
three.js
760c5e6bbe5bc01baa04580213d30acba570d6a7.json
resolve rebase conflicts
examples/js/loaders/LDrawLoader.js
@@ -308,37 +308,33 @@ THREE.LDrawLoader = ( function () { parseScope.numSubobjects = parseScope.subobjects.length; parseScope.subobjectIndex = 0; - if ( parseScope.numSubobjects > 0 ) { + var finishedCount = 0; + onSubobjectFinish(); - // Load the first subobject - var subobjectGroup = loadSubobject( parseScope.subobjects[ 0 ], true ); + return objGroup; - // Optimization for loading pack: If subobjects are obtained from cache, keep loading them iteratively rather than recursively - if ( subobjectGroup ) { + function onSubobjectFinish() { - while ( subobjectGroup && parseScope.subobjectIndex < parseScope.numSubobjects - 1 ) { + finishedCount ++; - subobjectGroup = loadSubobject( parseScope.subobjects[ ++ parseScope.subobjectIndex ], true ); + if ( finishedCount === parseScope.subobjects.length + 1 ) { - } + finalizeObject(); - if ( subobjectGroup ) { + } else { - finalizeObject(); + var subobject = parseScope.subobjects[ parseScope.subobjectIndex ]; + Promise.resolve().then( function () { - } + loadSubobject( subobject ); - } - - } else { + } ); + parseScope.subobjectIndex ++; - // No subobjects, finish object - finalizeObject(); + } } - return objGroup; - function finalizeObject() { if ( ! scope.separateObjects && ! parentParseScope.isFromParse ) { @@ -368,7 +364,7 @@ THREE.LDrawLoader = ( function () { } - function loadSubobject( subobject, sync ) { + function loadSubobject( subobject ) { parseScope.mainColourCode = subobject.material.userData.code; parseScope.mainEdgeColourCode = subobject.material.userData.edgeMaterial.userData.code; @@ -382,16 +378,15 @@ THREE.LDrawLoader = ( function () { } // If subobject was cached previously, use the cached one - var cached = scope.subobjectCache[ subobject.originalFileName ]; + var cached = scope.subobjectCache[ subobject.originalFileName.toLowerCase() ]; if ( cached ) { - var subobjectGroup = processObject( cached, sync ? undefined : onSubobjectLoaded, subobject ); - if ( sync ) { + processObject( cached, function ( subobjectGroup ) { - addSubobject( subobject, subobjectGroup ); - return subobjectGroup; + onSubobjectLoaded( subobjectGroup, subobject ); + onSubobjectFinish(); - } + }, subobject ); return; @@ -451,22 +446,6 @@ THREE.LDrawLoader = ( function () { // All location possibilities have been tried, give up loading this object console.warn( 'LDrawLoader: Subobject "' + subobject.originalFileName + '" could not be found.' ); - // Try to read the next subobject - parseScope.subobjectIndex ++; - - if ( parseScope.subobjectIndex >= parseScope.numSubobjects ) { - - // All subojects have been loaded. Finish parent object - scope.removeScopeLevel(); - onProcessed( objGroup ); - - } else { - - // Load next subobject - loadSubobject( parseScope.subobjects[ parseScope.subobjectIndex ] ); - - } - return; } @@ -481,15 +460,22 @@ THREE.LDrawLoader = ( function () { fileLoader.setPath( scope.path ); fileLoader.load( subobjectURL, function ( text ) { - processObject( text, onSubobjectLoaded, subobject ); + processObject( text, function ( subobjectGroup ) { - }, undefined, onSubobjectError ); + onSubobjectLoaded( subobjectGroup, subobject ); + onSubobjectFinish(); - } + }, subobject ); - function onSubobjectLoaded( subobjectGroup ) { + }, undefined, function ( err ) { - var subobject = parseScope.subobjects[ parseScope.subobjectIndex ]; + onSubobjectError( err, subobject ); + + }, subobject ); + + } + + function onSubobjectLoaded( subobjectGroup, subobject ) { if ( subobjectGroup === null ) { @@ -502,20 +488,6 @@ THREE.LDrawLoader = ( function () { // Add the subobject just loaded addSubobject( subobject, subobjectGroup ); - // Proceed to load the next subobject, or finish the parent object - - parseScope.subobjectIndex ++; - - if ( parseScope.subobjectIndex < parseScope.numSubobjects ) { - - loadSubobject( parseScope.subobjects[ parseScope.subobjectIndex ] ); - - } else { - - finalizeObject(); - - } - } function addSubobject( subobject, subobjectGroup ) { @@ -533,10 +505,10 @@ THREE.LDrawLoader = ( function () { } - function onSubobjectError( err ) { + function onSubobjectError( err, subobject ) { // Retry download from a different default possible location - loadSubobject( parseScope.subobjects[ parseScope.subobjectIndex ] ); + loadSubobject( subobject ); } @@ -1074,7 +1046,7 @@ THREE.LDrawLoader = ( function () { this.subobjectCache[ currentEmbeddedFileName ] = currentEmbeddedText; // New embedded text file - currentEmbeddedFileName = line.substring( 7 ); + currentEmbeddedFileName = line.substring( 7 ).toLowerCase(); currentEmbeddedText = ''; } else {
false
Other
mrdoob
three.js
ba2ed44da63e1629a8b70cac22ff90c1a75655a8.json
Add support for light probes
src/Three.js
@@ -60,6 +60,7 @@ export { DirectionalLight } from './lights/DirectionalLight.js'; export { AmbientLight } from './lights/AmbientLight.js'; export { LightShadow } from './lights/LightShadow.js'; export { Light } from './lights/Light.js'; +export { LightProbe } from './lights/LightProbe.js'; export { StereoCamera } from './cameras/StereoCamera.js'; export { PerspectiveCamera } from './cameras/PerspectiveCamera.js'; export { OrthographicCamera } from './cameras/OrthographicCamera.js'; @@ -123,6 +124,7 @@ export { Vector3 } from './math/Vector3.js'; export { Vector2 } from './math/Vector2.js'; export { Quaternion } from './math/Quaternion.js'; export { Color } from './math/Color.js'; +export { SphericalHarmonics3 } from './math/SphericalHarmonics3.js'; export { ImmediateRenderObject } from './extras/objects/ImmediateRenderObject.js'; export { VertexNormalsHelper } from './helpers/VertexNormalsHelper.js'; export { SpotLightHelper } from './helpers/SpotLightHelper.js';
true
Other
mrdoob
three.js
ba2ed44da63e1629a8b70cac22ff90c1a75655a8.json
Add support for light probes
src/renderers/WebGLRenderer.js
@@ -1599,6 +1599,7 @@ function WebGLRenderer( parameters ) { // wire up the material to this renderer's lighting state uniforms.ambientLightColor.value = lights.state.ambient; + uniforms.lightProbe.value = lights.state.probe; uniforms.directionalLights.value = lights.state.directional; uniforms.spotLights.value = lights.state.spot; uniforms.rectAreaLights.value = lights.state.rectArea; @@ -2402,6 +2403,7 @@ function WebGLRenderer( parameters ) { function markUniformsLightsNeedsUpdate( uniforms, value ) { uniforms.ambientLightColor.needsUpdate = value; + uniforms.lightProbe.needsUpdate = value; uniforms.directionalLights.needsUpdate = value; uniforms.pointLights.needsUpdate = value;
true
Other
mrdoob
three.js
ba2ed44da63e1629a8b70cac22ff90c1a75655a8.json
Add support for light probes
src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js
@@ -103,6 +103,8 @@ IncidentLight directLight; vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + irradiance += getLightProbeIrradiance( lightProbe, geometry ); + #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop
true
Other
mrdoob
three.js
ba2ed44da63e1629a8b70cac22ff90c1a75655a8.json
Add support for light probes
src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js
@@ -1,5 +1,43 @@ export default /* glsl */` uniform vec3 ambientLightColor; +uniform vec3 lightProbe[ 9 ]; + +// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere +// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + + // normal is assumed to have unit length + + float x = normal.x, y = normal.y, z = normal.z; + + // band 0 + vec3 result = shCoefficients[ 0 ] * 0.886227; + + // band 1 + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + + // band 2 + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + + return result; + +} + +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { + + vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); + + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + + return irradiance; + +} vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
true
Other
mrdoob
three.js
ba2ed44da63e1629a8b70cac22ff90c1a75655a8.json
Add support for light probes
src/renderers/shaders/UniformsLib.js
@@ -109,6 +109,8 @@ var UniformsLib = { ambientLightColor: { value: [] }, + lightProbe: { value: [] }, + directionalLights: { value: [], properties: { direction: {}, color: {},
true
Other
mrdoob
three.js
ba2ed44da63e1629a8b70cac22ff90c1a75655a8.json
Add support for light probes
src/renderers/webgl/WebGLLights.js
@@ -121,6 +121,7 @@ function WebGLLights() { }, ambient: [ 0, 0, 0 ], + probe: [], directional: [], directionalShadowMap: [], directionalShadowMatrix: [], @@ -135,6 +136,8 @@ function WebGLLights() { }; + for ( var i = 0; i < 9; i ++ ) state.probe.push( new Vector3() ); + var vector3 = new Vector3(); var matrix4 = new Matrix4(); var matrix42 = new Matrix4(); @@ -143,6 +146,8 @@ function WebGLLights() { var r = 0, g = 0, b = 0; + for ( var i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 ); + var directionalLength = 0; var pointLength = 0; var spotLength = 0; @@ -167,6 +172,14 @@ function WebGLLights() { g += color.g * intensity; b += color.b * intensity; + } else if ( light.isLightProbe ) { + + for ( var j = 0; j < 9; j ++ ) { + + state.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity ); + + } + } else if ( light.isDirectionalLight ) { var uniforms = cache.get( light );
true
Other
mrdoob
three.js
e5b487ca79efe342cce05fec5ed7b77c55d0996b.json
Render all clip planes
examples/webgl_clipping_stencil.html
@@ -34,32 +34,16 @@ init(); animate(); - function createStencilGroup( geometry, material, planes ) { + function createPlaneStencilGroup( geometry, plane, renderOrder ) { var group = new THREE.Group(); var baseMat = new THREE.MeshBasicMaterial(); baseMat.depthWrite = false; baseMat.depthTest = false; baseMat.colorWrite = false; - baseMat.clippingPlanes = planes; + baseMat.clippingPlanes = [ plane ]; baseMat.stencilWrite = true; - baseMat.stencilFail = THREE.AlwaysStencilFunc; - - // // front faces no depth - // var mat0 = baseMat.clone(); - // mat0.stencilFail = THREE.IncrementWrapStencilOp; - // mat0.stencilZFail = THREE.IncrementWrapStencilOp; - // mat0.stencilZPass = THREE.IncrementWrapStencilOp; - // var mesh0 = new THREE.Mesh( geometry, mat0 ); - // group.add( mesh0 ); - - // // back faces no depth - // var mat1 = baseMat.clone(); - // mat1.stencilFail = THREE.DecrementWrapStencilOp; - // mat1.stencilZFail = THREE.DecrementWrapStencilOp; - // mat1.stencilZPass = THREE.DecrementWrapStencilOp; - // var mesh1 = new THREE.Mesh( geometry, mat1 ); - // group.add( mesh1 ); + baseMat.stencilFunc = THREE.AlwaysStencilFunc; // back faces var mat0 = baseMat.clone(); @@ -69,23 +53,20 @@ mat0.stencilZPass = THREE.IncrementWrapStencilOp; var mesh0 = new THREE.Mesh( geometry, mat0 ); - mesh0.renderOrder = 1; + mesh0.renderOrder = renderOrder; group.add( mesh0 ); // front faces - var mat1 = material.clone(); + var mat1 = baseMat.clone(); mat1.side = THREE.FrontSide; - mat1.clippingPlanes = planes; - mat1.stencilWrite = true; - mat1.stencilFail = THREE.AlwaysStencilFunc; mat1.stencilFail = THREE.DecrementWrapStencilOp; mat1.stencilZFail = THREE.DecrementWrapStencilOp; mat1.stencilZPass = THREE.DecrementWrapStencilOp; var mesh1 = new THREE.Mesh( geometry, mat1 ); mesh1.castShadow = true; mesh1.receiveShadow = true; - mesh1.renderOrder = 1; + mesh1.renderOrder = renderOrder; group.add( mesh1 ); @@ -125,47 +106,57 @@ new THREE.Plane( new THREE.Vector3( 0, 0, - 1 ), 0 ) ]; - planeObjects = new Array( 3 ); + var material = new THREE.MeshStandardMaterial( { + color: 0xFFC107, + metalness: 0.1, + roughness: 0.75, + side: THREE.DoubleSide, + clippingPlanes: planes, + clipShadows: true + } ); + + var geometry = new THREE.TorusKnotBufferGeometry( 0.4, 0.15, 220, 60 ); + object = new THREE.Group(); + object.add( new THREE.Mesh( geometry, material ) ); + scene.add( object ); + + planeObjects = []; var planeGeom = new THREE.PlaneBufferGeometry( 10, 10 ); - for ( var i = 0; i < planes.length; i ++ ) { + for ( var i = 0; i < 3; i ++ ) { var plane = planes[ i ]; + var stencilGroup = createPlaneStencilGroup( geometry, plane, i + 1 ) + var planeMat = new THREE.MeshStandardMaterial( { color: 0xE91E63, metalness: 0.1, roughness: 0.75, - side: THREE.DoubleSide, clippingPlanes: planes.filter( p => p !== plane ), clipShadows: true, stencilWrite: true, stencilRef: 0, stencilFunc: THREE.NotEqualStencilFunc, + stencilFail: THREE.ReplaceStencilOp, + stencilZFail: THREE.ReplaceStencilOp, + stencilZPass: THREE.ReplaceStencilOp, } ); var po = new THREE.Mesh( planeGeom, planeMat ); - po.renderOrder = 2; + po.onAfterRender = function( renderer ) { + renderer.clearStencil(); + }; + po.renderOrder = i + 1.5; + object.add( stencilGroup ); scene.add( po ); - planeObjects[ i ] = po; + planeObjects.push( po ); } // Geometry - var material = new THREE.MeshStandardMaterial( { - color: 0xFFC107, - metalness: 0.1, - roughness: 0.75, - side: THREE.DoubleSide, - clippingPlanes: planes, - clipShadows: true - } ); - - var geometry = new THREE.TorusKnotBufferGeometry( 0.4, 0.15, 220, 60 ); - object = createStencilGroup( geometry, material, planes ); - scene.add( object ); @@ -230,15 +221,15 @@ } - for ( var i = 0; i < planes.length; i ++ ) { + for ( var i = 0; i < planeObjects.length; i ++ ) { var plane = planes[ i ]; var po = planeObjects[ i ]; plane.coplanarPoint( po.position ); po.lookAt( - po.position.x + plane.normal.x, - po.position.y + plane.normal.y, - po.position.z + plane.normal.z, + po.position.x - plane.normal.x, + po.position.y - plane.normal.y, + po.position.z - plane.normal.z, ); }
false
Other
mrdoob
three.js
f099cbdb629f4326d9afd0546e1992d11871c1f6.json
add start to clip example
examples/webgl_clipping_stencil.html
@@ -0,0 +1,193 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>three.js webgl - clipping planes</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + <style> + body { + margin: 0px; + background-color: #000000; + overflow: hidden; + } + </style> + </head> + <body> + + <script src="../build/three.js"></script> + <script src="js/controls/OrbitControls.js"></script> + <script src="js/libs/stats.min.js"></script> + <script src="js/libs/dat.gui.min.js"></script> + + <script> + + var camera, scene, renderer, startTime, object, stats; + + init(); + animate(); + + function init() { + + camera = new THREE.PerspectiveCamera( 36, window.innerWidth / window.innerHeight ); + + camera.position.set( 0, 1.3, 3 ); + + scene = new THREE.Scene(); + + // Lights + + scene.add( new THREE.AmbientLight( 0xffffff, 0.5 ) ); + + var dirLight = new THREE.DirectionalLight( 0xffffff, 1 ); + dirLight.position.set( 5, 10, 5 ); + dirLight.castShadow = true; + dirLight.shadow.camera.right = 2; + dirLight.shadow.camera.left = - 2; + dirLight.shadow.camera.top = 2; + dirLight.shadow.camera.bottom = - 2; + + dirLight.shadow.mapSize.width = 1024; + dirLight.shadow.mapSize.height = 1024; + scene.add( dirLight ); + + // ***** Clipping planes: ***** + + var localPlane = new THREE.Plane( new THREE.Vector3( 0, - 1, 0 ), 0.8 ); + var globalPlane = new THREE.Plane( new THREE.Vector3( - 1, 0, 0 ), 0.1 ); + + // Geometry + + var material = new THREE.MeshStandardMaterial( { + color: 0xFFC107, + metalness: 0.1, + roughness: 0.75, + side: THREE.DoubleSide, + clippingPlanes: [ localPlane ], + clipShadows: true + + } ); + + var geometry = new THREE.TorusKnotBufferGeometry( 0.4, 0.15, 220, 60 ); + + object = new THREE.Mesh( geometry, material ); + object.castShadow = true; + scene.add( object ); + + var ground = new THREE.Mesh( + new THREE.PlaneBufferGeometry( 9, 9, 1, 1 ), + new THREE.ShadowMaterial( { color: 0, opacity: 0.25, side: THREE.DoubleSide } ) + ); + + ground.rotation.x = - Math.PI / 2; // rotates X/Y to X/Z + ground.receiveShadow = true; + scene.add( ground ); + + // Stats + + stats = new Stats(); + document.body.appendChild( stats.dom ); + + // Renderer + + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.shadowMap.enabled = true; + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.setClearColor( 0x263238 ); + window.addEventListener( 'resize', onWindowResize, false ); + document.body.appendChild( renderer.domElement ); + + // ***** Clipping setup (renderer): ***** + var globalPlanes = [ globalPlane ], + Empty = Object.freeze( [] ); + renderer.clippingPlanes = Empty; // GUI sets it to globalPlanes + renderer.localClippingEnabled = true; + + // Controls + + var controls = new THREE.OrbitControls( camera, renderer.domElement ); + controls.target.set( 0, 1, 0 ); + controls.update(); + + // GUI + + var gui = new dat.GUI(), + folderLocal = gui.addFolder( 'Local Clipping' ), + propsLocal = { + + get 'Enabled'() { + + return renderer.localClippingEnabled; + + }, + set 'Enabled'( v ) { + + renderer.localClippingEnabled = v; + + }, + + get 'Shadows'() { + + return material.clipShadows; + + }, + set 'Shadows'( v ) { + + material.clipShadows = v; + + }, + + get 'Plane'() { + + return localPlane.constant; + + }, + set 'Plane'( v ) { + + localPlane.constant = v; + + } + + }; + + folderLocal.add( propsLocal, 'Enabled' ); + folderLocal.add( propsLocal, 'Shadows' ); + folderLocal.add( propsLocal, 'Plane', 0.3, 1.25 ); + + // Start + + startTime = Date.now(); + + } + + function onWindowResize() { + + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + + renderer.setSize( window.innerWidth, window.innerHeight ); + + } + + function animate() { + + var currentTime = Date.now(); + var time = ( currentTime - startTime ) / 1000; + + requestAnimationFrame( animate ); + + object.position.y = 0.8; + object.rotation.x = time * 0.5; + object.rotation.y = time * 0.2; + object.scale.setScalar( Math.cos( time ) * 0.125 + 0.875 ); + + stats.begin(); + renderer.render( scene, camera ); + stats.end(); + + } + + </script> + + </body> +</html>
false
Other
mrdoob
three.js
c2e6781bb900fd85f0533db843f80db76fa9325d.json
Remove Loader inheritance from CTMLoader
examples/js/loaders/ctm/CTMLoader.js
@@ -10,11 +10,8 @@ THREE.CTMLoader = function () { - THREE.Loader.call( this ); - }; -THREE.CTMLoader.prototype = Object.create( THREE.Loader.prototype ); THREE.CTMLoader.prototype.constructor = THREE.CTMLoader; // Load multiple CTM parts defined in JSON @@ -58,7 +55,7 @@ THREE.CTMLoader.prototype.loadParts = function ( url, callback, parameters ) { for ( var i = 0; i < jsonObject.materials.length; i ++ ) { - materials[ i ] = scope.createMaterial( jsonObject.materials[ i ], basePath ); + materials[ i ] = THREE.Loader.prototype.createMaterial( jsonObject.materials[ i ], basePath ); }
false
Other
mrdoob
three.js
96950ea796c87d60c99de3fe4d6d2abf4994b5ce.json
Add isQuaternion and isTexture in documentation
docs/api/en/math/Quaternion.html
@@ -44,6 +44,13 @@ <h3>[name]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) <h2>Properties</h2> + <h3>[property:Boolean isQuaternion]</h3> + <p> + Used to check whether this or derived classes are Quaternions. Default is *true*.<br /><br /> + + You should not change this, as it is used internally for optimisation. + </p> + <h3>[property:Float x]</h3> <p>Changing this property will result in [page:.onChangeCallback onChangeCallback] being called.</p>
true
Other
mrdoob
three.js
96950ea796c87d60c99de3fe4d6d2abf4994b5ce.json
Add isQuaternion and isTexture in documentation
docs/api/en/textures/Texture.html
@@ -55,6 +55,13 @@ <h3>[property:Image image]</h3> as long as video is playing - the [page:VideoTexture VideoTexture] class handles this automatically. </p> + <h3>[property:Boolean isTexture]</h3> + <p> + Used to check whether this or derived classes are Textures. Default is *true*.<br /><br /> + + You should not change this, as it is used internally for optimisation. + </p> + <h3>[property:array mipmaps]</h3> <p> Array of user-specified mipmaps (optional).
true
Other
mrdoob
three.js
96950ea796c87d60c99de3fe4d6d2abf4994b5ce.json
Add isQuaternion and isTexture in documentation
docs/api/zh/math/Quaternion.html
@@ -44,6 +44,13 @@ <h3>[name]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) <h2>Properties</h2> + <h3>[property:Boolean isQuaternion]</h3> + <p> + Used to check whether this or derived classes are Quaternions. Default is *true*.<br /><br /> + + You should not change this, as it is used internally for optimisation. + </p> + <h3>[property:Float x]</h3> <p>Changing this property will result in [page:.onChangeCallback onChangeCallback] being called.</p> @@ -290,4 +297,4 @@ <h2>Source</h2> [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] </body> -</html> \ No newline at end of file +</html>
true
Other
mrdoob
three.js
96950ea796c87d60c99de3fe4d6d2abf4994b5ce.json
Add isQuaternion and isTexture in documentation
docs/api/zh/textures/Texture.html
@@ -54,6 +54,14 @@ <h3>[property:Image image]</h3> 并在视频播放时不断地更新这个纹理贴图。——[page:VideoTexture VideoTexture] 类会对此自动进行处理。 </p> + <h3>[property:Boolean isTexture]</h3> + <p> + 用于测试这个类或者派生类是否为Texture,默认为*true*。<br /><br /> + + 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。 + </p> + + <h3>[property:array mipmaps]</h3> <p> 用户所给定的mipmap数组(可选)。
true
Other
mrdoob
three.js
b339e48103f6275ce60aa444e651832184d42c1c.json
Change Chinese documentation as well
docs/api/zh/materials/Material.html
@@ -243,7 +243,7 @@ <h3>[method:null dispose]()</h3> <p> 处理材质。材质的纹理不会被处理。需要通过[page:Texture Texture]处理。 </p> -<h3>[method:null onBeforeCompile]( [param:Object shader], [param:WebGLRenderer renderer] )</h3> +<h3>[method:null onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] )</h3> <p> 在编译shader程序之前立即执行的可选回调。此函数使用shader源码作为参数。用于修改内置材质。 </p>
false
Other
mrdoob
three.js
3c2c01554505c69501431a9138828b4181c8f0f7.json
Fix correct return value
src/materials/Material.d.ts
@@ -272,7 +272,7 @@ export class Material extends EventDispatcher { * @param shader Source code of the shader * @param renderer WebGLRenderer Context that is initializing the material */ - onBeforeCompile ( shader : Object, renderer : WebGLRenderer ) : null + onBeforeCompile ( shader : Object, renderer : WebGLRenderer ) : void; /** * Sets the properties based on the values.
false
Other
mrdoob
three.js
2bd6d155d42bb89e34734e5cdcff51b18e964753.json
Adjust the speed of Texture 2D array example
examples/webgl2_materials_texture2darray.html
@@ -96,7 +96,7 @@ var planeWidth = 50; var planeHeight = 50; - var depthStep = 0.5; + var depthStep = 0.4; init(); animate();
false
Other
mrdoob
three.js
b3f6079deb184077edccd18da6cd6e08d5638ac1.json
Add Cinema 4D to glTF exporter list.
docs/manual/en/introduction/Loading-3D-models.html
@@ -63,6 +63,7 @@ <h2>Recommended workflow</h2> <li><a href="https://www.foundry.com/products/modo" target="_blank" rel="noopener">Modo</a> by Foundry</li> <li><a href="https://www.marmoset.co/toolbag/" target="_blank" rel="noopener">Toolbag</a> by Marmoset</li> <li><a href="https://www.sidefx.com/products/houdini/" target="_blank" rel="noopener">Houdini</a> by SideFX</li> + <li><a href="https://labs.maxon.net/?p=3360" target="_blank" rel="noopener">Cinema 4D</a> by MAXON</li> <li>&hellip;and <a href="https://github.com/khronosgroup/gltf#gltf-tools" target="_blank" rel="noopener">many more</a></li> </ul>
false
Other
mrdoob
three.js
aedee38e442893fa7ed13a91564846aae8d5506a.json
Fix export of TypeScript Math namespace
src/Three.d.ts
@@ -105,7 +105,7 @@ export * from './math/interpolants/DiscreteInterpolant'; export * from './math/interpolants/CubicInterpolant'; export * from './math/Interpolant'; export * from './math/Triangle'; -export * from './math/Math'; +export { _Math as Math } from './math/Math'; export * from './math/Spherical'; export * from './math/Cylindrical'; export * from './math/Plane';
false
Other
mrdoob
three.js
d7ed0a01cd4a93ad62f6fc5f1c6e957e2253896d.json
Fix MMDPhysics _updateBonePosition()
examples/js/animation/MMDPhysics.js
@@ -994,14 +994,8 @@ THREE.MMDPhysics = ( function () { _getWorldTransformForBone: function () { var manager = this.manager; - - var tr = manager.allocTransform(); - this.body.getMotionState().getWorldTransform( tr ); - var tr2 = manager.multiplyTransforms( tr, this.boneOffsetFormInverse ); - - manager.freeTransform( tr ); - - return tr2; + var tr = this.body.getCenterOfMassTransform(); + return manager.multiplyTransforms( tr, this.boneOffsetFormInverse ); }, @@ -1072,19 +1066,24 @@ THREE.MMDPhysics = ( function () { var manager = this.manager; - var tr = this.body.getCenterOfMassTransform(); - var origin = tr.getOrigin(); - - var matrixInv = manager.allocThreeMatrix4(); - matrixInv.copy( this.bone.parent.matrixWorld ).getInverse( matrixInv ); - - var pos = manager.allocThreeVector3(); - pos.set( origin.x(), origin.y(), origin.z() ).applyMatrix4( matrixInv ); - - this.bone.position.copy( pos ); - - manager.freeThreeVector3( pos ); - manager.freeThreeMatrix4( matrixInv ); + var tr = this._getWorldTransformForBone(); + + var thV = manager.allocThreeVector3(); + + var o = manager.getOrigin( tr ); + thV.set( o.x(), o.y(), o.z() ); + + if ( this.bone.parent ) { + + this.bone.parent.worldToLocal( thV ); + + } + + this.bone.position.copy( thV ); + + manager.freeThreeVector3( thV ); + + manager.freeTransform( tr ); }
false
Other
mrdoob
three.js
cc96ff069288d5979e9a056b82ff141a59827f32.json
Update code style
editor/js/Sidebar.Material.js
@@ -624,12 +624,13 @@ Sidebar.Material = function ( editor ) { } - if ( material.depthPacking !== undefined) { + if ( material.depthPacking !== undefined ) { + + var depthPacking = parseInt( materialDepthPacking.getValue() ); + if ( material.depthPacking !== depthPacking ) { - var depthPacking = parseInt(materialDepthPacking.getValue()); - if(material.depthPacking !== depthPacking) - { editor.execute( new SetMaterialValueCommand( currentObject, 'depthPacking', depthPacking, currentMaterialSlot ) ); + } }
false
Other
mrdoob
three.js
075a328281a6061ca3ff9aaca15cbced45c8007a.json
Add MeshToonMaterial to editor
editor/js/Sidebar.Material.js
@@ -84,6 +84,7 @@ Sidebar.Material = function ( editor ) { 'MeshNormalMaterial': 'MeshNormalMaterial', 'MeshLambertMaterial': 'MeshLambertMaterial', 'MeshPhongMaterial': 'MeshPhongMaterial', + 'MeshToonMaterial': 'MeshToonMaterial', 'MeshStandardMaterial': 'MeshStandardMaterial', 'MeshPhysicalMaterial': 'MeshPhysicalMaterial', 'ShaderMaterial': 'ShaderMaterial', @@ -419,6 +420,18 @@ Sidebar.Material = function ( editor ) { container.add( materialEmissiveMapRow ); + // gradient map + + var materialGradientMapRow = new UI.Row(); + var materialGradientMapEnabled = new UI.Checkbox( false ).onChange( update ); + var materialGradientMap = new UI.Texture().onChange( update ); + + materialGradientMapRow.add( new UI.Text( strings.getKey( 'sidebar/material/gradientmap' ) ).setWidth( '90px' ) ); + materialGradientMapRow.add( materialGradientMapEnabled ); + materialGradientMapRow.add( materialGradientMap ); + + container.add( materialGradientMapRow ); + // side var materialSideRow = new UI.Row(); @@ -438,7 +451,7 @@ Sidebar.Material = function ( editor ) { // shading var materialShadingRow = new UI.Row(); - var materialShading = new UI.Checkbox(false).setLeft( '100px' ).onChange( update ); + var materialShading = new UI.Checkbox( false ).setLeft( '100px' ).onChange( update ); materialShadingRow.add( new UI.Text( strings.getKey( 'sidebar/material/flatshaded' ) ).setWidth( '90px' ) ); materialShadingRow.add( materialShading ); @@ -810,6 +823,20 @@ Sidebar.Material = function ( editor ) { } + if ( material.gradientMap !== undefined ) { + + var gradientMapEnabled = materialGradientMap.getValue() === true; + + var gradientMap = gradientMapEnabled ? materialGradientMap.getValue() : null; + + if ( material.gradientMap !== gradientMap ) { + + editor.execute( new SetMaterialMapCommand( currentObject, 'gradientMap', gradientMap, currentMaterialSlot ) ); + + } + + } + if ( material.reflectivity !== undefined ) { var reflectivity = materialReflectivity.getValue(); @@ -945,7 +972,7 @@ Sidebar.Material = function ( editor ) { if ( material.wireframe !== undefined && material.wireframe !== materialWireframe.getValue() ) { - editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue(), currentMaterialSlot) ); + editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue(), currentMaterialSlot ) ); }
true
Other
mrdoob
three.js
075a328281a6061ca3ff9aaca15cbced45c8007a.json
Add MeshToonMaterial to editor
editor/js/Strings.js
@@ -207,6 +207,7 @@ var Strings = function ( config ) { 'sidebar/material/lightmap': 'Light Map', 'sidebar/material/aomap': 'AO Map', 'sidebar/material/emissivemap': 'Emissive Map', + 'sidebar/material/gradientmap': 'Gradient Map', 'sidebar/material/side': 'Side', 'sidebar/material/side/front': 'Front', 'sidebar/material/side/back': 'Back',
true
Other
mrdoob
three.js
c00575eb8fa92fd4041a4cf3b0afcc4785597859.json
Fix GLTFLoader DDSExtension
examples/js/loaders/GLTFLoader.js
@@ -2116,15 +2116,19 @@ THREE.GLTFLoader = ( function () { return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) { - switch ( mapName ) { - - case 'aoMap': - case 'emissiveMap': - case 'metalnessMap': - case 'normalMap': - case 'roughnessMap': - texture.format = THREE.RGBFormat; - break; + if ( ! texture.isCompressedTexture ) { + + switch ( mapName ) { + + case 'aoMap': + case 'emissiveMap': + case 'metalnessMap': + case 'normalMap': + case 'roughnessMap': + texture.format = THREE.RGBFormat; + break; + + } }
false
Other
mrdoob
three.js
d55958ea47ae293282e8c06667a0910c60d6f956.json
Add script to fix color maps
editor/js/Menubar.Edit.js
@@ -199,6 +199,53 @@ Menubar.Edit = function ( editor ) { } ); options.add( option ); + options.add( new UI.HorizontalRule() ); + + // Set textures to sRGB. See #15903 + + var option = new UI.Row(); + option.setClass( 'option' ); + option.setTextContent( strings.getKey( 'menubar/edit/fixcolormaps' ) ); + option.onClick(function() + { + editor.scene.traverse(fixColorMap); + }); + options.add(option); + + var colorMaps = ['map', 'envMap', 'emissiveMap']; + + function fixColorMap(obj) + { + var material = obj.material; + if(Array.isArray(material) === true) + { + for(var i = 0; i < material.length; ++i) + { + fixMaterial(material[i]); + } + } + else if(material !== undefined) + { + fixMaterial(material); + } + + editor.signals.sceneGraphChanged.dispatch(); + } + + function fixMaterial(material) + { + var needsUpdate = material.needsUpdate; + for(var i = 0; i < colorMaps.length; ++i) + { + var map = material[colorMaps[i]]; + if(map) + { + map.encoding = THREE.sRGBEncoding; + needsUpdate = true; + } + } + material.needsUpdate = needsUpdate; + } return container;
true
Other
mrdoob
three.js
d55958ea47ae293282e8c06667a0910c60d6f956.json
Add script to fix color maps
editor/js/Strings.js
@@ -31,6 +31,7 @@ var Strings = function ( config ) { 'menubar/edit/clone': 'Clone', 'menubar/edit/delete': 'Delete (Del)', 'menubar/edit/minify_shaders': 'Minify Shaders', + 'menubar/edit/fixcolormaps': 'Fix Color Maps', 'menubar/add': 'Add', 'menubar/add/group': 'Group',
true
Other
mrdoob
three.js
702959ddc57b1e098fe4aa4f6bd9159b93ebdd5a.json
Update code style
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -106,9 +106,9 @@ rows: 6, columns: 6, size: 2, - zOffset : 5, - minLightness : 0, - maxLightness : 0.1, + zOffset: 5, + minLightness: 0, + maxLightness: 0.1, scene: "Scene with Glow" }; @@ -128,12 +128,12 @@ camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 200 ); camera.position.set( 0, 0, 30 ); camera.lookAt( 0, 0, 0 ); - + controls = new THREE.OrbitControls( camera, renderer.domElement ); controls.maxPolarAngle = Math.PI * 0.5; controls.minDistance = 1; controls.maxDistance = 100; - controls.addEventListener('change', render); + controls.addEventListener( 'change', render ); scene.add( new THREE.AmbientLight( 0x404040 ) ); @@ -256,6 +256,7 @@ var object = intersects[ 0 ].object; object.layers.toggle( BLOOM_SCENE ); render(); + } } @@ -274,6 +275,7 @@ finalComposer.setSize( width, height ); render(); + }; function setupBoxes() { @@ -285,23 +287,23 @@ var minLightness = params.minLightness; var maxLightness = params.maxLightness; - scene.traverse(disposeMaterial); + scene.traverse( disposeMaterial ); scene.children.length = 0; - var hsl = {h : 0, s : 0, l : 0}; + var hsl = { h: 0, s: 0, l: 0 }; for ( var x = - columns * size / 2; x < columns * size / 2; x += size ) { for ( var y = - rows * size / 2; y < rows * size / 2; y += size ) { - var color = new THREE.Color(Math.floor( Math.random() * 0xffffff )); - color.getHSL(hsl); - hsl.l = Math.min(Math.max(minLightness, hsl.l), maxLightness); - color.setHSL(hsl.h, hsl.s, hsl.l); + var color = new THREE.Color( Math.floor( Math.random() * 0xffffff ) ); + color.getHSL( hsl ); + hsl.l = Math.min( Math.max( minLightness, hsl.l ), maxLightness ); + color.setHSL( hsl.h, hsl.s, hsl.l ); var box = new THREE.Mesh( getGeometry(), new THREE.MeshBasicMaterial( { color: color } ) ); - box.position.set( x, y, -zOffset + Math.random() * zOffset * 2 ); + box.position.set( x, y, - zOffset + Math.random() * zOffset * 2 ); scene.add( box ); if ( Math.random() < 0.125 ) box.layers.enable( BLOOM_SCENE ); @@ -310,35 +312,41 @@ } render(); + } - function disposeMaterial(obj) - { - if(obj.material) - { + function disposeMaterial( obj ) { + + if ( obj.material ) { + obj.material.dispose(); + } + } - function getGeometry() - { - if(geometry === undefined) - { + function getGeometry() { + + if ( geometry === undefined ) { + makeGeometry(); - } - else if(geometry.parameters.width !== params.size) - { + + } else if ( geometry.parameters.width !== params.size ) { + geometry.dispose(); makeGeometry(); + } return geometry; + } - function makeGeometry() - { + function makeGeometry() { + var size = params.size; - geometry = new THREE.BoxBufferGeometry(size, size, size); + geometry = new THREE.BoxBufferGeometry( size, size, size ); + } function render() {
false
Other
mrdoob
three.js
a621afdf8a20c0ef7cdd7e340d4b0f76bde46063.json
Allow box lightness to be set
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -107,6 +107,8 @@ columns: 6, size: 2, zOffset : 5, + minLightness : 0, + maxLightness : 0.1, scene: "Scene with Glow" }; @@ -199,24 +201,28 @@ folder.add( params, 'exposure', 0.1, 2 ).onChange( function ( value ) { renderer.toneMappingExposure = Math.pow( value, 4.0 ); + render(); } ); folder.add( params, 'bloomThreshold', 0.0, 1.0 ).onChange( function ( value ) { bloomPass.threshold = Number( value ); + render(); } ); folder.add( params, 'bloomStrength', 0.0, 3.0 ).onChange( function ( value ) { bloomPass.strength = Number( value ); + render(); } ); folder.add( params, 'bloomRadius', 0.0, 1.0 ).step( 0.01 ).onChange( function ( value ) { bloomPass.radius = Number( value ); + render(); } ); @@ -230,6 +236,10 @@ folder.add( params, 'zOffset', 0, 10 ).onChange( setupBoxes ); + folder.add( params, 'minLightness', 0, 1 ).onChange( setupBoxes ); + + folder.add( params, 'maxLightness', 0, 1 ).onChange( setupBoxes ); + setupBoxes(); function onDocumentMouseClick( event ) { @@ -272,14 +282,24 @@ var rows = params.rows; var size = params.size; var zOffset = params.zOffset; + var minLightness = params.minLightness; + var maxLightness = params.maxLightness; + scene.traverse(disposeMaterial); scene.children.length = 0; + + var hsl = {h : 0, s : 0, l : 0}; for ( var x = - columns * size / 2; x < columns * size / 2; x += size ) { for ( var y = - rows * size / 2; y < rows * size / 2; y += size ) { + var color = new THREE.Color(Math.floor( Math.random() * 0xffffff )); + color.getHSL(hsl); + hsl.l = Math.min(Math.max(minLightness, hsl.l), maxLightness); + color.setHSL(hsl.h, hsl.s, hsl.l); + var box = new THREE.Mesh( getGeometry(), new THREE.MeshBasicMaterial( { - color: Math.floor( Math.random() * 0xffffff ) + color: color } ) ); box.position.set( x, y, -zOffset + Math.random() * zOffset * 2 ); scene.add( box );
false
Other
mrdoob
three.js
93962a10d762c1427dcd3649bdc99545c9ba3838.json
Remove animation loop
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -42,7 +42,6 @@ <script src="../build/three.js"></script> - <script src="js/libs/stats.min.js"></script> <script src="js/libs/dat.gui.min.js"></script> <script src="js/postprocessing/EffectComposer.js"></script> @@ -89,7 +88,7 @@ <script> - var scene, camera, stats, geometry; + var scene, camera, geometry; var renderer; var ENTIRE_SCENE = 0, BLOOM_SCENE = 1; @@ -115,9 +114,6 @@ var container = document.getElementById( 'container' ); - stats = new Stats(); - container.appendChild( stats.dom ); - renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); @@ -163,8 +159,6 @@ finalComposer.addPass( renderScene ); finalComposer.addPass( finalPass ); - setupBoxes(); - var raycaster = new THREE.Raycaster(); var mouse = new THREE.Vector2(); @@ -189,6 +183,8 @@ } + render(); + } ); @@ -232,7 +228,7 @@ folder.add( params, 'cameraDistance', 30, 100 ).step( 1 ).onChange( updateCamera ); - animate(); + setupBoxes(); function onDocumentMouseClick( event ) { @@ -247,7 +243,7 @@ var object = intersects[ 0 ].object; object.layers.toggle( BLOOM_SCENE ); - + render(); } } @@ -259,6 +255,7 @@ camera.position.x = Math.cos( angle * THREE.Math.DEG2RAD ) * distance; camera.position.z = Math.sin( angle * THREE.Math.DEG2RAD ) * distance; camera.lookAt( 0, 0, 0 ); + render(); } @@ -275,6 +272,7 @@ bloomComposer.setSize( width, height ); finalComposer.setSize( width, height ); + render(); }; function setupBoxes() { @@ -299,6 +297,7 @@ } + render(); } function disposeMaterial(obj) @@ -330,11 +329,7 @@ geometry = new THREE.BoxBufferGeometry(size, size, size); } - function animate() { - - requestAnimationFrame( animate ); - - stats.update(); + function render() { switch ( params.scene ) {
false
Other
mrdoob
three.js
e0caf08a836fa83e043c6e43c7c2fb07d91c66fd.json
Reduce initial bloomed boxes
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -292,7 +292,7 @@ } ) ); box.position.set( x, y, 0 ); scene.add( box ); - if ( Math.random() < 0.5 ) box.layers.enable( BLOOM_SCENE ); + if ( Math.random() < 0.125 ) box.layers.enable( BLOOM_SCENE ); }
false
Other
mrdoob
three.js
3434106cef5a8c0770d68b3b3b0e782ab60655a7.json
Add example to file list
examples/files.js
@@ -273,7 +273,8 @@ var files = { "webgl_postprocessing_sobel", "webgl_postprocessing_ssao", "webgl_postprocessing_taa", - "webgl_postprocessing_unreal_bloom" + "webgl_postprocessing_unreal_bloom", + "webgl_postprocessing_unreal_bloom_selective" ], "webgl / advanced": [ "webgl_buffergeometry",
false
Other
mrdoob
three.js
6f82a77b33d69e324f658eb03197e84c21a1ca91.json
remove Geometry warning
src/objects/Points.js
@@ -143,14 +143,6 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), { var geometry = this.geometry; var m, ml, name; - if ( ! geometry.isBufferGeometry && geometry.morphTargets !== undefined && geometry.morphTargets.length > 0 ) { - - console.error( 'THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' ); - - return; - - } - var morphAttributes = geometry.morphAttributes; var keys = Object.keys( morphAttributes );
false
Other
mrdoob
three.js
c47cb7ea60086457318bb5fa02b01935aea58870.json
Change camera angle to degrees
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -114,7 +114,7 @@ rows: 6, columns: 6, size: 2, - cameraAngle: Math.PI * 0.5, + cameraAngle: 90, scene: "Scene with Glow" }; @@ -247,10 +247,10 @@ folder = gui.addFolder( 'Camera Position' ); - folder.add( params, 'cameraAngle', 0, Math.PI * 2 ).step( 0.001 ).onChange( function ( value ) { + folder.add( params, 'cameraAngle', 0, 360 ).step( 1 ).onChange( function ( value ) { - camera.position.x = Math.cos( value ) * 30; - camera.position.z = Math.sin( value ) * 30; + camera.position.x = Math.cos( value * THREE.Math.DEG2RAD ) * 30; + camera.position.z = Math.sin( value * THREE.Math.DEG2RAD ) * 30; camera.lookAt( 0, 0, 0 ); camera.updateProjectionMatrix();
false
Other
mrdoob
three.js
3bfb9eeca6e7d958a91c65a0b9283086b60d6772.json
Update code style
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -37,7 +37,7 @@ <div id="container"></div> <div id="info"> - <a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> Click on a box to toggle bloom + <a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> Click on a box to toggle bloom<br>By <a href="http://github.com/Temdog007" target="_blank" rel="noopener">Temdog007</a> </div> <script src="../build/three.js"></script> @@ -74,21 +74,24 @@ varying vec2 vUv; - bool isVisible(vec4 color) - { + bool isVisible(vec4 color) { + return color.a < 1.0 || color.r > 0.0; + } - vec4 getTexture(sampler2D texture) - { - return mapTexelToLinear(texture2D(texture, vUv)); + vec4 getTexture( sampler2D texture ) { + + return mapTexelToLinear( texture2D( texture , vUv ) ); + } void main() { - vec4 mask = getTexture(maskTexture); - vec4 texel = getTexture(baseTexture); - gl_FragColor = isVisible(mask) ? (texel + vec4(1.0) * getTexture(glowTexture)) : texel; + vec4 mask = getTexture( maskTexture ); + vec4 texel = getTexture( baseTexture ); + gl_FragColor = isVisible( mask ) ? ( texel + vec4( 1.0 ) * getTexture( glowTexture ) ) : texel; + } </script> @@ -101,22 +104,22 @@ var ENTIRE_SCENE = 0, BLOOM_SCENE = 1; var bloomLayer = new THREE.Layers(); - bloomLayer.set(BLOOM_SCENE); + bloomLayer.set( BLOOM_SCENE ); var params = { exposure: 1, bloomStrength: 1.5, bloomThreshold: 0, bloomRadius: 0, - rows : 6, - columns : 6, - size : 2, - cameraAngle : Math.PI * 0.5, - scene : "Scene with Glow" + rows: 6, + columns: 6, + size: 2, + cameraAngle: Math.PI * 0.5, + scene: "Scene with Glow" }; - var lightMaterial = new THREE.MeshBasicMaterial({color : "red"}); - var darkMaterial = new THREE.MeshBasicMaterial({color : "blue"}); + var lightMaterial = new THREE.MeshBasicMaterial( { color: "red" } ); + var darkMaterial = new THREE.MeshBasicMaterial( { color: "blue" } ); var materials = {}; var container = document.getElementById( 'container' ); @@ -128,13 +131,13 @@ renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.toneMapping = THREE.ReinhardToneMapping; - document.body.appendChild(renderer.domElement); + document.body.appendChild( renderer.domElement ); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 100 ); camera.position.set( 0, 0, 30 ); - camera.lookAt(0,0,0); + camera.lookAt( 0, 0, 0 ); camera.updateProjectionMatrix(); scene.add( new THREE.AmbientLight( 0x404040 ) ); @@ -146,34 +149,34 @@ magFilter: THREE.LinearFilter, format: THREE.RGBAFormat, stencilBuffer: false - }); + } ); var bloomPass = new THREE.UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), 1.5, 0.4, 0.85 ); bloomPass.threshold = params.bloomThreshold; bloomPass.strength = params.bloomStrength; bloomPass.radius = params.bloomRadius; - var bloomComposer = new THREE.EffectComposer( renderer); + var bloomComposer = new THREE.EffectComposer( renderer ); bloomComposer.renderToScreen = false; bloomComposer.setSize( window.innerWidth, window.innerHeight ); bloomComposer.addPass( renderScene ); bloomComposer.addPass( bloomPass ); var finalPass = new THREE.ShaderPass( - new THREE.ShaderMaterial({ - uniforms : { - baseTexture : {value : null}, - glowTexture: { value : bloomComposer.renderTarget2.texture}, - maskTexture: {value : maskRenderTarget.texture} + new THREE.ShaderMaterial( { + uniforms: { + baseTexture: { value: null }, + glowTexture: { value: bloomComposer.renderTarget2.texture }, + maskTexture: { value: maskRenderTarget.texture } }, vertexShader: document.getElementById( 'vertexshader' ).textContent, fragmentShader: document.getElementById( 'fragmentshader' ).textContent, defines: {} - }), "baseTexture" + } ), "baseTexture" ); finalPass.needsSwap = true; - var finalComposer = new THREE.EffectComposer( renderer); + var finalComposer = new THREE.EffectComposer( renderer ); finalComposer.setSize( window.innerWidth, window.innerHeight ); finalComposer.addPass( renderScene ); finalComposer.addPass( finalPass ); @@ -184,14 +187,14 @@ var mouse = new THREE.Vector2(); - window.addEventListener('click', onDocumentMouseClick, false); + window.addEventListener( 'click', onDocumentMouseClick, false ); var gui = new dat.GUI(); - gui.add(params, 'scene', ['Scene with Glow', 'Glow only', 'Mask only', 'Scene only']).onChange(function(value) - { - switch(value) - { + gui.add( params, 'scene', [ 'Scene with Glow', 'Glow only', 'Mask only', 'Scene only' ] ).onChange( function ( value ) { + + switch ( value ) { + case 'Scene with Glow': bloomComposer.renderToScreen = false; break; @@ -202,10 +205,13 @@ case 'Mask only': // nothing to do break; + } - }); - var folder = gui.addFolder('Bloom Parameters'); + } ); + + + var folder = gui.addFolder( 'Bloom Parameters' ); folder.add( params, 'exposure', 0.1, 2 ).onChange( function ( value ) { @@ -231,23 +237,24 @@ } ); - folder = gui.addFolder('Object parameters'); + folder = gui.addFolder( 'Object parameters' ); - folder.add( params, 'rows', 1, 20 ).step(1).onChange( setupBoxes ); + folder.add( params, 'rows', 1, 20 ).step( 1 ).onChange( setupBoxes ); - folder.add( params, 'columns', 1, 20 ).step(1).onChange( setupBoxes); + folder.add( params, 'columns', 1, 20 ).step( 1 ).onChange( setupBoxes ); - folder.add( params, 'size', 0.1, 3 ).onChange( setupBoxes); + folder.add( params, 'size', 0.1, 3 ).onChange( setupBoxes ); - folder = gui.addFolder('Camera Position'); + folder = gui.addFolder( 'Camera Position' ); - folder.add(params, 'cameraAngle', 0, Math.PI * 2).step(0.001).onChange(function(value) - { - camera.position.x = Math.cos(value) * 30; - camera.position.z = Math.sin(value) * 30; - camera.lookAt(0,0,0); + folder.add( params, 'cameraAngle', 0, Math.PI * 2 ).step( 0.001 ).onChange( function ( value ) { + + camera.position.x = Math.cos( value ) * 30; + camera.position.z = Math.sin( value ) * 30; + camera.lookAt( 0, 0, 0 ); camera.updateProjectionMatrix(); - }) + + } ); animate(); @@ -258,13 +265,15 @@ mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; - raycaster.setFromCamera(mouse, camera); - var intersects = raycaster.intersectObjects(scene.children); - if(intersects.length > 0) - { - var object = intersects[0].object; - object.layers.toggle(BLOOM_SCENE); + raycaster.setFromCamera( mouse, camera ); + var intersects = raycaster.intersectObjects( scene.children ); + if ( intersects.length > 0 ) { + + var object = intersects[ 0 ].object; + object.layers.toggle( BLOOM_SCENE ); + } + } window.onresize = function () { @@ -277,30 +286,34 @@ renderer.setSize( width, height ); - maskRenderTarget.setSize( width, height); + maskRenderTarget.setSize( width, height ); bloomComposer.setSize( width, height ); - finalComposer.setSize(width, height); + finalComposer.setSize( width, height ); + }; - function setupBoxes() - { + function setupBoxes() { + var columns = params.columns; var rows = params.rows; var size = params.size; scene.children.length = 0; - for(var x = -columns * size / 2; x < columns * size / 2; x += size) - { - for(var y = -rows * size / 2; y < rows * size / 2; y += size) - { - var box = new THREE.Mesh(new THREE.BoxBufferGeometry(size,size,size), new THREE.MeshBasicMaterial({ - color: Math.floor(Math.random() * 0xffffff) - })); - box.position.set(x,y,0); - scene.add(box); - if(Math.random() < 0.5) box.layers.enable(BLOOM_SCENE); + for ( var x = - columns * size / 2; x < columns * size / 2; x += size ) { + + for ( var y = - rows * size / 2; y < rows * size / 2; y += size ) { + + var box = new THREE.Mesh( new THREE.BoxBufferGeometry( size, size, size ), new THREE.MeshBasicMaterial( { + color: Math.floor( Math.random() * 0xffffff ) + } ) ); + box.position.set( x, y, 0 ); + scene.add( box ); + if ( Math.random() < 0.5 ) box.layers.enable( BLOOM_SCENE ); + } + } + } function animate() { @@ -309,65 +322,74 @@ stats.update(); - switch(params.scene) - { - case 'Glow only': - renderBloom(); - break; + switch ( params.scene ) { + case 'Mask only': - renderMask(null); + renderMask( null ); break; case 'Scene only': - renderer.setRenderTarget(null); - renderer.render(scene, camera); + renderer.setRenderTarget( null ); + renderer.render( scene, camera ); + break; + case 'Glow only': + renderBloom(); break; case 'Scene with Glow': default: // render scene with bloom renderBloom(); // render scene masked - renderMask(maskRenderTarget); - + renderMask( maskRenderTarget ); + // render the entire scene // render bloom on top of scene but only where isn't masked finalComposer.render(); break; + } + } - function renderBloom() - { - camera.layers.set(BLOOM_SCENE); + function renderBloom() { + + camera.layers.set( BLOOM_SCENE ); bloomComposer.render(); + } - function renderMask(renderTarget) - { - camera.layers.set(ENTIRE_SCENE); - scene.traverse(maskMaterial); - renderer.setRenderTarget(renderTarget); - renderer.render(scene, camera); - scene.traverse(restoreMaterial); + function renderMask( renderTarget ) { + + camera.layers.set( ENTIRE_SCENE ); + scene.traverse( maskMaterial ); + renderer.setRenderTarget( renderTarget ); + renderer.render( scene, camera ); + scene.traverse( restoreMaterial ); + } - function maskMaterial(obj) - { - if(obj.isMesh) - { - materials[obj.uuid] = obj.material; - obj.material = bloomLayer.test(obj.layers) ? lightMaterial : darkMaterial; + function maskMaterial( obj ) { + + if ( obj.isMesh ) { + + materials[ obj.uuid ] = obj.material; + obj.material = bloomLayer.test( obj.layers ) ? lightMaterial : darkMaterial; + } + } - function restoreMaterial(obj) - { - if(obj.isMesh) - { - obj.material = materials[obj.uuid]; + function restoreMaterial( obj ) { + + if ( obj.isMesh ) { + + obj.material = materials[ obj.uuid ]; + } + } + </script> </body>
false
Other
mrdoob
three.js
d21e2691910b917b64db2228c06d7aa210471638.json
Add selective bloom example
examples/webgl_postprocessing_unreal_bloom_selective.html
@@ -0,0 +1,314 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>three.js webgl - postprocessing - unreal bloom selective</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + <style> + body { + color: #fff; + font-family:Monospace; + font-size:13px; + text-align:center; + background-color: #fff; + margin: 0px; + overflow: hidden; + } + #info { + position: absolute; + top: 0px; + width: 100%; + padding: 5px; + } + #info p { + max-width: 600px; + margin-left: auto; + margin-right: auto; + padding: 0 2em; + } + a { + color: #2983ff; + } + </style> + </head> + + <body> + + <div id="container"></div> + + <div id="info"> + <a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> Click on a box to toggle bloom + </div> + + <script src="../build/three.js"></script> + + <script src="js/libs/stats.min.js"></script> + <script src="js/libs/dat.gui.min.js"></script> + + <script src="js/postprocessing/EffectComposer.js"></script> + <script src="js/postprocessing/RenderPass.js"></script> + <script src="js/postprocessing/ShaderPass.js"></script> + <script src="js/shaders/CopyShader.js"></script> + <script src="js/shaders/LuminosityHighPassShader.js"></script> + <script src="js/postprocessing/UnrealBloomPass.js"></script> + + <script type="x-shader/x-vertex" id="vertexshader"> + + varying vec2 vUv; + + void main() { + + vUv = uv; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + } + + </script> + + <script type="x-shader/x-fragment" id="fragmentshader"> + + uniform sampler2D baseTexture; + uniform sampler2D glowTexture; + uniform sampler2D shadowTexture; + + uniform vec3 color; + uniform float intensity; + + varying vec2 vUv; + + void main() { + + //vec4 shadow = texture2D(shadowTexture, vUv); + //if(shadow.a > 0.0) {discard;} + gl_FragColor = texture2D(baseTexture, vUv) + vec4(color, 1.0) * texture2D(glowTexture, vUv) * intensity; + + } + + </script> + + <script> + + var scene, camera, stats; + var renderer; + + var ENTIRE_SCENE = 0, BLOOM_SCENE = 1, SHADOW_SCENE = 2; + + var params = { + exposure: 1, + bloomStrength: 1.5, + bloomThreshold: 0, + bloomRadius: 0, + showBloom : true, + rows : 6, + columns : 6, + size : 2, + cameraAngle : Math.PI * 0.5 + }; + + var container = document.getElementById( 'container' ); + + stats = new Stats(); + container.appendChild( stats.dom ); + + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.toneMapping = THREE.ReinhardToneMapping; + document.body.appendChild(renderer.domElement); + + scene = new THREE.Scene(); + + camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 100 ); + camera.position.set( 0, 0, 30 ); + camera.lookAt(0,0,0); + camera.updateProjectionMatrix(); + + scene.add( new THREE.AmbientLight( 0x404040 ) ); + + var renderScene = new THREE.RenderPass( scene, camera ); + + var shadowComposer = new THREE.EffectComposer( renderer); + shadowComposer.renderToScreen = false; + shadowComposer.setSize( window.innerWidth, window.innerHeight ); + shadowComposer.addPass( renderScene ); + + var bloomPass = new THREE.UnrealBloomPass( new THREE.Vector2( window.innerWidth, window.innerHeight ), 1.5, 0.4, 0.85 ); + bloomPass.threshold = params.bloomThreshold; + bloomPass.strength = params.bloomStrength; + bloomPass.radius = params.bloomRadius; + + var bloomComposer = new THREE.EffectComposer( renderer); + bloomComposer.renderToScreen = false; + bloomComposer.setSize( window.innerWidth, window.innerHeight ); + bloomComposer.addPass( renderScene ); + bloomComposer.addPass( bloomPass ); + + var finalPass = new THREE.ShaderPass( + new THREE.ShaderMaterial({ + uniforms : { + baseTexture : {value : null}, + glowTexture: { value : bloomComposer.renderTarget2.texture}, + // shadowTexture: {value : shadowComposer.renderTarget2.texture}, + intensity : {value : 1.0}, + color : {value : new THREE.Color(1.0, 1.0, 1.0)} + }, + vertexShader: document.getElementById( 'vertexshader' ).textContent, + fragmentShader: document.getElementById( 'fragmentshader' ).textContent, + defines: {} + }), "baseTexture" + ); + finalPass.needsSwap = true; + + var finalComposer = new THREE.EffectComposer( renderer); + finalComposer.setSize( window.innerWidth, window.innerHeight ); + finalComposer.addPass( renderScene ); + finalComposer.addPass( finalPass ); + + setupBoxes(); + + var raycaster = new THREE.Raycaster(); + + var mouse = new THREE.Vector2(); + + window.addEventListener('click', onDocumentMouseClick, false); + + var gui = new dat.GUI(); + + var folder = gui.addFolder('Bloom Parameters') + + folder.add( params, 'exposure', 0.1, 2 ).onChange( function ( value ) { + + renderer.toneMappingExposure = Math.pow( value, 4.0 ); + + } ); + + folder.add( params, 'bloomThreshold', 0.0, 1.0 ).onChange( function ( value ) { + + bloomPass.threshold = Number( value ); + + } ); + + folder.add( params, 'bloomStrength', 0.0, 3.0 ).onChange( function ( value ) { + + bloomPass.strength = Number( value ); + + } ); + + folder.add( params, 'bloomRadius', 0.0, 1.0 ).step( 0.01 ).onChange( function ( value ) { + + bloomPass.radius = Number( value ); + + } ); + + folder.add( params, 'showBloom').onChange(function(value) + { + finalPass.enabled = value; + }); + + folder.open(); + + folder = gui.addFolder('Object parameters'); + + folder.add( params, 'rows', 1, 20 ).step(1).onChange( setupBoxes ); + + folder.add( params, 'columns', 1, 20 ).step(1).onChange( setupBoxes); + + folder.add( params, 'size', 0.1, 3 ).onChange( setupBoxes); + + folder = gui.addFolder('Camera Position'); + + folder.add(params, 'cameraAngle', 0, Math.PI * 2).step(0.001).onChange(function(value) + { + camera.position.x = Math.cos(value) * 30; + camera.position.z = Math.sin(value) * 30; + camera.lookAt(0,0,0); + camera.updateProjectionMatrix(); + }) + + animate(); + + function onDocumentMouseClick( event ) { + + event.preventDefault(); + + mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; + mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; + + raycaster.setFromCamera(mouse, camera); + var intersects = raycaster.intersectObjects(scene.children); + if(intersects.length > 0) + { + var object = intersects[0].object; + object.layers.toggle(BLOOM_SCENE); + if(object.layers.test(BLOOM_SCENE)) + { + object.layers.disable(SHADOW_SCENE); + } + else + { + object.layers.enable(SHADOW_SCENE); + } + } + } + + window.onresize = function () { + + var width = window.innerWidth; + var height = window.innerHeight; + + camera.aspect = width / height; + camera.updateProjectionMatrix(); + + renderer.setSize( width, height ); + + // render targets are resized by respective composers + bloomComposer.setSize( width, height ); + finalComposer.setSize(width, height); + }; + + function setupBoxes() + { + var columns = params.columns; + var rows = params.rows; + var size = params.size; + scene.children.length = 0; + for(var x = -columns * size / 2; x < columns * size / 2; x += size) + { + for(var y = -rows * size / 2; y < rows * size / 2; y += size) + { + var box = new THREE.Mesh(new THREE.BoxBufferGeometry(size,size,size), new THREE.MeshBasicMaterial({ + color: Math.floor(Math.random() * 0xffffff) + })); + box.layers.enable(SHADOW_SCENE); + box.position.set(x,y,0); + scene.add(box); + } + } + } + + function animate() { + + requestAnimationFrame( animate ); + + stats.update(); + + // render scene with shadows + camera.layers.set(SHADOW_SCENE); + shadowComposer.render(); + + // render scene with bloom + camera.layers.set(BLOOM_SCENE); + bloomComposer.render(); + + // render scene the entire scene + // render bloom on top of scene but discard pixels where the shadows are present + camera.layers.set(ENTIRE_SCENE); + finalComposer.render(); + } + + </script> + + </body> + +</html>
false
Other
mrdoob
three.js
c5f771fbb43056dd862ba1d87d531fa2418030c4.json
Add check for bounding sphere
editor/js/Sidebar.Geometry.js
@@ -179,6 +179,11 @@ Sidebar.Geometry = function ( editor ) { } + if ( geometry.boundingSphere === null ) { + + geometry.computeBoundingSphere(); + + } geometryBoundingSphere.setValue( Math.floor( geometry.boundingSphere.radius * 1000 ) / 1000 ); } else {
false
Other
mrdoob
three.js
274503f36d26803216d2cb3c5687ed44445f033b.json
remove author line
src/objects/Points.js
@@ -8,7 +8,6 @@ import { BufferGeometry } from '../core/BufferGeometry.js'; /** * @author alteredq / http://alteredqualia.com/ - * @author Lewy Blue / https://discoverthreejs.com/ */ function Points( geometry, material ) {
false
Other
mrdoob
three.js
b4734f2dad51aecf65d3d764f45751e42162da83.json
Accomodate additional WebXR changes
examples/js/vr/WebVR.js
@@ -81,7 +81,15 @@ var WEBVR = { if ( currentSession === null ) { - device.requestSession( { immersive: true, exclusive: true /* DEPRECATED */ } ).then( onSessionStarted ); + if (device) { + + device.requestSession( { immersive: true, exclusive: true /* DEPRECATED */ } ).then( onSessionStarted ); + + } else { + + navigator.xr.requestSession( { mode: 'immersive-vr' } ).then( onSessionStarted ); + + } } else { @@ -91,7 +99,11 @@ var WEBVR = { }; - renderer.vr.setDevice( device ); + if ( device ) { + + renderer.vr.setDevice( device ); + + } } @@ -138,13 +150,23 @@ var WEBVR = { stylizeElement( button ); - navigator.xr.requestDevice().then( function ( device ) { + if (navigator.xr.supportsSessionMode) { + + navigator.xr.supportsSessionMode( 'immersive-vr' ).then( function () { + showEnterXR( ); + }); + + } else { - device.supportsSession( { immersive: true, exclusive: true /* DEPRECATED */ } ) - .then( function () { showEnterXR( device ); } ) - .catch( showVRNotFound ); + navigator.xr.requestDevice().then( function ( device ) { - } ).catch( showVRNotFound ); + device.supportsSession( { immersive: true, exclusive: true /* DEPRECATED */ } ) + .then( function () { showEnterXR( device ); } ) + .catch( showVRNotFound ); + + } ).catch( showVRNotFound ); + + } return button;
true
Other
mrdoob
three.js
b4734f2dad51aecf65d3d764f45751e42162da83.json
Accomodate additional WebXR changes
src/renderers/WebGLRenderer.js
@@ -189,7 +189,8 @@ function WebGLRenderer( parameters ) { antialias: _antialias, premultipliedAlpha: _premultipliedAlpha, preserveDrawingBuffer: _preserveDrawingBuffer, - powerPreference: _powerPreference + powerPreference: _powerPreference, + xrCompatible: true }; // event listeners must be registered before WebGL context is created, see #12753
true
Other
mrdoob
three.js
b4734f2dad51aecf65d3d764f45751e42162da83.json
Accomodate additional WebXR changes
src/renderers/webvr/WebXRManager.js
@@ -115,8 +115,11 @@ function WebXRManager( renderer ) { frameOfReference = value; - renderer.setFramebuffer( session.baseLayer.framebuffer ); + if ( session.baseLayer && session.baseLayer.framebuffer ) { + renderer.setFramebuffer( session.baseLayer.framebuffer ); + + } animation.setContext( session ); animation.start(); @@ -145,7 +148,15 @@ function WebXRManager( renderer ) { session.addEventListener( 'selectend', onSessionEvent ); session.addEventListener( 'end', onSessionEnd ); - session.baseLayer = new XRWebGLLayer( session, gl, { framebufferScaleFactor: framebufferScaleFactor } ); + if ( session.updateRenderState !== undefined ) { + + session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } ); + + } else { + + session.baseLayer = new XRWebGLLayer( session, gl, { framebufferScaleFactor: framebufferScaleFactor } ); + + } if ( session.requestFrameOfReference !== undefined ) { @@ -247,9 +258,15 @@ function WebXRManager( renderer ) { if ( pose !== null ) { - var layer = session.baseLayer; + var layer = 'renderState' in session ? session.renderState.baseLayer : session.baseLayer; var views = frame.views || pose.views; + if ( 'renderState' in session ) { + + renderer.setFramebuffer( session.renderState.baseLayer.framebuffer ); + + } + for ( var i = 0; i < views.length; i ++ ) { var view = views[ i ];
true
Other
mrdoob
three.js
85115334dfb18e1ccc32e8628a2238aed0bba56c.json
Remove outdated type definitions in uniforms
examples/js/effects/OutlineEffect.js
@@ -66,9 +66,9 @@ THREE.OutlineEffect = function ( renderer, parameters ) { }; var uniformsChunk = { - outlineThickness: { type: "f", value: defaultThickness }, - outlineColor: { type: "c", value: defaultColor }, - outlineAlpha: { type: "f", value: defaultAlpha } + outlineThickness: { value: defaultThickness }, + outlineColor: { value: defaultColor }, + outlineAlpha: { value: defaultAlpha } }; var vertexShaderChunk = [
true
Other
mrdoob
three.js
85115334dfb18e1ccc32e8628a2238aed0bba56c.json
Remove outdated type definitions in uniforms
examples/js/shaders/DepthLimitedBlurShader.js
@@ -5,14 +5,14 @@ THREE.DepthLimitedBlurShader = { 'PERSPECTIVE_CAMERA': 1 }, uniforms: { - 'tDiffuse': { type: 't', value: null }, - 'size': { type: 'v2', value: new THREE.Vector2( 512, 512 ) }, - 'sampleUvOffsets': { type: 'v2v', value: [ new THREE.Vector2( 0, 0 ) ] }, - 'sampleWeights': { type: '1fv', value: [ 1.0 ] }, - 'tDepth': { type: 't', value: null }, - 'cameraNear': { type: 'f', value: 10 }, - 'cameraFar': { type: 'f', value: 1000 }, - 'depthCutoff': { type: 'f', value: 10 }, + 'tDiffuse': { value: null }, + 'size': { value: new THREE.Vector2( 512, 512 ) }, + 'sampleUvOffsets': { value: [ new THREE.Vector2( 0, 0 ) ] }, + 'sampleWeights': { value: [ 1.0 ] }, + 'tDepth': { value: null }, + 'cameraNear': { value: 10 }, + 'cameraFar': { value: 1000 }, + 'depthCutoff': { value: 10 }, }, vertexShader: [ "#include <common>",
true
Other
mrdoob
three.js
85115334dfb18e1ccc32e8628a2238aed0bba56c.json
Remove outdated type definitions in uniforms
examples/js/shaders/LuminosityHighPassShader.js
@@ -11,11 +11,11 @@ THREE.LuminosityHighPassShader = { uniforms: { - "tDiffuse": { type: "t", value: null }, - "luminosityThreshold": { type: "f", value: 1.0 }, - "smoothWidth": { type: "f", value: 1.0 }, - "defaultColor": { type: "c", value: new THREE.Color( 0x000000 ) }, - "defaultOpacity": { type: "f", value: 0.0 } + "tDiffuse": { value: null }, + "luminosityThreshold": { value: 1.0 }, + "smoothWidth": { value: 1.0 }, + "defaultColor": { value: new THREE.Color( 0x000000 ) }, + "defaultOpacity": { value: 0.0 } },
true
Other
mrdoob
three.js
85115334dfb18e1ccc32e8628a2238aed0bba56c.json
Remove outdated type definitions in uniforms
examples/js/shaders/SAOShader.js
@@ -9,23 +9,23 @@ THREE.SAOShader = { }, uniforms: { - 'tDepth': { type: 't', value: null }, - 'tDiffuse': { type: 't', value: null }, - 'tNormal': { type: 't', value: null }, - 'size': { type: 'v2', value: new THREE.Vector2( 512, 512 ) }, - - 'cameraNear': { type: 'f', value: 1 }, - 'cameraFar': { type: 'f', value: 100 }, - 'cameraProjectionMatrix': { type: 'm4', value: new THREE.Matrix4() }, - 'cameraInverseProjectionMatrix': { type: 'm4', value: new THREE.Matrix4() }, - - 'scale': { type: 'f', value: 1.0 }, - 'intensity': { type: 'f', value: 0.1 }, - 'bias': { type: 'f', value: 0.5 }, - - 'minResolution': { type: 'f', value: 0.0 }, - 'kernelRadius': { type: 'f', value: 100.0 }, - 'randomSeed': { type: 'f', value: 0.0 } + 'tDepth': { value: null }, + 'tDiffuse': { value: null }, + 'tNormal': { value: null }, + 'size': { value: new THREE.Vector2( 512, 512 ) }, + + 'cameraNear': { value: 1 }, + 'cameraFar': { value: 100 }, + 'cameraProjectionMatrix': { value: new THREE.Matrix4() }, + 'cameraInverseProjectionMatrix': { value: new THREE.Matrix4() }, + + 'scale': { value: 1.0 }, + 'intensity': { value: 0.1 }, + 'bias': { value: 0.5 }, + + 'minResolution': { value: 0.0 }, + 'kernelRadius': { value: 100.0 }, + 'randomSeed': { value: 0.0 } }, vertexShader: [ "varying vec2 vUv;",
true
Other
mrdoob
three.js
85115334dfb18e1ccc32e8628a2238aed0bba56c.json
Remove outdated type definitions in uniforms
examples/webgl_materials_lightmap.html
@@ -102,10 +102,10 @@ var vertexShader = document.getElementById( 'vertexShader' ).textContent; var fragmentShader = document.getElementById( 'fragmentShader' ).textContent; var uniforms = { - topColor: { type: "c", value: new THREE.Color( 0x0077ff ) }, - bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) }, - offset: { type: "f", value: 400 }, - exponent: { type: "f", value: 0.6 } + topColor: { value: new THREE.Color( 0x0077ff ) }, + bottomColor: { value: new THREE.Color( 0xffffff ) }, + offset: { value: 400 }, + exponent: { value: 0.6 } }; uniforms.topColor.value.copy( light.color );
true
Other
mrdoob
three.js
b2d8566d015b908e0b6b1cb75d111d53a967f462.json
update error message
src/objects/Points.js
@@ -146,7 +146,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), { if ( ! geometry.isBufferGeometry && geometry.morphTargets !== undefined && geometry.morphTargets.length > 0 ) { - console.error( 'THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); + console.error( 'THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' ); return; @@ -187,5 +187,4 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), { } ); - export { Points };
false
Other
mrdoob
three.js
760da5943d6d31caa739772f15704b95f8e3a2ae.json
Improve code style
examples/js/loaders/SVGLoader.js
@@ -122,8 +122,16 @@ THREE.SVGLoader.prototype = { transformStack.pop(); - if ( transformStack.length > 0 ) currentTransform.copy( transformStack[ transformStack.length - 1 ] ); - else currentTransform.identity(); + if ( transformStack.length > 0 ) { + + currentTransform.copy( transformStack[ transformStack.length - 1 ] ); + + } + else { + + currentTransform.identity(); + + } }
false
Other
mrdoob
three.js
849ae475584dcd49293a57ec1c2edde7269693a2.json
Remove a wrong comment
src/renderers/webgl/WebGLRenderLists.d.ts
@@ -45,9 +45,5 @@ export class WebGLRenderList { export class WebGLRenderLists { dispose(): void; - /** - * - * returns {<String> : <WebGLRenderList>} - */ get(scene: Scene, camera: Camera): WebGLRenderList; }
false
Other
mrdoob
three.js
0ed9bdc25b3b5474c3797ade3f444a506f3e0a99.json
Make normals and uvs optional
examples/js/loaders/SVGLoader.js
@@ -1143,8 +1143,9 @@ THREE.SVGLoader.pointsToStrokeWithBuffers = function () { // This function can be called to update existing arrays or buffers. // Accepts same parameters as pointsToStroke, plus the buffers and optional offset. // Param vertexOffset: Offset vertices to start writing in the buffers (3 elements/vertex for vertices and normals, and 2 elements/vertex for uvs) - // Returns number of written vertices / normals / uvs + // Returns number of written vertices / normals / uvs pairs // if 'vertices' parameter is undefined no triangles will be generated, but the returned vertices count will still be valid (useful to preallocate the buffers) + // 'normals' and 'uvs' buffers are optional arcLengthDivisions = arcDivisions !== undefined ? arcDivisions : 12; minDistance = minDistance !== undefined ? minDistance : 0.001; @@ -1564,15 +1565,24 @@ THREE.SVGLoader.pointsToStrokeWithBuffers = function () { vertices[ currentCoordinate + 1 ] = position.y; vertices[ currentCoordinate + 2 ] = 0; - normals[ currentCoordinate ] = 0; - normals[ currentCoordinate + 1 ] = 0; - normals[ currentCoordinate + 2 ] = 1; + if ( normals ) { - uvs[ currentCoordinateUV ] = u; - uvs[ currentCoordinateUV + 1 ] = v; + normals[ currentCoordinate ] = 0; + normals[ currentCoordinate + 1 ] = 0; + normals[ currentCoordinate + 2 ] = 1; + + } currentCoordinate += 3; - currentCoordinateUV += 2; + + if ( uvs ) { + + uvs[ currentCoordinateUV ] = u; + uvs[ currentCoordinateUV + 1 ] = v; + + currentCoordinateUV += 2; + + } }
false
Other
mrdoob
three.js
a4b1b6df12603da17e5cb0d7e5325d6649106c39.json
Add stroke generation to SVGLoader
examples/files.js
@@ -44,6 +44,7 @@ var files = { "webgl_geometry_terrain_raycast", "webgl_geometry_text", "webgl_geometry_text_shapes", + "webgl_geometry_text_stroke", "webgl_hdr", "webgl_helpers", "webgl_interactive_buffergeometry",
true
Other
mrdoob
three.js
a4b1b6df12603da17e5cb0d7e5325d6649106c39.json
Add stroke generation to SVGLoader
examples/js/loaders/SVGLoader.js
@@ -56,37 +56,37 @@ THREE.SVGLoader.prototype = { case 'path': style = parseStyle( node, style ); - if ( node.hasAttribute( 'd' ) && isVisible( style ) ) path = parsePathNode( node, style ); + if ( node.hasAttribute( 'd' ) ) path = parsePathNode( node, style ); break; case 'rect': style = parseStyle( node, style ); - if ( isVisible( style ) ) path = parseRectNode( node, style ); + path = parseRectNode( node, style ); break; case 'polygon': style = parseStyle( node, style ); - if ( isVisible( style ) ) path = parsePolygonNode( node, style ); + path = parsePolygonNode( node, style ); break; case 'polyline': style = parseStyle( node, style ); - if ( isVisible( style ) ) path = parsePolylineNode( node, style ); + path = parsePolylineNode( node, style ); break; case 'circle': style = parseStyle( node, style ); - if ( isVisible( style ) ) path = parseCircleNode( node, style ); + path = parseCircleNode( node, style ); break; case 'ellipse': style = parseStyle( node, style ); - if ( isVisible( style ) ) path = parseEllipseNode( node, style ); + path = parseEllipseNode( node, style ); break; case 'line': style = parseStyle( node, style ); - if ( isVisible( style ) ) path = parseLineNode( node, style ); + path = parseLineNode( node, style ); break; default: @@ -96,9 +96,16 @@ THREE.SVGLoader.prototype = { if ( path ) { + if ( style.fill !== undefined && style.fill !== 'none' ) { + + path.color.setStyle( style.fill ); + + } + transformPath( path, currentTransform ); paths.push( path ); + path.userData = { node: node, style: style }; } @@ -122,7 +129,6 @@ THREE.SVGLoader.prototype = { function parsePathNode( node, style ) { var path = new THREE.ShapePath(); - path.color.setStyle( style.fill ); var point = new THREE.Vector2(); var control = new THREE.Vector2(); @@ -545,7 +551,6 @@ THREE.SVGLoader.prototype = { var h = parseFloat( node.getAttribute( 'height' ) ); var path = new THREE.ShapePath(); - path.color.setStyle( style.fill ); path.moveTo( x + 2 * rx, y ); path.lineTo( x + w - 2 * rx, y ); if ( rx !== 0 || ry !== 0 ) path.bezierCurveTo( x + w, y, x + w, y, x + w, y + 2 * ry ); @@ -591,7 +596,6 @@ THREE.SVGLoader.prototype = { var regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g; var path = new THREE.ShapePath(); - path.color.setStyle( style.fill ); var index = 0; @@ -623,7 +627,6 @@ THREE.SVGLoader.prototype = { var regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g; var path = new THREE.ShapePath(); - path.color.setStyle( style.fill ); var index = 0; @@ -645,7 +648,6 @@ THREE.SVGLoader.prototype = { subpath.absarc( x, y, r, 0, Math.PI * 2 ); var path = new THREE.ShapePath(); - path.color.setStyle( style.fill ); path.subPaths.push( subpath ); return path; @@ -663,7 +665,6 @@ THREE.SVGLoader.prototype = { subpath.absellipse( x, y, rx, ry, 0, Math.PI * 2 ); var path = new THREE.ShapePath(); - path.color.setStyle( style.fill ); path.subPaths.push( subpath ); return path; @@ -692,19 +693,37 @@ THREE.SVGLoader.prototype = { style = Object.assign( {}, style ); // clone style - if ( node.hasAttribute( 'fill' ) ) style.fill = node.getAttribute( 'fill' ); - if ( node.style.fill !== '' ) style.fill = node.style.fill; + function addStyle( svgName, jsName, adjustFunction ) { - if ( node.hasAttribute( 'fill-opacity' ) ) style.fillOpacity = node.getAttribute( 'fill-opacity' ); - if ( node.style.fillOpacity !== '' ) style.fillOpacity = node.style.fillOpacity; + if ( adjustFunction === undefined ) adjustFunction = function copy( v ) { return v; }; - return style; + if ( node.hasAttribute( svgName ) ) style[ jsName ] = adjustFunction( node.getAttribute( svgName ) ); + if ( node.style[ svgName ] !== '' ) style[ jsName ] = adjustFunction( node.style[ svgName ] ); - } + } + + function clamp( v ) { + + return Math.max( 0, Math.min( 1, v ) ); + + } - function isVisible( style ) { + function positive( v ) { - return style.fill !== 'none' && style.fill !== 'transparent'; + return Math.max( 0, v ); + + } + + addStyle( 'fill', 'fill' ); + addStyle( 'fill-opacity', 'fillOpacity', clamp ); + addStyle( 'stroke', 'stroke' ); + addStyle( 'stroke-opacity', 'strokeOpacity', clamp ); + addStyle( 'stroke-width', 'strokeWidth', positive ); + addStyle( 'stroke-linejoin', 'strokeLineJoin' ); + addStyle( 'stroke-linecap', 'strokeLineCap' ); + addStyle( 'stroke-miterlimit', 'strokeMiterLimit', positive ); + + return style; } @@ -754,7 +773,7 @@ THREE.SVGLoader.prototype = { return null; } - var transform = parseTransformNode( node ); + var transform = parseNodeTransform( node ); if ( transform ) { @@ -771,13 +790,13 @@ THREE.SVGLoader.prototype = { } - function parseTransformNode( node ) { + function parseNodeTransform( node ) { var transform = new THREE.Matrix3(); var currentTransform = tempTransform0; var transformsTexts = node.getAttribute( 'transform' ).split( ' ' ); - for ( var tIndex = transformsTexts.length - 1; tIndex >= 0; tIndex-- ) { + for ( var tIndex = transformsTexts.length - 1; tIndex >= 0; tIndex -- ) { var transformText = transformsTexts[ tIndex ]; var openParPos = transformText.indexOf( "(" ); @@ -924,9 +943,6 @@ THREE.SVGLoader.prototype = { var isRotated = isTransformRotated( m ); - var tempV2 = new THREE.Vector2(); - var tempV3 = new THREE.Vector3(); - var subPaths = path.subPaths; for ( var i = 0, n = subPaths.length; i < n; i++ ) { @@ -1004,9 +1020,13 @@ THREE.SVGLoader.prototype = { var tempTransform1 = new THREE.Matrix3(); var tempTransform2 = new THREE.Matrix3(); var tempTransform3 = new THREE.Matrix3(); + var tempV2 = new THREE.Vector2(); + var tempV3 = new THREE.Vector3(); var currentTransform = new THREE.Matrix3(); + var scope = this; + console.time( 'THREE.SVGLoader: DOMParser' ); var xml = new DOMParser().parseFromString( text, 'image/svg+xml' ); // application/xml @@ -1015,18 +1035,837 @@ THREE.SVGLoader.prototype = { console.time( 'THREE.SVGLoader: Parse' ); - parseNode( xml.documentElement, { fill: '#000' } ); - + parseNode( xml.documentElement, { + fill: '#000', + fillOpacity: 1, + strokeOpacity: 1, + strokeWidth: 1, + strokeLineJoin: 'miter', + strokeLineCap: 'butt', + strokeMiterLimit: 4 + } ); + var data = { paths: paths, xml: xml.documentElement }; // console.log( paths ); console.timeEnd( 'THREE.SVGLoader: Parse' ); - return data; } }; + +THREE.SVGLoader.getStrokeStyle = function ( width, color, opacity, lineJoin, lineCap, miterLimit ) { + + // Param width: Stroke width + // Param color: As returned by THREE.Color.getStyle() + // Param opacity: 0 (transparent) to 1 (opaque) + // Param lineJoin: One of "round", "bevel", "miter" or "miter-limit" + // Param lineCap: One of "round", "square" or "butt" + // Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance) + // Returns style object + + width = width !== undefined ? width : 1; + color = color !== undefined ? color : '#000'; + opacity = opacity !== undefined ? opacity : 1; + lineJoin = lineJoin !== undefined ? lineJoin : 'miter'; + lineCap = lineCap !== undefined ? lineCap : 'butt'; + miterLimit = miterLimit !== undefined ? miterLimit : 4; + + return { + strokeColor: color, + strokeWidth: width, + strokeLineJoin: lineJoin, + strokeLineCap: lineCap, + strokeMiterLimit: miterLimit + }; + +}; + +THREE.SVGLoader.pointsToStroke = function ( points, style, arcDivisions, minDistance ) { + + // Generates a stroke with some witdh around the given path. + // The path can be open or closed (last point equals to first point) + // Param points: Array of Vector2D (the path). Minimum 2 points. + // Param style: Object with SVG properties as returned by SVGLoader.getStrokeStyle(), or SVGLoader.parse() in the path.userData.style object + // Params arcDivisions: Arc divisions for round joins and endcaps. (Optional) + // Param minDistance: Points closer to this distance will be merged. (Optional) + // Returns BufferGeometry with stroke triangles (In plane z = 0). UV coordinates are generated ('u' along path. 'v' across it, from left to right) + + var vertices = []; + var normals = []; + var uvs = []; + + if ( THREE.SVGLoader.pointsToStrokeWithBuffers( points, style, arcDivisions, minDistance, vertices, normals, uvs ) === 0 ) { + + return null; + + } + + var geometry = new THREE.BufferGeometry(); + geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); + geometry.addAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) ); + geometry.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) ); + + return geometry; + +}; + +THREE.SVGLoader.pointsToStrokeWithBuffers = function () { + + var tempV2_1 = new THREE.Vector2(); + var tempV2_2 = new THREE.Vector2(); + var tempV2_3 = new THREE.Vector2(); + var tempV2_4 = new THREE.Vector2(); + var tempV2_5 = new THREE.Vector2(); + var tempV2_6 = new THREE.Vector2(); + var tempV2_7 = new THREE.Vector2(); + var tempV3_1 = new THREE.Vector3(); + var lastPointL = new THREE.Vector2(); + var lastPointR = new THREE.Vector2(); + var point0L = new THREE.Vector2(); + var point0R = new THREE.Vector2(); + var currentPointL = new THREE.Vector2(); + var currentPointR = new THREE.Vector2(); + var nextPointL = new THREE.Vector2(); + var nextPointR = new THREE.Vector2(); + var innerPoint = new THREE.Vector2(); + var outerPoint = new THREE.Vector2(); + var tempTransform0 = new THREE.Matrix3(); + var tempTransform1 = new THREE.Matrix3(); + var tempTransform2 = new THREE.Matrix3(); + + return function ( points, style, arcDivisions, minDistance, vertices, normals, uvs, vertexOffset ) { + + // This function can be called to update existing arrays or buffers. + // Accepts same parameters as pointsToStroke, plus the buffers and optional offset. + // Param vertexOffset: Offset vertices to start writing in the buffers (3 elements/vertex for vertices and normals, and 2 elements/vertex for uvs) + // Returns number of written vertices / normals / uvs + // if 'vertices' parameter is undefined no triangles will be generated, but the returned vertices count will still be valid (useful to preallocate the buffers) + + arcLengthDivisions = arcDivisions !== undefined ? arcDivisions : 12; + minDistance = minDistance !== undefined ? minDistance : 0.001; + vertexOffset = vertexOffset !== undefined ? vertexOffset : 0; + + // First ensure there are no duplicated points + points = removeDuplicatedPoints( points ); + + var numPoints = points.length; + + if ( numPoints < 2 ) return 0; + + var isClosed = points[ 0 ].equals( points[ numPoints - 1 ] ); + + var currentPoint; + var previousPoint = points[ 0 ]; + var nextPoint; + + var strokeWidth2 = style.strokeWidth / 2; + + var deltaU = 1 / ( numPoints - 1 ); + var u0 = 0; + + var innerSideModified; + var joinIsOnLeftSide; + var isMiter; + var initialJoinIsOnLeftSide = false; + + var numVertices = 0; + var currentCoordinate = vertexOffset * 3; + var currentCoordinateUV = vertexOffset * 2; + + // Get initial left and right stroke points + getNormal( points[ 0 ], points[ 1 ], tempV2_1 ).multiplyScalar( strokeWidth2 ); + lastPointL.copy( points[ 0 ] ).sub( tempV2_1 ); + lastPointR.copy( points[ 0 ] ).add( tempV2_1 ); + point0L.copy( lastPointL ); + point0R.copy( lastPointR ); + + for ( var iPoint = 1; iPoint < numPoints; iPoint ++ ) { + + currentPoint = points[ iPoint ]; + + // Get next point + if ( iPoint === numPoints - 1 ) { + + if ( isClosed ) { + + // Skip duplicated initial point + nextPoint = points[ 1 ]; + + } + else nextPoint = undefined; + + } + else { + + nextPoint = points[ iPoint + 1 ]; + + } + + // Normal of previous segment in tempV2_1 + var normal1 = tempV2_1; + getNormal( previousPoint, currentPoint, normal1 ); + + tempV2_3.copy( normal1 ).multiplyScalar( strokeWidth2 ); + currentPointL.copy( currentPoint ).sub( tempV2_3 ); + currentPointR.copy( currentPoint ).add( tempV2_3 ); + + var u1 = u0 + deltaU; + + innerSideModified = false; + + if ( nextPoint !== undefined ) { + + // Normal of next segment in tempV2_2 + getNormal( currentPoint, nextPoint, tempV2_2 ); + + tempV2_3.copy( tempV2_2 ).multiplyScalar( strokeWidth2 ); + nextPointL.copy( currentPoint ).sub( tempV2_3 ); + nextPointR.copy( currentPoint ).add( tempV2_3 ); + + joinIsOnLeftSide = true; + tempV2_3.subVectors( nextPoint, previousPoint ); + if ( normal1.dot( tempV2_3 ) < 0 ) { + + joinIsOnLeftSide = false; + + } + if ( iPoint === 1 ) initialJoinIsOnLeftSide = joinIsOnLeftSide; + + tempV2_3.subVectors( nextPoint, currentPoint ) + var maxInnerDistance = tempV2_3.normalize(); + var dot = Math.abs( normal1.dot( tempV2_3 ) ); + + // If path is straight, don't create join + if ( dot !== 0 ) { + + // Compute inner and outer segment intersections + var miterSide = strokeWidth2 / dot; + tempV2_3.multiplyScalar( - miterSide ); + tempV2_4.subVectors( currentPoint, previousPoint ); + tempV2_5.copy( tempV2_4 ).setLength( miterSide ).add( tempV2_3 ); + innerPoint.copy( tempV2_5 ).negate(); + var miterLength2 = tempV2_5.length(); + var segmentLengthPrev = tempV2_4.length(); + tempV2_4.divideScalar( segmentLengthPrev ); + tempV2_6.subVectors( nextPoint, currentPoint ); + var segmentLengthNext = tempV2_6.length(); + tempV2_6.divideScalar( segmentLengthNext ); + // Check that previous and next segments doesn't overlap with the innerPoint of intersection + if ( tempV2_4.dot( innerPoint ) < segmentLengthPrev && tempV2_6.dot( innerPoint ) < segmentLengthNext ) { + + innerSideModified = true; + + } + outerPoint.copy( tempV2_5 ).add( currentPoint ); + innerPoint.add( currentPoint ); + + isMiter = false; + + if ( innerSideModified ) { + + if ( joinIsOnLeftSide ) { + + nextPointR.copy( innerPoint ); + currentPointR.copy( innerPoint ); + + } + else { + + nextPointL.copy( innerPoint ); + currentPointL.copy( innerPoint ); + + } + + } + else { + + // The segment triangles are generated here if there was overlapping + + makeSegmentTriangles(); + + } + + switch ( style.strokeLineJoin ) { + + case 'bevel': + + makeSegmentWithBevelJoin( joinIsOnLeftSide, innerSideModified, u1 ); + + break; + + case 'round': + + // Segment triangles + + createSegmentTrianglesWithMiddleSection( joinIsOnLeftSide, innerSideModified ); + + // Join triangles + + if ( joinIsOnLeftSide ) { + + makeCircularSector( currentPoint, currentPointL, nextPointL, u1, 0 ); + + } + else { + + makeCircularSector( currentPoint, nextPointR, currentPointR, u1, 1 ); + + } + + break; + + case 'miter': + case 'miter-clip': + default: + + var miterFraction = ( strokeWidth2 * style.strokeMiterLimit ) / miterLength2; + + if ( miterFraction < 1 ) { + + // The join miter length exceeds the miter limit + + if ( style.strokeLineJoin !== 'miter-clip' ) { + + makeSegmentWithBevelJoin( joinIsOnLeftSide, innerSideModified, u1 ); + break; + + } + else { + + // Segment triangles + + createSegmentTrianglesWithMiddleSection( joinIsOnLeftSide, innerSideModified ); + + // Miter-clip join triangles + + if ( joinIsOnLeftSide ) { + + tempV2_6.subVectors( outerPoint, currentPointL ).multiplyScalar( miterFraction ).add( currentPointL ); + tempV2_7.subVectors( outerPoint, nextPointL ).multiplyScalar( miterFraction ).add( nextPointL ); + + addVertex( currentPointL, u1, 0 ); + addVertex( tempV2_6, u1, 0 ); + addVertex( currentPoint, u1, 0.5 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( tempV2_6, u1, 0 ); + addVertex( tempV2_7, u1, 0 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( tempV2_7, u1, 0 ); + addVertex( nextPointL, u1, 0 ); + + } + else { + + tempV2_6.subVectors( outerPoint, currentPointR ).multiplyScalar( miterFraction ).add( currentPointR ); + tempV2_7.subVectors( outerPoint, nextPointR ).multiplyScalar( miterFraction ).add( nextPointR ); + + addVertex( currentPointR, u1, 1 ); + addVertex( tempV2_6, u1, 1 ); + addVertex( currentPoint, u1, 0.5 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( tempV2_6, u1, 1 ); + addVertex( tempV2_7, u1, 1 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( tempV2_7, u1, 1 ); + addVertex( nextPointR, u1, 1 ); + + } + + } + + } + else { + + // Miter join segment triangles + + if ( innerSideModified ) { + + // Optimized segment + join triangles + + if ( joinIsOnLeftSide ) { + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( outerPoint, u1, 0 ); + + addVertex( lastPointR, u0, 1 ); + addVertex( outerPoint, u1, 0 ); + addVertex( innerPoint, u1, 1 ); + + } + else { + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( outerPoint, u1, 1 ); + + addVertex( lastPointL, u0, 0 ); + addVertex( innerPoint, u1, 0 ); + addVertex( outerPoint, u1, 1 ); + + } + + + if ( joinIsOnLeftSide ) { + + nextPointL.copy( outerPoint ); + + } + else { + + nextPointR.copy( outerPoint ); + + } + + + } + else { + + // Add extra miter join triangles + + if ( joinIsOnLeftSide ) { + + addVertex( currentPointL, u1, 0 ); + addVertex( outerPoint, u1, 0 ); + addVertex( currentPoint, u1, 0.5 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( outerPoint, u1, 0 ); + addVertex( nextPointL, u1, 0 ); + + } + else { + + addVertex( currentPointR, u1, 1 ); + addVertex( outerPoint, u1, 1 ); + addVertex( currentPoint, u1, 0.5 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( outerPoint, u1, 1 ); + addVertex( nextPointR, u1, 1 ); + + } + + } + + isMiter = true; + + } + + break; + + } + + } + else { + + // The segment triangles are generated here when two consecutive points are collinear + + makeSegmentTriangles(); + + } + + } + else { + + // The segment triangles are generated here if it is the ending segment + + makeSegmentTriangles(); + + } + + if ( ! isClosed && iPoint === numPoints - 1 ) { + + // Start line endcap + addCapGeometry( points[ 0 ], point0L, point0R, joinIsOnLeftSide, true, u0 ); + + } + + // Increment loop variables + + u0 = u1; + + previousPoint = currentPoint; + + lastPointL.copy( nextPointL ); + lastPointR.copy( nextPointR ); + + } + + if ( ! isClosed ) { + + // Ending line endcap + addCapGeometry( currentPoint, currentPointL, currentPointR, joinIsOnLeftSide, false, u1 ); + + } + else if ( innerSideModified && vertices ) { + + // Modify path first segment vertices to adjust to the segments inner and outer intersections + + var lastOuter = outerPoint; + var lastInner = innerPoint; + if ( initialJoinIsOnLeftSide !== joinIsOnLeftSide) { + lastOuter = innerPoint; + lastInner = outerPoint; + } + + if ( joinIsOnLeftSide ) { + + lastInner.toArray( vertices, 0 * 3 ); + lastInner.toArray( vertices, 3 * 3 ); + + if ( isMiter ) { + + lastOuter.toArray( vertices, 1 * 3 ); + } + + } + else { + + lastInner.toArray( vertices, 1 * 3 ); + lastInner.toArray( vertices, 3 * 3 ); + + if ( isMiter ) { + + lastOuter.toArray( vertices, 0 * 3 ); + } + + } + + } + + return numVertices; + + // -- End of algorithm + + // -- Functions + + function getNormal( p1, p2, result ) { + + result.subVectors( p2, p1 ); + return result.set( - result.y, result.x ).normalize(); + + } + + function addVertex( position, u, v ) { + + if ( vertices ) { + + vertices[ currentCoordinate ] = position.x; + vertices[ currentCoordinate + 1 ] = position.y; + vertices[ currentCoordinate + 2 ] = 0; + + normals[ currentCoordinate ] = 0; + normals[ currentCoordinate + 1 ] = 0; + normals[ currentCoordinate + 2 ] = 1; + + uvs[ currentCoordinateUV ] = u; + uvs[ currentCoordinateUV + 1 ] = v; + + currentCoordinate += 3; + currentCoordinateUV += 2; + + } + + numVertices += 3; + + } + + function makeCircularSector( center, p1, p2, u, v ) { + + // param p1, p2: Points in the circle arc. + // p1 and p2 are in clockwise direction. + + tempV2_1.copy( p1 ).sub( center ).normalize(); + tempV2_2.copy( p2 ).sub( center ).normalize(); + + var angle = Math.PI; + var dot = tempV2_1.dot( tempV2_2 ); + if ( Math.abs( dot ) < 1 ) angle = Math.abs( Math.acos( dot ) ); + + angle /= arcLengthDivisions; + + tempV2_3.copy( p1 ); + + for ( var i = 0, il = arcLengthDivisions - 1; i < il; i++ ) { + + tempV2_4.copy( tempV2_3 ).rotateAround( center, angle ); + + addVertex( tempV2_3, u, v ); + addVertex( tempV2_4, u, v ); + addVertex( center, u, 0.5 ); + + tempV2_3.copy( tempV2_4 ); + } + + addVertex( tempV2_4, u, v ); + addVertex( p2, u, v ); + addVertex( center, u, 0.5 ); + + } + + function makeSegmentTriangles() { + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( currentPointL, u1, 0 ); + + addVertex( lastPointR, u0, 1 ); + addVertex( currentPointL, u1, 1 ); + addVertex( currentPointR, u1, 0 ); + + } + + function makeSegmentWithBevelJoin( joinIsOnLeftSide, innerSideModified, u ) { + + if ( innerSideModified ) { + + // Optimized segment + bevel triangles + + if ( joinIsOnLeftSide ) { + + // Path segments triangles + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( currentPointL, u1, 0 ); + + addVertex( lastPointR, u0, 1 ); + addVertex( currentPointL, u1, 0 ); + addVertex( innerPoint, u1, 1 ); + + // Bevel join triangle + + addVertex( currentPointL, u, 0 ); + addVertex( nextPointL, u, 0 ); + addVertex( innerPoint, u, 0.5 ); + + } + else { + + // Path segments triangles + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( currentPointR, u1, 1 ); + + addVertex( lastPointL, u0, 0 ); + addVertex( innerPoint, u1, 0 ); + addVertex( currentPointR, u1, 1 ); + + // Bevel join triangle + + addVertex( currentPointR, u, 1 ); + addVertex( nextPointR, u, 0 ); + addVertex( innerPoint, u, 0.5 ); + + } + + } + else { + + // Bevel join triangle. The segment triangles are done in the main loop + + if ( joinIsOnLeftSide ) { + + addVertex( currentPointL, u, 0 ); + addVertex( nextPointL, u, 0 ); + addVertex( currentPoint, u, 0.5 ); + + } + else { + + addVertex( currentPointR, u, 1 ); + addVertex( nextPointR, u, 0 ); + addVertex( currentPoint, u, 0.5 ); + + } + + } + + } + + function createSegmentTrianglesWithMiddleSection( joinIsOnLeftSide, innerSideModified ) { + + if ( innerSideModified ) { + + if ( joinIsOnLeftSide ) { + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( currentPointL, u1, 0 ); + + addVertex( lastPointR, u0, 1 ); + addVertex( currentPointL, u1, 0 ); + addVertex( innerPoint, u1, 1 ); + + addVertex( currentPointL, u0, 0 ); + addVertex( currentPoint, u1, 0.5 ); + addVertex( innerPoint, u1, 1 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( nextPointL, u0, 0 ); + addVertex( innerPoint, u1, 1 ); + + } + else { + + addVertex( lastPointR, u0, 1 ); + addVertex( lastPointL, u0, 0 ); + addVertex( currentPointR, u1, 1 ); + + addVertex( lastPointL, u0, 0 ); + addVertex( innerPoint, u1, 0 ); + addVertex( currentPointR, u1, 1 ); + + addVertex( currentPointR, u0, 1 ); + addVertex( innerPoint, u1, 0 ); + addVertex( currentPoint, u1, 0.5 ); + + addVertex( currentPoint, u1, 0.5 ); + addVertex( innerPoint, u1, 0 ); + addVertex( nextPointR, u0, 1 ); + + } + + } + + } + + function addCapGeometry( center, p1, p2, joinIsOnLeftSide, start, u ) { + + // param center: End point of the path + // param p1, p2: Left and right cap points + + switch ( style.strokeLineCap ) { + + case 'round': + + if ( start ) { + + makeCircularSector( center, p2, p1, u, 0.5 ); + + } + else { + + makeCircularSector( center, p1, p2, u, 0.5 ); + + } + + break; + + case 'square': + + if ( start ) { + + tempV2_1.subVectors( p1, center ); + tempV2_2.set( tempV2_1.y, - tempV2_1.x ); + + tempV2_3.addVectors( tempV2_1, tempV2_2 ).add( center ); + tempV2_4.subVectors( tempV2_2, tempV2_1 ).add( center ); + + // Modify already existing vertices + if ( joinIsOnLeftSide ) { + + tempV2_3.toArray( vertices, 1 * 3 ); + tempV2_4.toArray( vertices, 0 * 3 ); + tempV2_4.toArray( vertices, 3 * 3 ); + + } + else { + + tempV2_3.toArray( vertices, 1 * 3 ); + tempV2_3.toArray( vertices, 3 * 3 ); + tempV2_4.toArray( vertices, 0 * 3 ); + + } + + } + else { + + tempV2_1.subVectors( p2, center ); + tempV2_2.set( tempV2_1.y, - tempV2_1.x ); + + tempV2_3.addVectors( tempV2_1, tempV2_2 ).add( center ); + tempV2_4.subVectors( tempV2_2, tempV2_1 ).add( center ); + + var vl = vertices.length; + + // Modify already existing vertices + if ( joinIsOnLeftSide ) { + + tempV2_3.toArray( vertices, vl - 1 * 3 ); + tempV2_4.toArray( vertices, vl - 2 * 3 ); + tempV2_4.toArray( vertices, vl - 4 * 3 ); + + } + else { + + tempV2_3.toArray( vertices, vl - 2 * 3 ); + tempV2_4.toArray( vertices, vl - 1 * 3 ); + tempV2_4.toArray( vertices, vl - 4 * 3 ); + + } + + } + + break; + + case 'butt': + default: + + // Nothing to do here + break; + + } + + } + + function removeDuplicatedPoints( points ) { + + // Creates a new array if necessary with duplicated points removed. + // This does not remove duplicated initial and ending points of a closed path. + + var dupPoints = false; + for ( var i = 1, n = points.length - 1; i < n; i ++ ) { + + if ( points[ i ].distanceTo( points[ i + 1 ] ) < minDistance ) { + + dupPoints = true; + break; + + } + + } + + if ( ! dupPoints ) return points; + + var newPoints = []; + newPoints.push( points[ 0 ] ); + + for ( var i = 1, n = points.length - 1; i < n; i ++ ) { + + if ( points[ i ].distanceTo( points[ i + 1 ] ) >= minDistance ) { + + newPoints.push( points[ i ] ); + + } + } + + newPoints.push( points[ points.length - 1 ] ); + + return newPoints; + + } + }; + +}();
true
Other
mrdoob
three.js
a4b1b6df12603da17e5cb0d7e5325d6649106c39.json
Add stroke generation to SVGLoader
examples/models/svg/lineJoinsAndCaps.svg
@@ -0,0 +1,428 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 210 297" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="lineJoinsAndCaps.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="1163.5114" + inkscape:cy="194.79646" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1920" + inkscape:window-height="1015" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Capa 1" + inkscape:groupmode="layer" + id="layer1"> + <path + style="fill:#56bef1;fill-opacity:1;stroke:#000000;stroke-width:15.12240791;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:2.0999999;stroke-dasharray:none;stroke-opacity:1" + d="M 11.645714,137.94889 32.107527,33.104515 156.65766,13.79107 159.03004,161.95271 94.975687,86.630309 Z" + id="path815" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccc" /> + <path + sodipodi:nodetypes="cccccc" + inkscape:connector-curvature="0" + id="path824" + d="M 216.55882,139.23495 237.02062,34.39057 361.57076,15.077128 363.94313,163.23877 299.88879,87.916364 Z" + style="fill:#56bef1;fill-opacity:1;stroke:#000000;stroke-width:15.12106323;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:2.0999999;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:#56bef1;fill-opacity:1;stroke:#000000;stroke-width:15.12106323;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:2.0999999;stroke-dasharray:none;stroke-opacity:1" + d="M 421.54128,139.9001 442.00309,35.055731 566.55324,15.74229 568.92561,163.90393 504.87126,88.581525 Z" + id="path826" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccc" /> + <path + inkscape:connector-curvature="0" + id="path830" + d="m 26.903642,382.81518 107.927638,29.30033 0.66958,-68.73008" + style="fill:none;stroke:#000000;stroke-width:16.19490242;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="ccc" /> + <path + sodipodi:nodetypes="ccc" + style="fill:none;stroke:#000000;stroke-width:16.195;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 231.9558,382.81518 107.92806,29.30033 0.66958,-68.73008" + id="path4868" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4870" + d="m 437.00814,382.81518 107.92806,29.30033 0.66958,-68.73008" + style="fill:none;stroke:#000000;stroke-width:16.19499969;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:nodetypes="ccc" /> + <g + aria-label="Square endcap" + transform="matrix(0.76997327,0,0,0.76997327,398.16964,271.71599)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#000000;fill-opacity:1;stroke:none" + id="flowRoot4583"> + <path + d="m 24.595875,251.66342 q 0.992,0 1.632,-0.192 0.672,-0.224 1.056,-0.576 0.384,-0.384 0.512,-0.832 0.16,-0.48 0.16,-0.96 0,-0.608 -0.352,-1.088 -0.352,-0.48 -0.896,-0.832 -0.544,-0.384 -1.216,-0.672 -0.672,-0.32 -1.344,-0.576 -0.896,-0.32 -1.856,-0.736 -0.96,-0.416 -1.76,-1.056 -0.768,-0.64 -1.28,-1.568 -0.512,-0.96 -0.512,-2.368 0,-2.784 1.792,-4.352 1.824,-1.568 4.992,-1.568 1.824,0 3.168,0.416 1.376,0.416 2.304,0.928 l -1.152,3.04 q -0.8,-0.448 -1.792,-0.768 -0.96,-0.32 -2.24,-0.32 -3.136,0 -3.136,2.272 0,0.576 0.32,1.024 0.32,0.416 0.8,0.768 0.512,0.32 1.12,0.576 0.64,0.256 1.248,0.48 0.928,0.352 1.92,0.8 1.024,0.416 1.856,1.152 0.864,0.704 1.408,1.792 0.544,1.056 0.544,2.688 0,2.784 -1.824,4.32 -1.792,1.504 -5.472,1.504 -2.464,0 -3.936,-0.512 -1.472,-0.544 -2.208,-0.992 l 1.152,-3.2 q 0.864,0.512 2.048,0.96 1.216,0.448 2.944,0.448 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4642" + inkscape:connector-curvature="0" /> + <path + d="m 38.163875,247.15142 q 0,2.08 0.672,3.232 0.704,1.12 2.112,1.12 0.672,0 1.248,-0.16 0.608,-0.16 1.056,-0.416 v -8.256 q -0.288,-0.032 -0.8,-0.064 -0.48,-0.064 -1.024,-0.064 -1.632,0 -2.464,1.312 -0.8,1.28 -0.8,3.296 z m -4,-0.128 q 0,-1.728 0.48,-3.168 0.48,-1.472 1.376,-2.496 0.928,-1.024 2.272,-1.6 1.376,-0.576 3.104,-0.576 0.736,0 1.536,0.064 0.832,0.064 1.6,0.192 0.768,0.096 1.44,0.256 0.704,0.128 1.216,0.288 v 19.84 h -3.936 v -5.696 q -0.736,0.352 -1.568,0.544 -0.8,0.224 -1.536,0.224 -1.472,0 -2.592,-0.544 -1.12,-0.576 -1.888,-1.6 -0.736,-1.024 -1.12,-2.464 -0.384,-1.472 -0.384,-3.264 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4644" + inkscape:connector-curvature="0" /> + <path + d="m 63.187875,254.03142 q -1.088,0.288 -2.656,0.576 -1.536,0.288 -3.36,0.288 -1.856,0 -3.04,-0.512 -1.184,-0.512 -1.888,-1.44 -0.672,-0.96 -0.928,-2.24 -0.256,-1.28 -0.256,-2.816 v -8.384 h 3.936 v 7.872 q 0,2.08 0.48,3.104 0.512,0.992 1.952,0.992 0.896,0 1.792,-0.16 v -11.808 h 3.968 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4646" + inkscape:connector-curvature="0" /> + <path + d="m 73.203875,251.72742 q 0.64,0 1.248,0 0.608,-0.032 1.056,-0.096 v -3.456 q -0.384,-0.064 -0.928,-0.096 -0.544,-0.064 -0.992,-0.064 -0.608,0 -1.184,0.096 -0.576,0.064 -1.024,0.256 -0.416,0.192 -0.672,0.544 -0.256,0.352 -0.256,0.928 0,1.024 0.768,1.472 0.768,0.416 1.984,0.416 z m -0.352,-12.608 q 1.856,0 3.072,0.448 1.248,0.416 1.984,1.216 0.736,0.768 1.056,1.92 0.32,1.12 0.32,2.528 v 8.96 q -0.864,0.192 -2.56,0.448 -1.696,0.256 -3.808,0.256 -1.44,0 -2.624,-0.256 -1.152,-0.256 -1.984,-0.832 -0.832,-0.608 -1.28,-1.536 -0.448,-0.96 -0.448,-2.336 0,-1.312 0.512,-2.208 0.512,-0.896 1.376,-1.44 0.864,-0.544 1.984,-0.768 1.12,-0.256 2.336,-0.256 1.536,0 2.72,0.256 v -0.48 q 0,-1.12 -0.704,-1.856 -0.704,-0.768 -2.432,-0.768 -1.12,0 -2.176,0.16 -1.024,0.16 -1.664,0.384 l -0.544,-3.168 q 0.736,-0.256 2.08,-0.448 1.344,-0.224 2.784,-0.224 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4648" + inkscape:connector-curvature="0" /> + <path + d="m 95.155875,243.50342 q -0.384,-0.096 -0.928,-0.192 -0.512,-0.096 -1.056,-0.16 -0.544,-0.096 -1.056,-0.128 -0.512,-0.032 -0.864,-0.032 -0.832,0 -1.632,0.096 -0.8,0.064 -1.632,0.288 v 11.168 h -3.968 v -14.048 q 1.568,-0.576 3.2,-0.928 1.664,-0.352 3.872,-0.352 0.32,0 0.896,0.032 0.608,0.032 1.28,0.128 0.672,0.064 1.344,0.192 0.704,0.096 1.248,0.288 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4650" + inkscape:connector-curvature="0" /> + <path + d="m 98.163875,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.600005,-2.496 0.992,-1.024 2.27199,-1.536 1.28,-0.512 2.62401,-0.512 3.328,0 5.056,1.984 1.72799,1.952 1.72799,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76001 q 0,1.472 1.21601,2.336 1.216,0.832 3.136,0.832 1.184,0 2.23999,-0.256 1.08801,-0.256 1.824,-0.512 l 0.54401,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.50401,-0.512 -2.592,-1.472 -1.056005,-0.992 -1.632005,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.080005,-1.568 q 0,-0.608 -0.16,-1.152 -0.16001,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.34401,-0.288 -0.768,0 -1.34399,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.57601,1.024 -0.19199,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4652" + inkscape:connector-curvature="0" /> + <path + d="m 135.11387,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.6,-2.496 0.992,-1.024 2.272,-1.536 1.28,-0.512 2.624,-0.512 3.328,0 5.056,1.984 1.728,1.952 1.728,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76 q 0,1.472 1.216,2.336 1.216,0.832 3.136,0.832 1.184,0 2.24,-0.256 1.088,-0.256 1.824,-0.512 l 0.544,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.504,-0.512 -2.592,-1.472 -1.056,-0.992 -1.632,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.08,-1.568 q 0,-0.608 -0.16,-1.152 -0.16,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.344,-0.288 -0.768,0 -1.344,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.576,1.024 -0.192,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4654" + inkscape:connector-curvature="0" /> + <path + d="m 152.13787,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4656" + inkscape:connector-curvature="0" /> + <path + d="m 171.01787,246.92742 q 0,2.016 0.736,3.296 0.768,1.28 2.432,1.28 0.48,0 0.896,-0.032 0.416,-0.032 0.864,-0.096 v -8.192 q -0.448,-0.256 -1.024,-0.416 -0.576,-0.192 -1.216,-0.192 -1.408,0 -2.048,1.12 -0.64,1.12 -0.64,3.232 z m 8.864,7.168 q -1.088,0.352 -2.656,0.576 -1.568,0.224 -3.072,0.224 -3.52,0 -5.344,-2.08 -1.792,-2.08 -1.792,-5.696 0,-3.68 1.504,-5.792 1.536,-2.144 4.512,-2.144 0.8,0 1.568,0.192 0.768,0.16 1.344,0.48 v -6.848 l 3.936,-0.672 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4658" + inkscape:connector-curvature="0" /> + <path + d="m 183.52987,247.02342 q 0,-1.632 0.512,-3.072 0.512,-1.44 1.568,-2.496 1.056,-1.088 2.656,-1.696 1.632,-0.64 3.872,-0.64 1.344,0 2.432,0.192 1.088,0.192 2.208,0.64 l -0.864,3.168 q -0.64,-0.224 -1.44,-0.384 -0.768,-0.192 -1.984,-0.192 -1.408,0 -2.368,0.352 -0.928,0.32 -1.504,0.928 -0.576,0.576 -0.832,1.408 -0.256,0.832 -0.256,1.792 0,2.08 1.152,3.264 1.184,1.184 4,1.184 0.928,0 1.92,-0.128 1.024,-0.128 1.856,-0.416 l 0.576,3.232 q -0.832,0.32 -2.016,0.512 -1.184,0.224 -2.784,0.224 -2.304,0 -3.968,-0.608 -1.632,-0.608 -2.688,-1.664 -1.056,-1.056 -1.568,-2.496 -0.48,-1.44 -0.48,-3.104 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4660" + inkscape:connector-curvature="0" /> + <path + d="m 206.15387,251.72742 q 0.64,0 1.248,0 0.608,-0.032 1.056,-0.096 v -3.456 q -0.384,-0.064 -0.928,-0.096 -0.544,-0.064 -0.992,-0.064 -0.608,0 -1.184,0.096 -0.576,0.064 -1.024,0.256 -0.416,0.192 -0.672,0.544 -0.256,0.352 -0.256,0.928 0,1.024 0.768,1.472 0.768,0.416 1.984,0.416 z m -0.352,-12.608 q 1.856,0 3.072,0.448 1.248,0.416 1.984,1.216 0.736,0.768 1.056,1.92 0.32,1.12 0.32,2.528 v 8.96 q -0.864,0.192 -2.56,0.448 -1.696,0.256 -3.808,0.256 -1.44,0 -2.624,-0.256 -1.152,-0.256 -1.984,-0.832 -0.832,-0.608 -1.28,-1.536 -0.448,-0.96 -0.448,-2.336 0,-1.312 0.512,-2.208 0.512,-0.896 1.376,-1.44 0.864,-0.544 1.984,-0.768 1.12,-0.256 2.336,-0.256 1.536,0 2.72,0.256 v -0.48 q 0,-1.12 -0.704,-1.856 -0.704,-0.768 -2.432,-0.768 -1.12,0 -2.176,0.16 -1.024,0.16 -1.664,0.384 l -0.544,-3.168 q 0.736,-0.256 2.08,-0.448 1.344,-0.224 2.784,-0.224 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4662" + inkscape:connector-curvature="0" /> + <path + d="m 225.12987,247.15142 q 0,-2.016 -0.8,-3.296 -0.8,-1.312 -2.432,-1.312 -0.448,0 -0.96,0.064 -0.512,0.032 -0.864,0.064 v 8.256 q 0.384,0.256 1.024,0.416 0.64,0.16 1.28,0.16 1.408,0 2.08,-1.12 0.672,-1.152 0.672,-3.232 z m 4,-0.128 q 0,1.728 -0.384,3.2 -0.384,1.44 -1.12,2.496 -0.736,1.024 -1.856,1.6 -1.12,0.576 -2.592,0.576 -1.504,0 -3.104,-0.736 v 5.664 h -3.936 v -19.84 q 1.088,-0.352 2.656,-0.576 1.6,-0.224 3.136,-0.224 3.488,0 5.344,2.112 1.856,2.112 1.856,5.728 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4664" + inkscape:connector-curvature="0" /> + </g> + <g + aria-label="Butt endcap" + transform="matrix(0.76997327,0,0,0.76997327,207.21552,271.71599)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#000000;fill-opacity:1;stroke:none" + id="flowRoot4575"> + <path + d="m 32.179875,248.55942 q 0,1.792 -0.608,3.008 -0.608,1.184 -1.664,1.92 -1.024,0.704 -2.464,1.024 -1.408,0.288 -3.04,0.288 -1.312,0 -2.72,-0.16 -1.408,-0.128 -2.784,-0.416 v -19.232 q 1.12,-0.192 2.464,-0.32 1.344,-0.16 2.656,-0.16 2.24,0 3.648,0.48 1.408,0.448 2.208,1.216 0.8,0.736 1.088,1.664 0.288,0.928 0.288,1.856 0,1.408 -0.704,2.496 -0.672,1.088 -1.824,1.728 2.016,0.736 2.72,1.984 0.736,1.248 0.736,2.624 z m -9.344,-2.688 v 5.376 q 0.416,0.064 0.896,0.096 0.512,0.032 0.992,0.032 0.672,0 1.312,-0.096 0.64,-0.128 1.12,-0.416 0.512,-0.32 0.832,-0.864 0.32,-0.576 0.32,-1.44 0,-1.44 -0.928,-2.048 -0.896,-0.64 -2.432,-0.64 z m 1.536,-3.264 q 1.504,0 2.272,-0.64 0.768,-0.672 0.768,-1.824 0,-0.704 -0.224,-1.12 -0.224,-0.448 -0.608,-0.672 -0.384,-0.256 -0.896,-0.32 -0.512,-0.096 -1.056,-0.096 -0.448,0 -0.928,0.032 -0.48,0.032 -0.864,0.096 v 4.544 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4667" + inkscape:connector-curvature="0" /> + <path + d="m 47.187875,254.03142 q -1.088,0.288 -2.656,0.576 -1.536,0.288 -3.36,0.288 -1.856,0 -3.04,-0.512 -1.184,-0.512 -1.888,-1.44 -0.672,-0.96 -0.928,-2.24 -0.256,-1.28 -0.256,-2.816 v -8.384 h 3.936 v 7.872 q 0,2.08 0.48,3.104 0.512,0.992 1.952,0.992 0.896,0 1.792,-0.16 v -11.808 h 3.968 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4669" + inkscape:connector-curvature="0" /> + <path + d="m 53.747875,242.76742 h -3.424 v -3.264 h 3.424 v -3.776 l 3.936,-0.64 v 4.416 h 6.304 v 3.264 h -6.304 v 6.08 q 0,0.832 0.16,1.344 0.16,0.512 0.448,0.8 0.288,0.288 0.704,0.384 0.416,0.096 0.928,0.096 0.544,0 0.992,-0.032 0.48,-0.032 0.896,-0.096 0.448,-0.096 0.896,-0.256 0.48,-0.16 1.024,-0.416 l 0.544,3.392 q -1.088,0.448 -2.368,0.64 -1.248,0.192 -2.432,0.192 -1.376,0 -2.432,-0.224 -1.056,-0.224 -1.792,-0.864 -0.736,-0.64 -1.12,-1.792 -0.384,-1.184 -0.384,-3.072 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4671" + inkscape:connector-curvature="0" /> + <path + d="m 69.747875,242.76742 h -3.424 v -3.264 h 3.424 v -3.776 l 3.936,-0.64 v 4.416 h 6.304 v 3.264 h -6.304 v 6.08 q 0,0.832 0.16,1.344 0.16,0.512 0.448,0.8 0.288,0.288 0.704,0.384 0.416,0.096 0.928,0.096 0.544,0 0.992,-0.032 0.48,-0.032 0.896,-0.096 0.448,-0.096 0.896,-0.256 0.48,-0.16 1.024,-0.416 l 0.544,3.392 q -1.088,0.448 -2.368,0.64 -1.248,0.192 -2.432,0.192 -1.376,0 -2.432,-0.224 -1.056,-0.224 -1.792,-0.864 -0.736,-0.64 -1.12,-1.792 -0.384,-1.184 -0.384,-3.072 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4673" + inkscape:connector-curvature="0" /> + <path + d="m 103.11387,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.6,-2.496 0.992,-1.024 2.272,-1.536 1.28,-0.512 2.624,-0.512 3.328,0 5.056,1.984 1.728,1.952 1.728,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76 q 0,1.472 1.216,2.336 1.216,0.832 3.136,0.832 1.184,0 2.24,-0.256 1.088,-0.256 1.824,-0.512 l 0.544,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.504,-0.512 -2.592,-1.472 -1.056,-0.992 -1.632,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.08,-1.568 q 0,-0.608 -0.16,-1.152 -0.16,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.344,-0.288 -0.768,0 -1.344,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.576,1.024 -0.192,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4675" + inkscape:connector-curvature="0" /> + <path + d="m 120.13787,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4677" + inkscape:connector-curvature="0" /> + <path + d="m 139.01787,246.92742 q 0,2.016 0.736,3.296 0.768,1.28 2.432,1.28 0.48,0 0.896,-0.032 0.416,-0.032 0.864,-0.096 v -8.192 q -0.448,-0.256 -1.024,-0.416 -0.576,-0.192 -1.216,-0.192 -1.408,0 -2.048,1.12 -0.64,1.12 -0.64,3.232 z m 8.864,7.168 q -1.088,0.352 -2.656,0.576 -1.568,0.224 -3.072,0.224 -3.52,0 -5.344,-2.08 -1.792,-2.08 -1.792,-5.696 0,-3.68 1.504,-5.792 1.536,-2.144 4.512,-2.144 0.8,0 1.568,0.192 0.768,0.16 1.344,0.48 v -6.848 l 3.936,-0.672 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4679" + inkscape:connector-curvature="0" /> + <path + d="m 151.52987,247.02342 q 0,-1.632 0.512,-3.072 0.512,-1.44 1.568,-2.496 1.056,-1.088 2.656,-1.696 1.632,-0.64 3.872,-0.64 1.344,0 2.432,0.192 1.088,0.192 2.208,0.64 l -0.864,3.168 q -0.64,-0.224 -1.44,-0.384 -0.768,-0.192 -1.984,-0.192 -1.408,0 -2.368,0.352 -0.928,0.32 -1.504,0.928 -0.576,0.576 -0.832,1.408 -0.256,0.832 -0.256,1.792 0,2.08 1.152,3.264 1.184,1.184 4,1.184 0.928,0 1.92,-0.128 1.024,-0.128 1.856,-0.416 l 0.576,3.232 q -0.832,0.32 -2.016,0.512 -1.184,0.224 -2.784,0.224 -2.304,0 -3.968,-0.608 -1.632,-0.608 -2.688,-1.664 -1.056,-1.056 -1.568,-2.496 -0.48,-1.44 -0.48,-3.104 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4681" + inkscape:connector-curvature="0" /> + <path + d="m 174.15387,251.72742 q 0.64,0 1.248,0 0.608,-0.032 1.056,-0.096 v -3.456 q -0.384,-0.064 -0.928,-0.096 -0.544,-0.064 -0.992,-0.064 -0.608,0 -1.184,0.096 -0.576,0.064 -1.024,0.256 -0.416,0.192 -0.672,0.544 -0.256,0.352 -0.256,0.928 0,1.024 0.768,1.472 0.768,0.416 1.984,0.416 z m -0.352,-12.608 q 1.856,0 3.072,0.448 1.248,0.416 1.984,1.216 0.736,0.768 1.056,1.92 0.32,1.12 0.32,2.528 v 8.96 q -0.864,0.192 -2.56,0.448 -1.696,0.256 -3.808,0.256 -1.44,0 -2.624,-0.256 -1.152,-0.256 -1.984,-0.832 -0.832,-0.608 -1.28,-1.536 -0.448,-0.96 -0.448,-2.336 0,-1.312 0.512,-2.208 0.512,-0.896 1.376,-1.44 0.864,-0.544 1.984,-0.768 1.12,-0.256 2.336,-0.256 1.536,0 2.72,0.256 v -0.48 q 0,-1.12 -0.704,-1.856 -0.704,-0.768 -2.432,-0.768 -1.12,0 -2.176,0.16 -1.024,0.16 -1.664,0.384 l -0.544,-3.168 q 0.736,-0.256 2.08,-0.448 1.344,-0.224 2.784,-0.224 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4683" + inkscape:connector-curvature="0" /> + <path + d="m 193.12987,247.15142 q 0,-2.016 -0.8,-3.296 -0.8,-1.312 -2.432,-1.312 -0.448,0 -0.96,0.064 -0.512,0.032 -0.864,0.064 v 8.256 q 0.384,0.256 1.024,0.416 0.64,0.16 1.28,0.16 1.408,0 2.08,-1.12 0.672,-1.152 0.672,-3.232 z m 4,-0.128 q 0,1.728 -0.384,3.2 -0.384,1.44 -1.12,2.496 -0.736,1.024 -1.856,1.6 -1.12,0.576 -2.592,0.576 -1.504,0 -3.104,-0.736 v 5.664 h -3.936 v -19.84 q 1.088,-0.352 2.656,-0.576 1.6,-0.224 3.136,-0.224 3.488,0 5.344,2.112 1.856,2.112 1.856,5.728 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4685" + inkscape:connector-curvature="0" /> + </g> + <g + aria-label="Round endcap" + transform="matrix(0.76997327,0,0,0.76997327,-2.2173295,271.71599)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#000000;fill-opacity:1;stroke:none" + id="flowRoot4567"> + <path + d="m 24.019875,234.51142 q 1.696,0 3.072,0.384 1.376,0.384 2.368,1.184 0.992,0.8 1.504,2.048 0.544,1.216 0.544,2.88 0,1.728 -0.704,3.136 -0.704,1.408 -2.336,2.144 0.544,0.832 1.152,1.856 0.608,0.992 1.184,2.112 0.576,1.088 1.088,2.208 0.544,1.088 0.928,2.08 h -4.128 q -0.736,-1.92 -1.728,-3.68 -0.96,-1.792 -2.08,-3.616 h -2.048 v 7.296 h -3.936 v -19.52 q 0.576,-0.128 1.248,-0.224 0.704,-0.128 1.408,-0.16 0.704,-0.064 1.344,-0.096 0.64,-0.032 1.12,-0.032 z m 3.488,6.464 q 0,-1.568 -0.96,-2.304 -0.96,-0.736 -2.528,-0.736 -0.224,0 -0.544,0.032 -0.32,0 -0.64,0.064 v 5.952 h 0.864 q 2.016,0 2.912,-0.768 0.896,-0.8 0.896,-2.24 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4688" + inkscape:connector-curvature="0" /> + <path + d="m 48.275875,246.99142 q 0,1.792 -0.512,3.264 -0.512,1.44 -1.44,2.496 -0.928,1.056 -2.24,1.632 -1.28,0.576 -2.88,0.576 -1.6,0 -2.912,-0.576 -1.28,-0.576 -2.24,-1.632 -0.928,-1.056 -1.44,-2.496 -0.512,-1.472 -0.512,-3.264 0,-1.76 0.512,-3.2 0.544,-1.472 1.472,-2.496 0.96,-1.056 2.272,-1.6 1.312,-0.576 2.848,-0.576 1.568,0 2.848,0.576 1.312,0.544 2.24,1.6 0.96,1.024 1.472,2.496 0.512,1.44 0.512,3.2 z m -10.176,0.032 q 0,2.016 0.704,3.264 0.736,1.248 2.336,1.248 1.536,0 2.304,-1.248 0.8,-1.248 0.8,-3.264 0,-2.016 -0.736,-3.232 -0.704,-1.248 -2.304,-1.248 -1.536,0 -2.336,1.248 -0.768,1.216 -0.768,3.232 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4690" + inkscape:connector-curvature="0" /> + <path + d="m 63.187875,254.03142 q -1.088,0.288 -2.656,0.576 -1.536,0.288 -3.36,0.288 -1.856,0 -3.04,-0.512 -1.184,-0.512 -1.888,-1.44 -0.672,-0.96 -0.928,-2.24 -0.256,-1.28 -0.256,-2.816 v -8.384 h 3.936 v 7.872 q 0,2.08 0.48,3.104 0.512,0.992 1.952,0.992 0.896,0 1.792,-0.16 v -11.808 h 3.968 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4692" + inkscape:connector-curvature="0" /> + <path + d="m 67.187875,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4694" + inkscape:connector-curvature="0" /> + <path + d="m 86.067875,246.92742 q 0,2.016 0.736,3.296 0.768,1.28 2.432,1.28 0.48,0 0.896,-0.032 0.416,-0.032 0.864,-0.096 v -8.192 q -0.448,-0.256 -1.024,-0.416 -0.576,-0.192 -1.216,-0.192 -1.408,0 -2.048,1.12 -0.64,1.12 -0.64,3.232 z m 8.864,7.168 q -1.088,0.352 -2.656,0.576 -1.568,0.224 -3.072,0.224 -3.52,0 -5.344,-2.08 -1.792,-2.08 -1.792,-5.696 0,-3.68 1.504,-5.792 1.536,-2.144 4.512,-2.144 0.8,0 1.568,0.192 0.768,0.16 1.344,0.48 v -6.848 l 3.936,-0.672 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4696" + inkscape:connector-curvature="0" /> + <path + d="m 119.11387,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.6,-2.496 0.992,-1.024 2.272,-1.536 1.28,-0.512 2.624,-0.512 3.328,0 5.056,1.984 1.728,1.952 1.728,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76 q 0,1.472 1.216,2.336 1.216,0.832 3.136,0.832 1.184,0 2.24,-0.256 1.088,-0.256 1.824,-0.512 l 0.544,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.504,-0.512 -2.592,-1.472 -1.056,-0.992 -1.632,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.08,-1.568 q 0,-0.608 -0.16,-1.152 -0.16,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.344,-0.288 -0.768,0 -1.344,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.576,1.024 -0.192,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4698" + inkscape:connector-curvature="0" /> + <path + d="m 136.13787,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4700" + inkscape:connector-curvature="0" /> + <path + d="m 155.01787,246.92742 q 0,2.016 0.736,3.296 0.768,1.28 2.432,1.28 0.48,0 0.896,-0.032 0.416,-0.032 0.864,-0.096 v -8.192 q -0.448,-0.256 -1.024,-0.416 -0.576,-0.192 -1.216,-0.192 -1.408,0 -2.048,1.12 -0.64,1.12 -0.64,3.232 z m 8.864,7.168 q -1.088,0.352 -2.656,0.576 -1.568,0.224 -3.072,0.224 -3.52,0 -5.344,-2.08 -1.792,-2.08 -1.792,-5.696 0,-3.68 1.504,-5.792 1.536,-2.144 4.512,-2.144 0.8,0 1.568,0.192 0.768,0.16 1.344,0.48 v -6.848 l 3.936,-0.672 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4702" + inkscape:connector-curvature="0" /> + <path + d="m 167.52987,247.02342 q 0,-1.632 0.512,-3.072 0.512,-1.44 1.568,-2.496 1.056,-1.088 2.656,-1.696 1.632,-0.64 3.872,-0.64 1.344,0 2.432,0.192 1.088,0.192 2.208,0.64 l -0.864,3.168 q -0.64,-0.224 -1.44,-0.384 -0.768,-0.192 -1.984,-0.192 -1.408,0 -2.368,0.352 -0.928,0.32 -1.504,0.928 -0.576,0.576 -0.832,1.408 -0.256,0.832 -0.256,1.792 0,2.08 1.152,3.264 1.184,1.184 4,1.184 0.928,0 1.92,-0.128 1.024,-0.128 1.856,-0.416 l 0.576,3.232 q -0.832,0.32 -2.016,0.512 -1.184,0.224 -2.784,0.224 -2.304,0 -3.968,-0.608 -1.632,-0.608 -2.688,-1.664 -1.056,-1.056 -1.568,-2.496 -0.48,-1.44 -0.48,-3.104 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4704" + inkscape:connector-curvature="0" /> + <path + d="m 190.15387,251.72742 q 0.64,0 1.248,0 0.608,-0.032 1.056,-0.096 v -3.456 q -0.384,-0.064 -0.928,-0.096 -0.544,-0.064 -0.992,-0.064 -0.608,0 -1.184,0.096 -0.576,0.064 -1.024,0.256 -0.416,0.192 -0.672,0.544 -0.256,0.352 -0.256,0.928 0,1.024 0.768,1.472 0.768,0.416 1.984,0.416 z m -0.352,-12.608 q 1.856,0 3.072,0.448 1.248,0.416 1.984,1.216 0.736,0.768 1.056,1.92 0.32,1.12 0.32,2.528 v 8.96 q -0.864,0.192 -2.56,0.448 -1.696,0.256 -3.808,0.256 -1.44,0 -2.624,-0.256 -1.152,-0.256 -1.984,-0.832 -0.832,-0.608 -1.28,-1.536 -0.448,-0.96 -0.448,-2.336 0,-1.312 0.512,-2.208 0.512,-0.896 1.376,-1.44 0.864,-0.544 1.984,-0.768 1.12,-0.256 2.336,-0.256 1.536,0 2.72,0.256 v -0.48 q 0,-1.12 -0.704,-1.856 -0.704,-0.768 -2.432,-0.768 -1.12,0 -2.176,0.16 -1.024,0.16 -1.664,0.384 l -0.544,-3.168 q 0.736,-0.256 2.08,-0.448 1.344,-0.224 2.784,-0.224 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4706" + inkscape:connector-curvature="0" /> + <path + d="m 209.12987,247.15142 q 0,-2.016 -0.8,-3.296 -0.8,-1.312 -2.432,-1.312 -0.448,0 -0.96,0.064 -0.512,0.032 -0.864,0.064 v 8.256 q 0.384,0.256 1.024,0.416 0.64,0.16 1.28,0.16 1.408,0 2.08,-1.12 0.672,-1.152 0.672,-3.232 z m 4,-0.128 q 0,1.728 -0.384,3.2 -0.384,1.44 -1.12,2.496 -0.736,1.024 -1.856,1.6 -1.12,0.576 -2.592,0.576 -1.504,0 -3.104,-0.736 v 5.664 h -3.936 v -19.84 q 1.088,-0.352 2.656,-0.576 1.6,-0.224 3.136,-0.224 3.488,0 5.344,2.112 1.856,2.112 1.856,5.728 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4708" + inkscape:connector-curvature="0" /> + </g> + <g + aria-label="Miter join" + transform="matrix(0.76997327,0,0,0.76997327,421.26899,14.544752)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#000000;fill-opacity:1;stroke:none" + id="flowRoot4559"> + <path + d="m 22.323875,234.73542 q 0.224,0.672 0.544,1.728 0.352,1.056 0.736,2.272 0.384,1.216 0.768,2.464 0.384,1.248 0.736,2.304 0.384,-1.184 0.8,-2.432 0.416,-1.28 0.8,-2.432 0.384,-1.184 0.704,-2.208 0.32,-1.024 0.576,-1.696 h 3.264 q 0.224,2.592 0.416,5.056 0.224,2.464 0.352,4.896 0.16,2.4 0.256,4.864 0.096,2.432 0.16,4.992 h -3.616 l 0.192,-15.392 -2.432,8.384 h -2.88 l -2.336,-8.384 0.16,15.392 h -3.616 q 0.096,-2.432 0.192,-5.056 0.128,-2.624 0.256,-5.216 0.128,-2.592 0.288,-5.024 0.192,-2.432 0.416,-4.512 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4585" + inkscape:connector-curvature="0" /> + <path + d="m 42.259875,235.18342 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z m 5.856,18.72 q -1.216,0.576 -2.304,0.768 -1.056,0.224 -1.952,0.224 -1.536,0 -2.592,-0.448 -1.024,-0.448 -1.664,-1.28 -0.608,-0.864 -0.864,-2.08 -0.256,-1.216 -0.256,-2.784 v -5.536 h -4.16 v -3.264 h 8.096 v 9.312 q 0,1.344 0.48,2.016 0.512,0.64 1.664,0.64 0.544,0 1.312,-0.128 0.768,-0.16 1.728,-0.608 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4587" + inkscape:connector-curvature="0" /> + <path + d="m 53.747875,242.76742 h -3.424 v -3.264 h 3.424 v -3.776 l 3.936,-0.64 v 4.416 h 6.304 v 3.264 h -6.304 v 6.08 q 0,0.832 0.16,1.344 0.16,0.512 0.448,0.8 0.288,0.288 0.704,0.384 0.416,0.096 0.928,0.096 0.544,0 0.992,-0.032 0.48,-0.032 0.896,-0.096 0.448,-0.096 0.896,-0.256 0.48,-0.16 1.024,-0.416 l 0.544,3.392 q -1.088,0.448 -2.368,0.64 -1.248,0.192 -2.432,0.192 -1.376,0 -2.432,-0.224 -1.056,-0.224 -1.792,-0.864 -0.736,-0.64 -1.12,-1.792 -0.384,-1.184 -0.384,-3.072 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4589" + inkscape:connector-curvature="0" /> + <path + d="m 66.163875,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.6,-2.496 0.992,-1.024 2.272,-1.536 1.28,-0.512 2.624,-0.512 3.328,0 5.056,1.984 1.728,1.952 1.728,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76 q 0,1.472 1.216,2.336 1.216,0.832 3.136,0.832 1.184,0 2.24,-0.256 1.088,-0.256 1.824,-0.512 l 0.544,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.504,-0.512 -2.592,-1.472 -1.056,-0.992 -1.632,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.08,-1.568 q 0,-0.608 -0.16,-1.152 -0.16,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.344,-0.288 -0.768,0 -1.344,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.576,1.024 -0.192,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4591" + inkscape:connector-curvature="0" /> + <path + d="m 95.155875,243.50342 q -0.384,-0.096 -0.928,-0.192 -0.512,-0.096 -1.056,-0.16 -0.544,-0.096 -1.056,-0.128 -0.512,-0.032 -0.864,-0.032 -0.832,0 -1.632,0.096 -0.8,0.064 -1.632,0.288 v 11.168 h -3.968 v -14.048 q 1.568,-0.576 3.2,-0.928 1.664,-0.352 3.872,-0.352 0.32,0 0.896,0.032 0.608,0.032 1.28,0.128 0.672,0.064 1.344,0.192 0.704,0.096 1.248,0.288 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4593" + inkscape:connector-curvature="0" /> + <path + d="m 130.92187,253.55142 q 0,1.824 -0.448,3.04 -0.448,1.248 -1.248,1.984 -0.768,0.768 -1.856,1.088 -1.056,0.32 -2.304,0.32 -1.536,0 -2.848,-0.384 -1.312,-0.384 -2.528,-0.992 l 1.216,-3.328 q 0.8,0.448 1.92,0.832 1.152,0.416 2.08,0.416 0.992,0 1.536,-0.608 0.544,-0.576 0.544,-2.176 v -10.976 h -6.08 v -3.264 h 10.016 z m -0.48,-18.368 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4595" + inkscape:connector-curvature="0" /> + <path + d="m 149.22587,246.99142 q 0,1.792 -0.512,3.264 -0.512,1.44 -1.44,2.496 -0.928,1.056 -2.24,1.632 -1.28,0.576 -2.88,0.576 -1.6,0 -2.912,-0.576 -1.28,-0.576 -2.24,-1.632 -0.928,-1.056 -1.44,-2.496 -0.512,-1.472 -0.512,-3.264 0,-1.76 0.512,-3.2 0.544,-1.472 1.472,-2.496 0.96,-1.056 2.272,-1.6 1.312,-0.576 2.848,-0.576 1.568,0 2.848,0.576 1.312,0.544 2.24,1.6 0.96,1.024 1.472,2.496 0.512,1.44 0.512,3.2 z m -10.176,0.032 q 0,2.016 0.704,3.264 0.736,1.248 2.336,1.248 1.536,0 2.304,-1.248 0.8,-1.248 0.8,-3.264 0,-2.016 -0.736,-3.232 -0.704,-1.248 -2.304,-1.248 -1.536,0 -2.336,1.248 -0.768,1.216 -0.768,3.232 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4597" + inkscape:connector-curvature="0" /> + <path + d="m 159.20987,235.18342 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z m 5.856,18.72 q -1.216,0.576 -2.304,0.768 -1.056,0.224 -1.952,0.224 -1.536,0 -2.592,-0.448 -1.024,-0.448 -1.664,-1.28 -0.608,-0.864 -0.864,-2.08 -0.256,-1.216 -0.256,-2.784 v -5.536 h -4.16 v -3.264 h 8.096 v 9.312 q 0,1.344 0.48,2.016 0.512,0.64 1.664,0.64 0.544,0 1.312,-0.128 0.768,-0.16 1.728,-0.608 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4599" + inkscape:connector-curvature="0" /> + <path + d="m 168.13787,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4601" + inkscape:connector-curvature="0" /> + </g> + <g + aria-label="Bevel join" + transform="matrix(0.76997327,0,0,0.76997327,219.5351,14.544752)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#000000;fill-opacity:1;stroke:none" + id="flowRoot4551"> + <path + d="m 32.179875,248.55942 q 0,1.792 -0.608,3.008 -0.608,1.184 -1.664,1.92 -1.024,0.704 -2.464,1.024 -1.408,0.288 -3.04,0.288 -1.312,0 -2.72,-0.16 -1.408,-0.128 -2.784,-0.416 v -19.232 q 1.12,-0.192 2.464,-0.32 1.344,-0.16 2.656,-0.16 2.24,0 3.648,0.48 1.408,0.448 2.208,1.216 0.8,0.736 1.088,1.664 0.288,0.928 0.288,1.856 0,1.408 -0.704,2.496 -0.672,1.088 -1.824,1.728 2.016,0.736 2.72,1.984 0.736,1.248 0.736,2.624 z m -9.344,-2.688 v 5.376 q 0.416,0.064 0.896,0.096 0.512,0.032 0.992,0.032 0.672,0 1.312,-0.096 0.64,-0.128 1.12,-0.416 0.512,-0.32 0.832,-0.864 0.32,-0.576 0.32,-1.44 0,-1.44 -0.928,-2.048 -0.896,-0.64 -2.432,-0.64 z m 1.536,-3.264 q 1.504,0 2.272,-0.64 0.768,-0.672 0.768,-1.824 0,-0.704 -0.224,-1.12 -0.224,-0.448 -0.608,-0.672 -0.384,-0.256 -0.896,-0.32 -0.512,-0.096 -1.056,-0.096 -0.448,0 -0.928,0.032 -0.48,0.032 -0.864,0.096 v 4.544 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4604" + inkscape:connector-curvature="0" /> + <path + d="m 34.163875,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.6,-2.496 0.992,-1.024 2.272,-1.536 1.28,-0.512 2.624,-0.512 3.328,0 5.056,1.984 1.728,1.952 1.728,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76 q 0,1.472 1.216,2.336 1.216,0.832 3.136,0.832 1.184,0 2.24,-0.256 1.088,-0.256 1.824,-0.512 l 0.544,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.504,-0.512 -2.592,-1.472 -1.056,-0.992 -1.632,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.08,-1.568 q 0,-0.608 -0.16,-1.152 -0.16,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.344,-0.288 -0.768,0 -1.344,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.576,1.024 -0.192,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4606" + inkscape:connector-curvature="0" /> + <path + d="m 55.379875,254.54342 q -1.44,-2.848 -2.944,-6.656 -1.472,-3.84 -2.816,-8.384 h 4.128 q 0.288,1.216 0.672,2.592 0.416,1.376 0.864,2.784 0.448,1.376 0.896,2.688 0.48,1.312 0.896,2.4 0.416,-1.088 0.928,-2.4 0.512,-1.312 0.992,-2.688 0.512,-1.408 0.96,-2.784 0.48,-1.376 0.768,-2.592 h 4 q -1.344,4.544 -2.976,8.384 -1.632,3.808 -3.072,6.656 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4608" + inkscape:connector-curvature="0" /> + <path + d="m 66.163875,247.15142 q 0,-1.984 0.608,-3.488 0.608,-1.504 1.6,-2.496 0.992,-1.024 2.272,-1.536 1.28,-0.512 2.624,-0.512 3.328,0 5.056,1.984 1.728,1.952 1.728,5.728 0,0.384 -0.032,0.8 0,0.416 -0.032,0.672 h -9.76 q 0,1.472 1.216,2.336 1.216,0.832 3.136,0.832 1.184,0 2.24,-0.256 1.088,-0.256 1.824,-0.512 l 0.544,3.36 q -1.024,0.352 -2.176,0.576 -1.152,0.256 -2.592,0.256 -1.92,0 -3.456,-0.48 -1.504,-0.512 -2.592,-1.472 -1.056,-0.992 -1.632,-2.432 -0.576,-1.44 -0.576,-3.36 z m 10.08,-1.568 q 0,-0.608 -0.16,-1.152 -0.16,-0.576 -0.512,-1.024 -0.352,-0.448 -0.896,-0.704 -0.544,-0.288 -1.344,-0.288 -0.768,0 -1.344,0.256 -0.544,0.256 -0.928,0.704 -0.352,0.448 -0.576,1.024 -0.192,0.576 -0.256,1.184 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4610" + inkscape:connector-curvature="0" /> + <path + d="m 96.115875,253.90342 q -0.096,0.064 -0.448,0.224 -0.32,0.16 -0.864,0.352 -0.544,0.16 -1.344,0.288 -0.768,0.128 -1.76,0.128 -2.72,0 -3.968,-1.6 -1.248,-1.632 -1.248,-4.736 v -12.768 h -4.16 v -3.264 h 8.096 v 16.32 q 0,1.536 0.608,2.08 0.608,0.544 1.536,0.544 1.184,0 1.984,-0.32 0.8,-0.32 1.056,-0.416 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4612" + inkscape:connector-curvature="0" /> + <path + d="m 130.92187,253.55142 q 0,1.824 -0.448,3.04 -0.448,1.248 -1.248,1.984 -0.768,0.768 -1.856,1.088 -1.056,0.32 -2.304,0.32 -1.536,0 -2.848,-0.384 -1.312,-0.384 -2.528,-0.992 l 1.216,-3.328 q 0.8,0.448 1.92,0.832 1.152,0.416 2.08,0.416 0.992,0 1.536,-0.608 0.544,-0.576 0.544,-2.176 v -10.976 h -6.08 v -3.264 h 10.016 z m -0.48,-18.368 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4614" + inkscape:connector-curvature="0" /> + <path + d="m 149.22587,246.99142 q 0,1.792 -0.512,3.264 -0.512,1.44 -1.44,2.496 -0.928,1.056 -2.24,1.632 -1.28,0.576 -2.88,0.576 -1.6,0 -2.912,-0.576 -1.28,-0.576 -2.24,-1.632 -0.928,-1.056 -1.44,-2.496 -0.512,-1.472 -0.512,-3.264 0,-1.76 0.512,-3.2 0.544,-1.472 1.472,-2.496 0.96,-1.056 2.272,-1.6 1.312,-0.576 2.848,-0.576 1.568,0 2.848,0.576 1.312,0.544 2.24,1.6 0.96,1.024 1.472,2.496 0.512,1.44 0.512,3.2 z m -10.176,0.032 q 0,2.016 0.704,3.264 0.736,1.248 2.336,1.248 1.536,0 2.304,-1.248 0.8,-1.248 0.8,-3.264 0,-2.016 -0.736,-3.232 -0.704,-1.248 -2.304,-1.248 -1.536,0 -2.336,1.248 -0.768,1.216 -0.768,3.232 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4616" + inkscape:connector-curvature="0" /> + <path + d="m 159.20987,235.18342 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z m 5.856,18.72 q -1.216,0.576 -2.304,0.768 -1.056,0.224 -1.952,0.224 -1.536,0 -2.592,-0.448 -1.024,-0.448 -1.664,-1.28 -0.608,-0.864 -0.864,-2.08 -0.256,-1.216 -0.256,-2.784 v -5.536 h -4.16 v -3.264 h 8.096 v 9.312 q 0,1.344 0.48,2.016 0.512,0.64 1.664,0.64 0.544,0 1.312,-0.128 0.768,-0.16 1.728,-0.608 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4618" + inkscape:connector-curvature="0" /> + <path + d="m 168.13787,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4620" + inkscape:connector-curvature="0" /> + </g> + <g + aria-label="Round join" + transform="matrix(0.76997327,0,0,0.76997327,11.64219,14.544752)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#000000;fill-opacity:1;stroke:none" + id="flowRoot4537"> + <path + d="m 24.019875,234.51142 q 1.696,0 3.072,0.384 1.376,0.384 2.368,1.184 0.992,0.8 1.504,2.048 0.544,1.216 0.544,2.88 0,1.728 -0.704,3.136 -0.704,1.408 -2.336,2.144 0.544,0.832 1.152,1.856 0.608,0.992 1.184,2.112 0.576,1.088 1.088,2.208 0.544,1.088 0.928,2.08 h -4.128 q -0.736,-1.92 -1.728,-3.68 -0.96,-1.792 -2.08,-3.616 h -2.048 v 7.296 h -3.936 v -19.52 q 0.576,-0.128 1.248,-0.224 0.704,-0.128 1.408,-0.16 0.704,-0.064 1.344,-0.096 0.64,-0.032 1.12,-0.032 z m 3.488,6.464 q 0,-1.568 -0.96,-2.304 -0.96,-0.736 -2.528,-0.736 -0.224,0 -0.544,0.032 -0.32,0 -0.64,0.064 v 5.952 h 0.864 q 2.016,0 2.912,-0.768 0.896,-0.8 0.896,-2.24 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4623" + inkscape:connector-curvature="0" /> + <path + d="m 48.275875,246.99142 q 0,1.792 -0.512,3.264 -0.512,1.44 -1.44,2.496 -0.928,1.056 -2.24,1.632 -1.28,0.576 -2.88,0.576 -1.6,0 -2.912,-0.576 -1.28,-0.576 -2.24,-1.632 -0.928,-1.056 -1.44,-2.496 -0.512,-1.472 -0.512,-3.264 0,-1.76 0.512,-3.2 0.544,-1.472 1.472,-2.496 0.96,-1.056 2.272,-1.6 1.312,-0.576 2.848,-0.576 1.568,0 2.848,0.576 1.312,0.544 2.24,1.6 0.96,1.024 1.472,2.496 0.512,1.44 0.512,3.2 z m -10.176,0.032 q 0,2.016 0.704,3.264 0.736,1.248 2.336,1.248 1.536,0 2.304,-1.248 0.8,-1.248 0.8,-3.264 0,-2.016 -0.736,-3.232 -0.704,-1.248 -2.304,-1.248 -1.536,0 -2.336,1.248 -0.768,1.216 -0.768,3.232 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4625" + inkscape:connector-curvature="0" /> + <path + d="m 63.187875,254.03142 q -1.088,0.288 -2.656,0.576 -1.536,0.288 -3.36,0.288 -1.856,0 -3.04,-0.512 -1.184,-0.512 -1.888,-1.44 -0.672,-0.96 -0.928,-2.24 -0.256,-1.28 -0.256,-2.816 v -8.384 h 3.936 v 7.872 q 0,2.08 0.48,3.104 0.512,0.992 1.952,0.992 0.896,0 1.792,-0.16 v -11.808 h 3.968 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4627" + inkscape:connector-curvature="0" /> + <path + d="m 67.187875,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4629" + inkscape:connector-curvature="0" /> + <path + d="m 86.067875,246.92742 q 0,2.016 0.736,3.296 0.768,1.28 2.432,1.28 0.48,0 0.896,-0.032 0.416,-0.032 0.864,-0.096 v -8.192 q -0.448,-0.256 -1.024,-0.416 -0.576,-0.192 -1.216,-0.192 -1.408,0 -2.048,1.12 -0.64,1.12 -0.64,3.232 z m 8.864,7.168 q -1.088,0.352 -2.656,0.576 -1.568,0.224 -3.072,0.224 -3.52,0 -5.344,-2.08 -1.792,-2.08 -1.792,-5.696 0,-3.68 1.504,-5.792 1.536,-2.144 4.512,-2.144 0.8,0 1.568,0.192 0.768,0.16 1.344,0.48 v -6.848 l 3.936,-0.672 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4631" + inkscape:connector-curvature="0" /> + <path + d="m 130.92187,253.55142 q 0,1.824 -0.448,3.04 -0.448,1.248 -1.248,1.984 -0.768,0.768 -1.856,1.088 -1.056,0.32 -2.304,0.32 -1.536,0 -2.848,-0.384 -1.312,-0.384 -2.528,-0.992 l 1.216,-3.328 q 0.8,0.448 1.92,0.832 1.152,0.416 2.08,0.416 0.992,0 1.536,-0.608 0.544,-0.576 0.544,-2.176 v -10.976 h -6.08 v -3.264 h 10.016 z m -0.48,-18.368 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4633" + inkscape:connector-curvature="0" /> + <path + d="m 149.22587,246.99142 q 0,1.792 -0.512,3.264 -0.512,1.44 -1.44,2.496 -0.928,1.056 -2.24,1.632 -1.28,0.576 -2.88,0.576 -1.6,0 -2.912,-0.576 -1.28,-0.576 -2.24,-1.632 -0.928,-1.056 -1.44,-2.496 -0.512,-1.472 -0.512,-3.264 0,-1.76 0.512,-3.2 0.544,-1.472 1.472,-2.496 0.96,-1.056 2.272,-1.6 1.312,-0.576 2.848,-0.576 1.568,0 2.848,0.576 1.312,0.544 2.24,1.6 0.96,1.024 1.472,2.496 0.512,1.44 0.512,3.2 z m -10.176,0.032 q 0,2.016 0.704,3.264 0.736,1.248 2.336,1.248 1.536,0 2.304,-1.248 0.8,-1.248 0.8,-3.264 0,-2.016 -0.736,-3.232 -0.704,-1.248 -2.304,-1.248 -1.536,0 -2.336,1.248 -0.768,1.216 -0.768,3.232 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4635" + inkscape:connector-curvature="0" /> + <path + d="m 159.20987,235.18342 q 0,1.152 -0.736,1.824 -0.736,0.672 -1.76,0.672 -1.024,0 -1.76,-0.672 -0.704,-0.672 -0.704,-1.824 0,-1.184 0.704,-1.856 0.736,-0.672 1.76,-0.672 1.024,0 1.76,0.672 0.736,0.672 0.736,1.856 z m 5.856,18.72 q -1.216,0.576 -2.304,0.768 -1.056,0.224 -1.952,0.224 -1.536,0 -2.592,-0.448 -1.024,-0.448 -1.664,-1.28 -0.608,-0.864 -0.864,-2.08 -0.256,-1.216 -0.256,-2.784 v -5.536 h -4.16 v -3.264 h 8.096 v 9.312 q 0,1.344 0.48,2.016 0.512,0.64 1.664,0.64 0.544,0 1.312,-0.128 0.768,-0.16 1.728,-0.608 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4637" + inkscape:connector-curvature="0" /> + <path + d="m 168.13787,239.98342 q 1.056,-0.288 2.592,-0.544 1.568,-0.256 3.392,-0.256 1.792,0 2.976,0.512 1.184,0.48 1.856,1.408 0.704,0.896 0.992,2.176 0.288,1.248 0.288,2.784 v 8.48 h -3.936 v -7.968 q 0,-2.112 -0.48,-3.04 -0.48,-0.928 -1.952,-0.928 -0.448,0 -0.896,0.032 -0.416,0.032 -0.896,0.096 v 11.808 h -3.936 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:32px;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold'" + id="path4639" + inkscape:connector-curvature="0" /> + </g> + </g> +</svg>
true
Other
mrdoob
three.js
a4b1b6df12603da17e5cb0d7e5325d6649106c39.json
Add stroke generation to SVGLoader
examples/models/svg/threejs.svg
@@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 210 297" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="threejs.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.25000001" + inkscape:cx="533.56472" + inkscape:cy="387.42134" + inkscape:document-units="mm" + inkscape:current-layer="flowRoot886" + showgrid="false" + inkscape:window-width="1920" + inkscape:window-height="1015" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:snap-global="false" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Capa 1" + inkscape:groupmode="layer" + id="layer1"> + <g + aria-label="Three.js" + transform="matrix(1.4760313,0,0,1.4760313,-85.535562,-805.12602)" + style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:0;font-family:sans-serif;letter-spacing:0px;word-spacing:4.94999981px;fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:6.85148048;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="flowRoot886"> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#d5a063;stroke-width:16.33271599;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M -34.843672,735.8507 A 91.365098,299.21622 83.501293 0 1 227.96853,616.3661 91.365098,299.21622 83.501293 0 1 557.92046,662.5428" + id="path849" + inkscape:connector-curvature="0" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#c6be72;stroke-width:13.32288837;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M -5.039649,732.2031 A 68.474724,265.65322 83.501293 0 1 229.68767,638.40964 68.474724,265.65322 83.501293 0 1 521.24821,667.80071" + id="path852" + inkscape:connector-curvature="0" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#c6aa72;stroke-width:10.7236681;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 17.771095,729.41199 A 48.859142,241.20674 83.501293 0 1 232.35237,656.60683 48.859142,241.20674 83.501293 0 1 495.51719,670.94944" + id="path857" + inkscape:connector-curvature="0" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#c6be72;stroke-width:13.32288837;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="m 521.24821,667.80071 a 68.474724,265.65322 83.501293 0 1 0.0774,0.16447" + id="path854" + inkscape:connector-curvature="0" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#c6aa72;stroke-width:10.7236681;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="m 495.51719,670.94944 a 48.859142,241.20674 83.501293 0 1 0.26282,0.44309" + id="path859" + inkscape:connector-curvature="0" /> + <path + style="opacity:1;fill:#506de4;fill-opacity:1;stroke:#72c6c6;stroke-width:13.32288837;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path825" + sodipodi:type="arc" + sodipodi:cx="253.33569" + sodipodi:cy="704.37823" + sodipodi:rx="150.21419" + sodipodi:ry="141.25153" + sodipodi:start="6.2129773" + sodipodi:end="6.1973326" + d="M 403.17982,694.46939 A 150.21419,141.25153 0 0 1 264.45925,845.24194 150.21419,141.25153 0 0 1 103.57858,715.38896 150.21419,141.25153 0 0 1 241.04068,563.60065 150.21419,141.25153 0 0 1 402.99663,692.2663" + sodipodi:open="true" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#c6aa72;stroke-width:10.7236681;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 496.15836,672.11609 A 48.859142,241.20674 83.501293 0 1 280.74287,749.14475 48.859142,241.20674 83.501293 0 1 18.98356,733.7558 48.859142,241.20674 83.501293 0 1 17.771095,729.41199" + id="path834" + inkscape:connector-curvature="0" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#c6be72;stroke-width:13.32288837;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 521.76824,668.98919 A 68.474724,265.65322 83.501293 0 1 286.2917,769.37635 68.474724,265.65322 83.501293 0 1 -3.522802,739.03402 68.474724,265.65322 83.501293 0 1 -5.039649,732.2031" + id="path827" + inkscape:connector-curvature="0" /> + <path + style="opacity:0.93199978;fill:none;fill-opacity:1;stroke:#d5a063;stroke-width:16.33271599;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 558.44409,663.9168 A 91.365098,299.21622 83.501293 0 1 294.93737,792.08838 91.365098,299.21622 83.501293 0 1 -32.974239,744.90661 91.365098,299.21622 83.501293 0 1 -34.843672,735.8507" + id="path829" + inkscape:connector-curvature="0" /> + <path + d="m 29.808444,700.17242 64.851248,-8.46579 1.459387,16.82538 -23.329483,3.04548 6.028117,69.49866 -18.145153,2.36871 -6.028117,-69.49868 -23.376612,3.05162 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path911" + inkscape:connector-curvature="0" /> + <path + d="m 160.3733,730.55057 3.42029,39.43269 -16.9669,2.21489 -0.55668,-6.41794 -2.05116,-23.64805 q -0.73722,-8.49943 -1.34296,-11.6364 -0.55861,-3.14315 -1.44308,-4.54801 -1.16526,-1.89446 -2.95724,-2.77155 -1.79699,-0.9349 -3.96498,-0.65188 -5.2786,0.68908 -7.85862,6.11311 -2.58504,5.3662 -1.81773,14.21254 l 2.76331,31.85838 -16.87265,2.20259 -7.80345,-89.96667 16.87264,-2.20259 3.00904,34.69153 q 3.32607,-6.16464 7.38424,-9.38419 4.05313,-3.27739 9.23747,-3.95416 9.14327,-1.19358 14.45309,5.07166 5.35695,6.25908 6.49537,19.38405 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path913" + inkscape:connector-curvature="0" /> + <path + d="m 214.6602,715.68683 q -2.32546,-0.98285 -4.59074,-1.27188 -2.22315,-0.353 -4.43828,-0.0639 -6.50398,0.84905 -9.5924,6.45638 -3.04632,5.54338 -2.21883,15.08355 l 2.58778,29.83469 -16.87263,2.20259 -5.61689,-64.7575 16.87265,-2.20258 0.92277,10.63874 q 2.70032,-6.78464 6.64417,-10.22316 3.98595,-3.50252 9.87722,-4.27157 0.84836,-0.11077 1.84812,-0.12438 0.99474,-0.0713 2.90503,-0.0284 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path915" + inkscape:connector-curvature="0" /> + <path + d="m 277.09908,722.27137 0.51154,5.89756 -39.44805,5.14961 q 1.2446,7.20523 5.23672,10.36795 3.99211,3.16272 10.59035,2.30138 5.32571,-0.69523 10.72158,-3.32925 5.43799,-2.698 10.98826,-7.39877 l 1.38415,15.95811 q -5.74481,3.55668 -11.61,5.72571 -5.86016,2.22684 -11.84571,3.00819 -14.3276,1.87036 -23.06494,-5.99404 -8.69522,-7.92835 -10.09442,-24.05992 -1.37413,-15.84245 5.61499,-25.93521 7.03626,-10.09893 20.70404,-11.88315 12.44239,-1.62425 20.68637,6.59692 8.29111,8.215 9.62512,23.59491 z M 259.15835,717.655 q -0.51154,-5.89756 -3.65029,-9.1132 -3.09664,-3.27962 -7.62115,-2.68899 -4.90155,0.63986 -7.66912,4.45111 -2.7726,3.75342 -2.97502,10.21198 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path917" + inkscape:connector-curvature="0" /> + <path + d="m 342.51589,713.73175 0.51153,5.89755 -39.44803,5.14962 q 1.24459,7.20523 5.2367,10.36795 3.99212,3.16272 10.59035,2.30137 5.32572,-0.69523 10.7216,-3.32924 5.43799,-2.698 10.98824,-7.39877 l 1.38416,15.9581 q -5.74481,3.55668 -11.61,5.72571 -5.86017,2.22683 -11.84571,3.0082 -14.3276,1.87035 -23.06493,-5.99404 -8.69522,-7.92836 -10.09443,-24.05992 -1.37413,-15.84246 5.61499,-25.93522 7.03626,-10.09893 20.70403,-11.88314 12.4424,-1.62426 20.68638,6.59692 8.29111,8.21499 9.62512,23.59491 z m -17.94073,-4.61637 q -0.51154,-5.89756 -3.65028,-9.1132 -3.09665,-3.27963 -7.62115,-2.68899 -4.90155,0.63986 -7.66912,4.45111 -2.77261,3.75342 -2.97503,10.21197 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path919" + inkscape:connector-curvature="0" /> + <path + d="m 357.86753,722.01911 16.9669,-2.21489 1.94083,22.37605 -16.96689,2.21488 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path921" + inkscape:connector-curvature="0" /> + <path + d="m 389.20928,675.06636 16.87263,-2.20257 5.51658,63.60111 q 1.12839,13.00931 -3.3699,20.49645 -4.49327,7.54494 -14.15498,8.8062 l -8.34206,1.08899 -1.17854,-13.58751 2.92208,-0.38146 q 4.80729,-0.62755 6.36754,-3.52103 1.56026,-2.89347 0.88323,-10.69906 z m -2.18658,-25.20916 16.87264,-2.20258 1.4644,16.8832 -16.87264,2.20259 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path923" + inkscape:connector-curvature="0" /> + <path + d="m 463.80349,667.37529 1.3641,15.72681 q -5.6607,-2.06778 -10.824,-2.79712 -5.1633,-0.72936 -9.64068,-0.14486 -4.80728,0.62755 -7.03341,2.43847 -2.18399,1.74696 -1.9182,4.81136 0.21565,2.48624 2.07481,3.58843 1.9063,1.09606 6.5331,1.13527 l 3.01434,0.13277 q 13.13635,0.33173 18.01494,4.37279 4.87858,4.04105 5.73615,13.92814 0.89771,10.34963 -4.87214,16.36548 -5.76984,6.01586 -18.11796,7.6278 -5.23146,0.68292 -10.93024,0.37433 -5.64663,-0.25694 -11.71344,-1.51155 l -1.3641,-15.72682 q 5.30372,2.34828 10.71271,3.1625 5.4561,0.80807 10.92322,0.0944 4.94868,-0.64601 7.30114,-2.64884 2.35248,-2.00285 2.06661,-5.29853 -0.24072,-2.77533 -2.09989,-3.87753 -1.81705,-1.16618 -7.01944,-1.2472 l -3.00933,-0.0749 q -11.41458,-0.26413 -16.34531,-4.35686 -4.93073,-4.09271 -5.75822,-13.63288 -0.89268,-10.29182 4.42592,-16.01487 5.3186,-5.72306 17.19543,-7.27348 4.66588,-0.60909 9.87832,-0.41242 5.21242,0.19667 11.40557,1.25937 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:96px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#66b57f;fill-opacity:1;stroke:#192ea7;stroke-width:7.67327881;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path925" + inkscape:connector-curvature="0" /> + </g> + </g> +</svg>
true
Other
mrdoob
three.js
a4b1b6df12603da17e5cb0d7e5325d6649106c39.json
Add stroke generation to SVGLoader
examples/webgl_geometry_text_stroke.html
@@ -0,0 +1,168 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>three.js webgl - Simple text from json</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + <style> + body { + font-family: Monospace; + background-color: #f0f0f0; + margin: 0px; + overflow: hidden; + } + #info { + position: absolute; + top: 10px; + width: 100%; + text-align: center; + } + </style> + </head> + <body> + <div id="info"> + <a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> webgl - Simple text from json fonts. + </div> + + <script src="../build/three.js"></script> + <script src="js/controls/OrbitControls.js"></script> + <script src="js/loaders/SVGLoader.js"></script> + + <script> + + var camera, scene, renderer; + + init(); + animate(); + + function init( ) { + + camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 ); + camera.position.set( 0, - 400, 600 ); + + var controls = new THREE.OrbitControls( camera ); + controls.target.set( 0, 0, 0 ); + controls.update(); + + scene = new THREE.Scene(); + scene.background = new THREE.Color( 0xf0f0f0 ); + + var loader = new THREE.FontLoader(); + loader.load( 'fonts/helvetiker_regular.typeface.json', function ( font ) { + + var xMid, text; + + var color = new THREE.Color( 0x006699 ); + + var matDark = new THREE.MeshBasicMaterial( { + color: color, + side: THREE.DoubleSide + } ); + + var matLite = new THREE.MeshBasicMaterial( { + color: color, + transparent: true, + opacity: 0.4, + side: THREE.DoubleSide + } ); + + var message = " Three.js\nStroke text."; + + var shapes = font.generateShapes( message, 100 ); + + var geometry = new THREE.ShapeBufferGeometry( shapes ); + + geometry.computeBoundingBox(); + + xMid = - 0.5 * ( geometry.boundingBox.max.x - geometry.boundingBox.min.x ); + + geometry.translate( xMid, 0, 0 ); + + // make shape ( N.B. edge view not visible ) + + text = new THREE.Mesh( geometry, matLite ); + text.position.z = - 150; + scene.add( text ); + + // make line shape ( N.B. edge view remains visible ) + + var holeShapes = []; + + for ( var i = 0; i < shapes.length; i ++ ) { + + var shape = shapes[ i ]; + + if ( shape.holes && shape.holes.length > 0 ) { + + for ( var j = 0; j < shape.holes.length; j ++ ) { + + var hole = shape.holes[ j ]; + holeShapes.push( hole ); + + } + + } + + } + + shapes.push.apply( shapes, holeShapes ); + + var style = THREE.SVGLoader.getStrokeStyle( 5, color.getStyle() ); + + var strokeText = new THREE.Group(); + + for ( var i = 0; i < shapes.length; i ++ ) { + + var shape = shapes[ i ]; + + var points = shape.getPoints(); + + var geometry = THREE.SVGLoader.pointsToStroke( points, style ); + + geometry.translate( xMid, 0, 0 ); + + var strokeMesh = new THREE.Mesh( geometry, matDark ); + strokeText.add( strokeMesh ); + + } + + scene.add( strokeText ); + + } ); //end load function + + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + document.body.appendChild( renderer.domElement ); + + window.addEventListener( 'resize', onWindowResize, false ); + + } // end init + + function onWindowResize() { + + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + + renderer.setSize( window.innerWidth, window.innerHeight ); + + } + + function animate() { + + requestAnimationFrame( animate ); + + render(); + + } + + function render() { + + renderer.render( scene, camera ); + + } + + </script> + + </body> +</html>
true
Other
mrdoob
three.js
a4b1b6df12603da17e5cb0d7e5325d6649106c39.json
Add stroke generation to SVGLoader
examples/webgl_loader_svg.html
@@ -44,7 +44,7 @@ <script> - var renderer, stats, scene, camera, gui, currentURL; + var renderer, stats, scene, camera, gui, guiData; init(); animate(); @@ -81,7 +81,7 @@ window.addEventListener( 'resize', onWindowResize, false ); - document.body.addEventListener( 'dblclick', function () { + document.body.addEventListener( 'dblclick', function ( event ) { var group = scene.children[ 1 ]; group.traverse( function ( child ) { @@ -92,27 +92,33 @@ } ); - currentURL = 'models/svg/tiger.svg'; + guiData = { + currentURL: 'models/svg/tiger.svg', + drawFillShapes: true, + drawStrokes: true, + fillShapesWireframe: false, + strokesWireframe: false + } - loadSVG( currentURL ); + loadSVG( guiData.currentURL ); createGUI(); } function createGUI() { - if ( gui ) gui.destroy(); - - var guiData = { - currentURL: currentURL - }; + if ( gui ) { + gui.destroy(); + } gui = new dat.GUI( { width: 350 } ); gui.add( guiData, 'currentURL', { "Tiger": 'models/svg/tiger.svg', + "Three.js": 'models/svg/threejs.svg', + "Joins and caps": 'models/svg/lineJoinsAndCaps.svg', "Hexagon": 'models/svg/hexagon.svg', "Test 1": 'models/svg/tests/1.svg', "Test 2": 'models/svg/tests/2.svg', @@ -123,13 +129,21 @@ "Test 7": 'models/svg/tests/7.svg', "Test 8": 'models/svg/tests/8.svg' - } ).name( 'SVG File' ).onChange( function ( value ) { + } ).name( 'SVG File' ).onChange( update ); - currentURL = value; + gui.add( guiData, 'drawStrokes' ).name( 'Draw strokes' ).onChange( update ); - loadSVG( currentURL ); + gui.add( guiData, 'drawFillShapes' ).name( 'Draw fill shapes' ).onChange( update ); - } ); + gui.add( guiData, 'strokesWireframe' ).name( 'Wireframe strokes' ).onChange( update ); + + gui.add( guiData, 'fillShapesWireframe' ).name( 'Wireframe fill shapes' ).onChange( update ); + + function update() { + + loadSVG( guiData.currentURL ); + + } } @@ -149,6 +163,7 @@ // var loader = new THREE.SVGLoader(); + loader.load( url, function ( data ) { var paths = data.paths; @@ -163,22 +178,61 @@ var path = paths[ i ]; - var material = new THREE.MeshBasicMaterial( { - color: path.color, - side: THREE.DoubleSide, - depthWrite: false - } ); + var fillColor = path.userData.style.fill; + if ( guiData.drawFillShapes && fillColor !== undefined && fillColor !== 'none') { + + var material = new THREE.MeshBasicMaterial( { + color: new THREE.Color().setStyle( fillColor ), + opacity: path.userData.style.fillOpacity, + transparent: path.userData.style.fillOpacity !== 1, + side: THREE.DoubleSide, + depthWrite: false, + wireframe: guiData.fillShapesWireframe + } ); + + var shapes = path.toShapes( true ); + + for ( var j = 0; j < shapes.length; j ++ ) { + + var shape = shapes[ j ]; + + var geometry = new THREE.ShapeBufferGeometry( shape ); + var mesh = new THREE.Mesh( geometry, material ); + + group.add( mesh ); + + } + + } + + var strokeColor = path.userData.style.stroke; + + if ( guiData.drawStrokes && strokeColor !== undefined && strokeColor !== 'none' ) { + + var material = new THREE.MeshBasicMaterial( { + color: new THREE.Color().setStyle( strokeColor ), + opacity: path.userData.style.strokeOpacity, + transparent: path.userData.style.strokeOpacity !== 1, + side: THREE.DoubleSide, + depthWrite: false, + wireframe: guiData.strokesWireframe + } ); + + for ( var j = 0, jl = path.subPaths.length; j < jl; j ++ ) { + + subPath = path.subPaths[ j ]; + + var geometry = THREE.SVGLoader.pointsToStroke( subPath.getPoints(), path.userData.style ); - var shapes = path.toShapes( true ); + if ( geometry ) { - for ( var j = 0; j < shapes.length; j ++ ) { + var mesh = new THREE.Mesh( geometry, material ); - var shape = shapes[ j ]; + group.add( mesh ); - var geometry = new THREE.ShapeBufferGeometry( shape ); - var mesh = new THREE.Mesh( geometry, material ); + } - group.add( mesh ); + } }
true
Other
mrdoob
three.js
02e0322ea52c10c1f2e097b2a9a6f4fecc1055e6.json
Fix tab issue
utils/modularize.js
@@ -24,8 +24,8 @@ var files = [ { path: 'loaders/OBJLoader.js', ignoreList: [] }, { path: 'loaders/MTLLoader.js', ignoreList: [] }, - { path: 'pmrem/PMREMCubeUVPacker.js', ignoreList: [] }, - { path: 'pmrem/PMREMGenerator.js', ignoreList: [] }, + { path: 'pmrem/PMREMCubeUVPacker.js', ignoreList: [] }, + { path: 'pmrem/PMREMGenerator.js', ignoreList: [] }, { path: 'utils/BufferGeometryUtils.js', ignoreList: [] }, { path: 'utils/GeometryUtils.js', ignoreList: [] },
false
Other
mrdoob
three.js
7e6324dcb106642e05973b5230d934d9036224db.json
Add description for Object3D.renderOrder
src/core/Object3D.d.ts
@@ -120,6 +120,9 @@ export class Object3D extends EventDispatcher { */ frustumCulled: boolean; + /** + * Overrides the default rendering order of scene graph objects, from lowest to highest renderOrder. Opaque and transparent objects remain sorted independently though. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together. + */ renderOrder: number; /**
false
Other
mrdoob
three.js
3a7809fbf0053305483f16ee723482f783f6437f.json
add missing import
examples/jsm/exporters/GLTFExporter.js
@@ -10,6 +10,7 @@ import { ClampToEdgeWrapping, DoubleSide, InterpolateDiscrete, + InterpolateLinear, LinearFilter, LinearMipMapLinearFilter, LinearMipMapNearestFilter,
false
Other
mrdoob
three.js
fd6f38dc3b6e3264ada9d6387085840138a8da33.json
Add docs for stencil operations
docs/api/en/constants/Materials.html
@@ -92,7 +92,52 @@ <h2>Texture Combine Operations</h2> [page:Constant MixOperation] uses reflectivity to blend between the two colors.<br /> [page:Constant AddOperation] adds the two colors. </p> + + <h2>Stencil Functions</h2> + <code> + THREE.NeverStencilFunc + THREE.LessStencilFunc + THREE.EqualStencilFunc + THREE.LessEqualStencilFunc + THREE.GreaterStencilFunc + THREE.NotEqualStencilFunc + THREE.GreaterEqualStencilFunc + THREE.AlwaysStencilFunc + </code> + <p> + Which stencil function the material uses to determine whether or not to perform a stencil operation.<br /> + [page:Materials NeverStencilFunc] will never return true.<br /> + [page:Materials LessStencilFunc] will return true if the stencil reference value is less than the current stencil value.<br /> + [page:Materials EqualStencilFunc] will return true if the stencil reference value is equal to the current stencil value.<br /> + [page:Materials LessEqualStencilFunc] will return true if the stencil reference value is less than or equal to the current stencil value.<br /> + [page:Materials GreaterStencilFunc] will return true if the stencil reference value is greater than the current stencil value.<br /> + [page:Materials NotEqualStencilFunc] will return true if the stencil reference value is not equal to the current stencil value.<br /> + [page:Materials GreaterEqualStencilFunc] will return true if the stencil reference value is greater than or equal to the current stencil value.<br /> + [page:Materials AlwaysStencilFunc] will always return true.<br /> + </p> + <h2>Stencil Operations</h2> + <code> + THREE.ZeroStencilOp + THREE.KeepStencilOp + THREE.ReplaceStencilOp + THREE.IncrementStencilOp + THREE.DecrementStencilOp + THREE.IncrementWrapStencilOp + THREE.DecrementWrapStencilOp + THREE.InvertStencilOp + </code> + <p> + Which stencil operation the material will perform on the stencil buffer pixel if the provided stencil function passes.<br /> + [page:Materials ZeroStencilOp] will set the stencil value to 0.<br /> + [page:Materials KeepStencilOp] will not change the current stencil value.<br /> + [page:Materials ReplaceStencilOp] will replace the stencil value with the specified stencil reference value.<br /> + [page:Materials IncrementStencilOp] will increment the current stencil value by 1.<br /> + [page:Materials DecrementStencilOp] will decrement the current stencil value by 1.<br /> + [page:Materials IncrementWrapStencilOp] will increment the current stencil value by 1. If the value increments past 255 it will be set to 0.<br /> + [page:Materials DecrementWrapStencilOp] will increment the current stencil value by 1. If the value decrements past 0 it will be set to 255.<br /> + [page:Materials InvertStencilOp] will perform a bitwise iversion of the current stencil value.<br /> + </p> <h2>Source</h2>
true
Other
mrdoob
three.js
fd6f38dc3b6e3264ada9d6387085840138a8da33.json
Add docs for stencil operations
docs/api/en/materials/Material.html
@@ -123,6 +123,36 @@ <h3>[property:Boolean depthWrite]</h3> When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts. </p> + <h3>[property:Boolean stencilWrite]</h3> + <p> + Whether rendering this material has any effect on the stencil buffer. Default is *false*. + </p> + + <h3>[property:Boolean stencilFunc]</h3> + <p> + The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values. + </p> + + <h3>[property:Integer stencilRef]</h3> + <p> + The value to use when using stencil functions comparisons or performing stencil operations. Default is *0*. + </p> + + <h3>[property:Boolean stencilMask]</h3> + <p> + The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*. + </p> + + <h3>[property:Integer stencilFail]</h3> + <p> + Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values. + </p> + + <h3>[property:Boolean stencilZFail]</h3> + <p> + Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values. + </p> + <h3>[property:Boolean flatShading]</h3> <p> Define whether the material is rendered with flat shading. Default is false.
true
Other
mrdoob
three.js
233aa3edf3e0991aafe5dbc2b548993b4bf407ea.json
Improve implementation accordingly to PR reviews Signed-off-by: Riccardo Padovani <rpadovani@nextbit.it>
examples/js/loaders/GLTFLoader.js
@@ -1595,11 +1595,11 @@ THREE.GLTFLoader = ( function () { function createMultiPassGeometryKey( geometry, primitives ) { - var key = createPrimitiveKey( geometry ); + var key = geometry.uuid; for ( var i = 0, il = primitives.length; i < il; i ++ ) { - key += i + primitives[ i ].uuid; + key += i + createPrimitiveKey( primitives[ i ].uuid ); }
false
Other
mrdoob
three.js
a57ec27fc6ba95f69b9ca75ea62b8e87e1b3a0ed.json
Add missing "else" keyword
src/renderers/webgl/WebGLRenderLists.js
@@ -42,7 +42,7 @@ function reversePainterSortStable( a, b ) { return a.renderOrder - b.renderOrder; - } if ( a.z !== b.z ) { + } else if ( a.z !== b.z ) { return b.z - a.z;
false
Other
mrdoob
three.js
9833a661c3f6a89ea60ecb08fe003895382c6778.json
Add images to links in examples page
examples/index.html
@@ -6,11 +6,6 @@ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <link rel="shortcut icon" href="../files/favicon.ico" /> <link rel="stylesheet" type="text/css" href="../files/main.css"> - <style> - #panel #content .link { - display: block; - } - </style> </head> <body> @@ -110,13 +105,13 @@ <h1><a href="https://threejs.org">three.js</a></h1> // Events - filterInput.onfocus = function ( event ) { + filterInput.onfocus = function ( ) { panel.classList.add( 'searchFocused' ); }; - filterInput.onblur = function ( event ) { + filterInput.onblur = function ( ) { if ( filterInput.value === '' ) { @@ -126,7 +121,7 @@ <h1><a href="https://threejs.org">three.js</a></h1> }; - exitSearchButton.onclick = function ( event ) { + exitSearchButton.onclick = function ( ) { filterInput.value = ''; updateFilter(); @@ -169,12 +164,21 @@ <h1><a href="https://threejs.org">three.js</a></h1> function createLink( file ) { - var link = document.createElement( 'a' ); - link.className = 'link'; - link.href = file + '.html'; - link.textContent = getName( file ); - link.setAttribute( 'target', 'viewer' ); - link.addEventListener( 'click', function ( event ) { + + var template = [ + '<div class="card">', + ' <a href="' + file + '.html" target="viewer">', + ' <div class="cover">', + ' <img src="screenshots/' + file + '.png" />', + ' </div>', + ' <div class="title">' + getName( file ) + '</div>', + ' </a>', + '</div>' + ].join( "\n" ); + + var link = createElementFromHTML( template ); + + link.querySelector( 'a[target="viewer"]' ).addEventListener( 'click', function ( event ) { if ( event.button !== 0 || event.ctrlKey || event.altKey || event.metaKey ) return; @@ -263,12 +267,12 @@ <h1><a href="https://threejs.org">three.js</a></h1> } - link.innerHTML = text; + link.querySelector( '.title' ).innerHTML = text; } else { link.classList.add( 'hidden' ); - link.innerHTML = name; + link.querySelector( '.title' ).innerHTML = name; } @@ -333,6 +337,15 @@ <h1><a href="https://threejs.org">three.js</a></h1> } + + function createElementFromHTML( htmlString ) { + + var div = document.createElement( 'div' ); + div.innerHTML = htmlString.trim(); + return div.firstChild; + + } + </script> </body>
true
Other
mrdoob
three.js
9833a661c3f6a89ea60ecb08fe003895382c6778.json
Add images to links in examples page
files/main.css
@@ -464,6 +464,39 @@ iframe { } +.card { + border-radius: 3px; + overflow: hidden; + background-color: #f7f7f7; + padding-bottom: 6px; + margin-bottom: 16px; +} + +.card.selected { + box-shadow: 0 0 0 3px var(--color-blue); + text-decoration: none !important; +} + +.card .cover { + padding-bottom: 62.5%; /* 8:5 aspect ratio */ + position: relative; + overflow: hidden; +} + +.card .cover img { + position: absolute; + width: 100%; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.card .title { + padding: 8px 12px 8px; + font-size: 18px; + font-weight: 500; +} + /* mobile */ @media all and ( max-width: 640px ) {
true
Other
mrdoob
three.js
43b31847ac253eee7da4f4eec8a9158814ae6d08.json
Move node association assignment down a few lines
examples/jsm/loaders/GLTFLoader.js
@@ -3173,8 +3173,6 @@ var GLTFLoader = ( function () { assignExtrasToUserData( node, nodeDef ); - parser.associations.set( node, { type: 'nodes', index: nodeIndex } ); - if ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef ); if ( nodeDef.matrix !== undefined ) { @@ -3205,6 +3203,8 @@ var GLTFLoader = ( function () { } + parser.associations.set( node, { type: 'nodes', index: nodeIndex } ); + return node; } );
false
Other
mrdoob
three.js
e507c44e4c853e92475cddf86105831fe468481d.json
add workaround for invalid rawModel entries seems to be connections with null relationships
examples/js/loaders/FBXLoader.js
@@ -2491,6 +2491,11 @@ THREE.FBXLoader = ( function () { if ( modelID !== undefined ) { var rawModel = fbxTree.Objects.Model[ modelID.toString() ]; + + if (!rawModel) { + console.log("invalid rawModel", modelID, child); + return; + } var node = {
false
Other
mrdoob
three.js
921cfea20a44805b3aecfc1c88c6bfa7bafa0e24.json
Add "finish" test
src/renderers/webgl/WebGLRenderLists.js
@@ -159,6 +159,7 @@ function WebGLRenderList() { } return { + renderItems: renderItems, opaque: opaque, transparent: transparent,
true
Other
mrdoob
three.js
921cfea20a44805b3aecfc1c88c6bfa7bafa0e24.json
Add "finish" test
test/unit/src/renderers/webgl/WebGLRenderLists.tests.js
@@ -297,9 +297,69 @@ export default QUnit.module( 'Renderers', () => { } ); - QUnit.todo( 'finish', ( assert ) => { + QUnit.test( 'finish', ( assert ) => { + + var list = new WebGLRenderList(); + var obj = { id: 'A', renderOrder: 0 }; + var mat = { transparent: false, program: { id: 0 } }; + var geom = {}; + + assert.ok( list.renderItems.length === 0, 'Render items length defaults to 0.' ); + + list.push( obj, geom, mat, 0, 0, {} ); + list.push( obj, geom, mat, 0, 0, {} ); + list.push( obj, geom, mat, 0, 0, {} ); + assert.ok( list.renderItems.length === 3, 'Render items length expands as items are added.' ); + + list.finish(); + assert.deepEqual( + list.renderItems.map( item => item.object ), + [ obj, obj, obj ], + 'Render items are not cleaned if they are being used.' + ); + assert.deepEqual( + list.renderItems[ 1 ], + { + id: 'A', + object: obj, + geometry: geom, + material: mat, + program: mat.program, + groupOrder: 0, + renderOrder: 0, + z: 0, + group: {} + }, + 'Unused render item is structured correctly before clearing.' + ); + + list.init(); + list.push( obj, geom, mat, 0, 0, {} ); + assert.ok( list.renderItems.length === 3, 'Render items length does not shrink.' ); + + list.finish(); + assert.deepEqual( + list.renderItems.map( item => item.object ), + [ obj, null, null ], + 'Render items are cleaned if they are not being used.' + ); + + assert.deepEqual( + list.renderItems[ 1 ], + { + id: null, + object: null, + geometry: null, + material: null, + program: null, + groupOrder: 0, + renderOrder: 0, + z: 0, + group: null + }, + 'Unused render item is structured correctly before clearing.' + ); - assert.ok( false, "everything's gonna be alright" ); } );
true
Other
mrdoob
three.js
14cce3958d38bb990d4e208d0f40659a77123025.json
add sort test
test/unit/src/renderers/webgl/WebGLRenderLists.tests.js
@@ -75,22 +75,22 @@ export default QUnit.module( 'Renderers', () => { } ); - QUnit.todo( 'push', ( assert ) => { + QUnit.test( 'push', ( assert ) => { var list = new WebGLRenderList(); - var objA = { id: 'A' }; + var objA = { id: 'A', renderOrder: 0 }; var matA = { transparent: true, program: { id: 1 } }; var geoA = {}; - var objB = { id: 'B' }; + var objB = { id: 'B', renderOrder: 0 }; var matB = { transparent: true, program: { id: 2 } }; var geoB = {}; - var objC = { id: 'C' }; + var objC = { id: 'C', renderOrder: 0 }; var matC = { transparent: false, program: { id: 3 } }; var geoC = {}; - var objD = { id: 'D' }; + var objD = { id: 'D', renderOrder: 0 }; var matD = { transparent: false, program: { id: 4 } }; var geoD = {}; @@ -106,6 +106,7 @@ export default QUnit.module( 'Renderers', () => { material: matA, program: matA.program, groupOrder: 0, + renderOrder: 0, z: 0.5, group: {} }, @@ -124,6 +125,7 @@ export default QUnit.module( 'Renderers', () => { material: matB, program: matB.program, groupOrder: 1, + renderOrder: 0, z: 1.5, group: {} }, @@ -133,7 +135,7 @@ export default QUnit.module( 'Renderers', () => { list.push( objC, geoC, matC, 2, 2.5, {} ); assert.ok( list.transparent.length === 2, 'Transparent list is length 2 after adding first opaque item.' ); assert.ok( list.opaque.length === 1, 'Opaque list list is length 1 after adding first opaque item.' ); - assert.opaque( + assert.deepEqual( list.opaque[ 0 ], { id: 'C', @@ -142,6 +144,7 @@ export default QUnit.module( 'Renderers', () => { material: matC, program: matC.program, groupOrder: 2, + renderOrder: 0, z: 2.5, group: {} }, @@ -151,7 +154,7 @@ export default QUnit.module( 'Renderers', () => { list.push( objD, geoD, matD, 3, 3.5, {} ); assert.ok( list.transparent.length === 2, 'Transparent list is length 2 after adding second opaque item.' ); assert.ok( list.opaque.length === 2, 'Opaque list list is length 2 after adding second opaque item.' ); - assert.opaque( + assert.deepEqual( list.opaque[ 1 ], { id: 'D', @@ -160,29 +163,31 @@ export default QUnit.module( 'Renderers', () => { material: matD, program: matD.program, groupOrder: 3, + renderOrder: 0, z: 3.5, group: {} }, + 'The second opaque render list item is structured correctly.' ); } ); - QUnit.todo( 'unshift', ( assert ) => { + QUnit.test( 'unshift', ( assert ) => { var list = new WebGLRenderList(); - var objA = { id: 'A' }; + var objA = { id: 'A', renderOrder: 0 }; var matA = { transparent: true, program: { id: 1 } }; var geoA = {}; - var objB = { id: 'B' }; + var objB = { id: 'B', renderOrder: 0 }; var matB = { transparent: true, program: { id: 2 } }; var geoB = {}; - var objC = { id: 'C' }; + var objC = { id: 'C', renderOrder: 0 }; var matC = { transparent: false, program: { id: 3 } }; var geoC = {}; - var objD = { id: 'D' }; + var objD = { id: 'D', renderOrder: 0 }; var matD = { transparent: false, program: { id: 4 } }; var geoD = {}; @@ -198,6 +203,7 @@ export default QUnit.module( 'Renderers', () => { material: matA, program: matA.program, groupOrder: 0, + renderOrder: 0, z: 0.5, group: {} }, @@ -216,6 +222,7 @@ export default QUnit.module( 'Renderers', () => { material: matB, program: matB.program, groupOrder: 1, + renderOrder: 0, z: 1.5, group: {} }, @@ -225,7 +232,7 @@ export default QUnit.module( 'Renderers', () => { list.unshift( objC, geoC, matC, 2, 2.5, {} ); assert.ok( list.transparent.length === 2, 'Transparent list is length 2 after adding first opaque item.' ); assert.ok( list.opaque.length === 1, 'Opaque list list is length 1 after adding first opaque item.' ); - assert.opaque( + assert.deepEqual( list.opaque[ 0 ], { id: 'C', @@ -234,6 +241,7 @@ export default QUnit.module( 'Renderers', () => { material: matC, program: matC.program, groupOrder: 2, + renderOrder: 0, z: 2.5, group: {} }, @@ -243,7 +251,7 @@ export default QUnit.module( 'Renderers', () => { list.unshift( objD, geoD, matD, 3, 3.5, {} ); assert.ok( list.transparent.length === 2, 'Transparent list is length 2 after adding second opaque item.' ); assert.ok( list.opaque.length === 2, 'Opaque list list is length 2 after adding second opaque item.' ); - assert.opaque( + assert.deepEqual( list.opaque[ 0 ], { id: 'D', @@ -252,15 +260,47 @@ export default QUnit.module( 'Renderers', () => { material: matD, program: matD.program, groupOrder: 3, + renderOrder: 0, z: 3.5, group: {} }, + 'The second opaque render list item is structured correctly.' + ); + + } ); + + QUnit.test( 'sort', ( assert ) => { + + var list = new WebGLRenderList(); + var items = [ { id: 4 }, { id: 5 }, { id: 2 }, { id: 3 } ]; + + items.forEach( item => { + + list.push( item, {}, { transparent: true }, 0, 0, {} ); + list.push( item, {}, { transparent: false }, 0, 0, {} ); + + } ); + + list.sort( ( a, b ) => a.id - b.id, ( a, b ) => b.id - a.id ); + + assert.deepEqual( + list.opaque.map( item => item.id ), + [ 2, 3, 4, 5 ], + 'The opaque sort is applied to the opaque items list.' + ); + + assert.deepEqual( + list.transparent.map( item => item.id ), + [ 5, 4, 3, 2 ], + 'The transparent sort is applied to the transparent items list.' ); } ); QUnit.todo( 'finish', ( assert ) => { + assert.ok( false, "everything's gonna be alright" ); + } ); } );
false
Other
mrdoob
three.js
c03c2d3a10c4c85a33ef917e0cd25874cf91e6c4.json
Remove ability to move camera selection menu
editor/css/dark.css
@@ -239,31 +239,13 @@ select { width: 100%; } - #cameraSelect[layout='topLeft']{ - margin-top: 32px; - left: 0; - top : 0; - } - - #cameraSelect[layout='topRight']{ + #cameraSelect{ margin-top: 32px; margin-right: 300px; right: 0; top : 0; } - #cameraSelect[layout='bottomLeft']{ - bottom: 0; - left: 0; - padding-bottom: 60px; - } - - #cameraSelect[layout='bottomRight']{ - bottom: 0; - right: 0; - margin-right: 300px; - } - .Outliner { color: #888; background: #222;
true
Other
mrdoob
three.js
c03c2d3a10c4c85a33ef917e0cd25874cf91e6c4.json
Remove ability to move camera selection menu
editor/css/light.css
@@ -232,31 +232,13 @@ select { width: 100%; } - #cameraSelect[layout='topLeft']{ - margin-top: 32px; - left: 0; - top : 0; - } - - #cameraSelect[layout='topRight']{ + #cameraSelect{ margin-top: 32px; margin-right: 300px; right: 0; top : 0; } - #cameraSelect[layout='bottomLeft']{ - bottom: 0; - left: 0; - padding-bottom: 60px; - } - - #cameraSelect[layout='bottomRight']{ - bottom: 0; - right: 0; - margin-right: 300px; - } - .Outliner { color: #444;
true
Other
mrdoob
three.js
c03c2d3a10c4c85a33ef917e0cd25874cf91e6c4.json
Remove ability to move camera selection menu
editor/js/Config.js
@@ -21,7 +21,7 @@ var Config = function () { 'project/renderer/gammaOutput': false, 'project/renderer/shadows': true, 'project/renderer/showHelpers': true, - 'project/renderer/sceneCameras': 'topLeft', + 'project/renderer/sceneCameras': 'topRight', 'project/renderer/showSceneCameras': true, 'project/vr': false,
true
Other
mrdoob
three.js
c03c2d3a10c4c85a33ef917e0cd25874cf91e6c4.json
Remove ability to move camera selection menu
editor/js/Sidebar.Settings.js
@@ -74,34 +74,6 @@ Sidebar.Settings = function ( editor ) { container.add( themeRow ); - // scene camera position - - var sceneCameraRow = new UI.Row(); - container.add( sceneCameraRow ); - - var sceneCameraSelection = new UI.Select().setWidth( '150px' ); - sceneCameraSelection.setOptions( { - topLeft: 'Top Left', - bottomLeft: 'Bottom Left', - topRight: 'Top Right', - bottomRight: 'Bottom Right' - } ); - - if ( config.getKey( 'project/renderer/sceneCameras' ) !== undefined ) { - - sceneCameraSelection.setValue( config.getKey( 'project/renderer/sceneCameras' ) ); - - } - - sceneCameraSelection.onChange( function () { - - config.setKey( 'project/renderer/sceneCameras', this.getValue() ); - signals.sceneCamerasChanged.dispatch(); - - } ); - - sceneCameraRow.add( new UI.Text( strings.getKey( 'sidebar/settings/sceneCameras' ) ).setWidth( '90px' ), sceneCameraSelection ); - // scene camera visible var sceneShowCameraRow = new UI.Row();
true
Other
mrdoob
three.js
c03c2d3a10c4c85a33ef917e0cd25874cf91e6c4.json
Remove ability to move camera selection menu
editor/js/Strings.js
@@ -244,9 +244,8 @@ var Strings = function ( config ) { 'sidebar/settings/theme': 'Theme', 'sidebar/settings/theme/light': 'light', 'sidebar/settings/theme/dark': 'dark', - 'sidebar/settings/sceneCameras': 'Camera Select Menu', - 'sidebar/settings/showSceneCameras': 'Show Camera Select Menu', - 'sidebar/settings/showHelpers': 'Show Heleprs', + 'sidebar/settings/showSceneCameras': 'Cameras', + 'sidebar/settings/showHelpers': 'Helpers', 'sidebar/settings/shortcuts/translate': 'Translate', 'sidebar/settings/shortcuts/rotate': 'Rotate',
true
Other
mrdoob
three.js
c03c2d3a10c4c85a33ef917e0cd25874cf91e6c4.json
Remove ability to move camera selection menu
editor/js/Viewport.js
@@ -176,7 +176,6 @@ var Viewport = function ( editor ) { signals.sceneCamerasChanged.add( function () { - sceneCameraDisplay.dom.setAttribute( 'layout', config.getKey( 'project/renderer/sceneCameras' ) || 'topLeft' ); sceneCameraDisplay.setDisplay( config.getKey( 'project/renderer/showSceneCameras' ) === true && Object.keys( cameras ).length > 0 ? 'block' : 'none' ); } );
true
Other
mrdoob
three.js
7c73f19684715f6bc7e254033782d885da4d4cb0.json
Update element z-index and strings
editor/css/dark.css
@@ -95,6 +95,10 @@ select { padding-right: 8px; } + #menubar .menu * { + z-index: 2; + } + #menubar .menu.right { float: right; cursor: auto; @@ -227,7 +231,7 @@ select { #cameraSelect { position: absolute; - z-index: 10; + z-index: 1; padding: 10px; }
true
Other
mrdoob
three.js
7c73f19684715f6bc7e254033782d885da4d4cb0.json
Update element z-index and strings
editor/css/light.css
@@ -91,6 +91,10 @@ select { padding-right: 8px; } + #menubar .menu * { + z-index: 2; + } + #menubar .menu.right { float: right; cursor: auto; @@ -220,7 +224,7 @@ select { #cameraSelect { position: absolute; - z-index: 10; + z-index: 1; padding: 10px; }
true
Other
mrdoob
three.js
7c73f19684715f6bc7e254033782d885da4d4cb0.json
Update element z-index and strings
editor/js/Strings.js
@@ -244,8 +244,8 @@ var Strings = function ( config ) { 'sidebar/settings/theme': 'Theme', 'sidebar/settings/theme/light': 'light', 'sidebar/settings/theme/dark': 'dark', - 'sidebar/settings/sceneCameras': 'Scene Cameras', - 'sidebar/settings/showSceneCameras': 'Show Scene Cameras', + 'sidebar/settings/sceneCameras': 'Camera Select Menu', + 'sidebar/settings/showSceneCameras': 'Show Camera Select Menu', 'sidebar/settings/shortcuts/translate': 'Translate', 'sidebar/settings/shortcuts/rotate': 'Rotate',
true
Other
mrdoob
three.js
de83fcd1229c5cdb9377c0ea02eef041689e0d81.json
Change only main viewport
editor/css/dark.css
@@ -228,8 +228,9 @@ select { #cameraSelect { position: absolute; z-index: 10; + padding: 10px; } - + #cameraSelect * { width: 100%; } @@ -250,6 +251,7 @@ select { #cameraSelect[layout='bottomLeft']{ bottom: 0; left: 0; + padding-bottom: 60px; } #cameraSelect[layout='bottomRight']{
true
Other
mrdoob
three.js
de83fcd1229c5cdb9377c0ea02eef041689e0d81.json
Change only main viewport
editor/css/light.css
@@ -221,6 +221,7 @@ select { #cameraSelect { position: absolute; z-index: 10; + padding: 10px; } #cameraSelect * { @@ -243,6 +244,7 @@ select { #cameraSelect[layout='bottomLeft']{ bottom: 0; left: 0; + padding-bottom: 60px; } #cameraSelect[layout='bottomRight']{
true
Other
mrdoob
three.js
de83fcd1229c5cdb9377c0ea02eef041689e0d81.json
Change only main viewport
editor/js/Viewport.js
@@ -137,18 +137,16 @@ var Viewport = function ( editor ) { // Displaying scene cameras - var cameras = {}; + var cameras = { + [ camera.uuid ]: 'Main Camera' + }; var sceneCameraDisplay = new UI.Row(); sceneCameraDisplay.setId( 'cameraSelect' ); sceneCameraDisplay.dom.setAttribute( 'layout', config.getKey( 'project/renderer/sceneCameras' ) || 'topLeft' ); sceneCameraDisplay.setDisplay( 'none' ); document.body.appendChild( sceneCameraDisplay.dom ); - var canvas = document.createElement( 'canvas' ); - sceneCameraDisplay.dom.appendChild( canvas ); - var ctx = canvas.getContext( '2d' ); - var cameraSelect = new UI.Select().onChange( render ); sceneCameraDisplay.add( cameraSelect ); @@ -618,24 +616,24 @@ var Viewport = function ( editor ) { sceneHelpers.updateMatrixWorld(); scene.updateMatrixWorld(); + var cam = camera; + if ( sceneCameraDisplay.dom.style.display != 'none' ) { - var cam = scene.getObjectByProperty( 'uuid', cameraSelect.getValue() ); - if ( cam !== undefined && cam.isCamera === true ) { + var sceneCamera = scene.getObjectByProperty( 'uuid', cameraSelect.getValue() ); + if ( sceneCamera !== undefined && sceneCamera.isCamera === true ) { - renderer.render( scene, cam ); - var dom = renderer.domElement; - ctx.drawImage( dom, 0, 0, dom.width, dom.height, 0, 0, canvas.width, canvas.height ); + cam = sceneCamera; } } - renderer.render( scene, camera ); + renderer.render( scene, cam ); if ( renderer instanceof THREE.RaytracingRenderer === false ) { - renderer.render( sceneHelpers, camera ); + renderer.render( sceneHelpers, cam ); }
true
Other
mrdoob
three.js
9dc0974f35a47a5b7bf78ce28d1a96a3ce3dfae4.json
Update code style
editor/css/light.css
@@ -223,33 +223,33 @@ select { z-index: 10; } - #cameraSelect * { - width: 100%; - } - - #cameraSelect[layout='topLeft']{ - margin-top: 32px; - left: 0; - top : 0; - } - - #cameraSelect[layout='topRight']{ - margin-top: 32px; - margin-right: 300px; - right: 0; - top : 0; - } - - #cameraSelect[layout='bottomLeft']{ - bottom: 0; - left: 0; - } - - #cameraSelect[layout='bottomRight']{ - bottom: 0; - right: 0; - margin-right: 300px; - } + #cameraSelect * { + width: 100%; + } + + #cameraSelect[layout='topLeft']{ + margin-top: 32px; + left: 0; + top : 0; + } + + #cameraSelect[layout='topRight']{ + margin-top: 32px; + margin-right: 300px; + right: 0; + top : 0; + } + + #cameraSelect[layout='bottomLeft']{ + bottom: 0; + left: 0; + } + + #cameraSelect[layout='bottomRight']{ + bottom: 0; + right: 0; + margin-right: 300px; + } .Outliner {
false
Other
mrdoob
three.js
e8845a43a912e140921120a06f9698bd1631e183.json
Update code style
editor/css/light.css
@@ -222,34 +222,34 @@ select { position: absolute; z-index: 10; } - - #cameraSelect * { - width: 100%; - } - - #cameraSelect[layout='topLeft']{ - margin-top: 32px; - left: 0; - top : 0; - } - - #cameraSelect[layout='topRight']{ - margin-top: 32px; - margin-right: 300px; - right: 0; - top : 0; - } - - #cameraSelect[layout='bottomLeft']{ - bottom: 0; - left: 0; - } - - #cameraSelect[layout='bottomRight']{ - bottom: 0; - right: 0; - margin-right: 300px; - } + + #cameraSelect * { + width: 100%; + } + + #cameraSelect[layout='topLeft']{ + margin-top: 32px; + left: 0; + top : 0; + } + + #cameraSelect[layout='topRight']{ + margin-top: 32px; + margin-right: 300px; + right: 0; + top : 0; + } + + #cameraSelect[layout='bottomLeft']{ + bottom: 0; + left: 0; + } + + #cameraSelect[layout='bottomRight']{ + bottom: 0; + right: 0; + margin-right: 300px; + } .Outliner {
false
Other
mrdoob
three.js
680f11713f384491b0853993a94dace366ab18d9.json
Update code style
editor/css/dark.css
@@ -235,7 +235,7 @@ select { } #cameraSelect[layout='topLeft']{ - margin-top: 32px; + margin-top: 32px; left: 0; top : 0; } @@ -248,12 +248,12 @@ select { } #cameraSelect[layout='bottomLeft']{ - bottom: 0; + bottom: 0; left: 0; } #cameraSelect[layout='bottomRight']{ - bottom: 0; + bottom: 0; right: 0; margin-right: 300px; }
false
Other
mrdoob
three.js
0e4318bf54279ffba5ce0103b31c58c6a43f2719.json
Update code style
editor/js/Sidebar.Settings.js
@@ -74,41 +74,48 @@ Sidebar.Settings = function ( editor ) { container.add( themeRow ); + // scene camera position + var sceneCameraRow = new UI.Row(); - container.add(sceneCameraRow); + container.add( sceneCameraRow ); - var sceneCameraSelection = new UI.Select().setWidth('150px'); - sceneCameraSelection.setOptions({ + var sceneCameraSelection = new UI.Select().setWidth( '150px' ); + sceneCameraSelection.setOptions( { topLeft: 'Top Left', bottomLeft: 'Bottom Left', topRight: 'Top Right', bottomRight: 'Bottom Right' - }); + } ); + + if ( config.getKey( 'project/renderer/sceneCameras' ) !== undefined ) { + + sceneCameraSelection.setValue( config.getKey( 'project/renderer/sceneCameras' ) ); - if(config.getKey('project/renderer/sceneCameras') !== undefined) - { - sceneCameraSelection.setValue(config.getKey('project/renderer/sceneCameras')); } - sceneCameraSelection.onChange(function() - { - config.setKey('project/renderer/sceneCameras', this.getValue()); + sceneCameraSelection.onChange( function () { + + config.setKey( 'project/renderer/sceneCameras', this.getValue() ); signals.sceneCamerasChanged.dispatch(); - }); - sceneCameraRow.add(new UI.Text(strings.getKey('sidebar/settings/sceneCameras')).setWidth('90px'), sceneCameraSelection); + } ); + + sceneCameraRow.add( new UI.Text( strings.getKey( 'sidebar/settings/sceneCameras' ) ).setWidth( '90px' ), sceneCameraSelection ); + + // scene camera visible var sceneShowCameraRow = new UI.Row(); - container.add(sceneShowCameraRow); - - var sceneCameraCheckbox = new UI.Checkbox(true).onChange(function() - { - config.setKey('project/renderer/showSceneCameras', this.getValue()); + container.add( sceneShowCameraRow ); + + var sceneCameraCheckbox = new UI.Checkbox( true ).onChange( function () { + + config.setKey( 'project/renderer/showSceneCameras', this.getValue() ); signals.sceneCamerasChanged.dispatch(); - }); - sceneShowCameraRow.add(new UI.Text(strings.getKey('sidebar/settings/showSceneCameras')).setWidth('90px'), sceneCameraCheckbox); - + } ); + + sceneShowCameraRow.add( new UI.Text( strings.getKey( 'sidebar/settings/showSceneCameras' ) ).setWidth( '90px' ), sceneCameraCheckbox ); + container.add( new Sidebar.Settings.Shortcuts( editor ) ); container.add( new Sidebar.Settings.Viewport( editor ) );
true
Other
mrdoob
three.js
0e4318bf54279ffba5ce0103b31c58c6a43f2719.json
Update code style
editor/js/Viewport.js
@@ -140,58 +140,67 @@ var Viewport = function ( editor ) { var cameras = {}; var sceneCameraDisplay = new UI.Row(); - sceneCameraDisplay.setId('cameraSelect'); - sceneCameraDisplay.dom.setAttribute('layout', config.getKey('project/renderer/sceneCameras') || 'topLeft'); - sceneCameraDisplay.setDisplay('none'); - document.body.appendChild(sceneCameraDisplay.dom); - - var canvas = document.createElement('canvas'); - sceneCameraDisplay.dom.appendChild(canvas); - var ctx = canvas.getContext('2d'); - - var cameraSelect = new UI.Select().onChange(render); - sceneCameraDisplay.add(cameraSelect); - - signals.objectAdded.add(function(object) - { - if(object !== null) - { - object.traverse(addCamera); - cameraSelect.setOptions(cameras); - sceneCameraDisplay.setDisplay(config.getKey('project/renderer/showSceneCameras') === true && Object.keys(cameras).length > 0 ? 'block' : 'none'); - } - }); - - signals.objectRemoved.add(function(object) - { - if(object !== null) - { - object.traverse(removeCamera); - cameraSelect.setOptions(cameras); - sceneCameraDisplay.setDisplay(config.getKey('project/renderer/showSceneCameras') === true && Object.keys(cameras).length > 0 ? 'block' : 'none'); - } - }); - - signals.sceneCamerasChanged.add(function() - { - sceneCameraDisplay.dom.setAttribute('layout', config.getKey('project/renderer/sceneCameras') || 'topLeft'); - sceneCameraDisplay.setDisplay(config.getKey('project/renderer/showSceneCameras') === true && Object.keys(cameras).length > 0 ? 'block' : 'none'); - }); - - function addCamera(object) - { - if(object.isCamera === true) - { - cameras[object.uuid] = object.name; + sceneCameraDisplay.setId( 'cameraSelect' ); + sceneCameraDisplay.dom.setAttribute( 'layout', config.getKey( 'project/renderer/sceneCameras' ) || 'topLeft' ); + sceneCameraDisplay.setDisplay( 'none' ); + document.body.appendChild( sceneCameraDisplay.dom ); + + var canvas = document.createElement( 'canvas' ); + sceneCameraDisplay.dom.appendChild( canvas ); + var ctx = canvas.getContext( '2d' ); + + var cameraSelect = new UI.Select().onChange( render ); + sceneCameraDisplay.add( cameraSelect ); + + signals.objectAdded.add( function ( object ) { + + if ( object !== null ) { + + object.traverse( addCamera ); + cameraSelect.setOptions( cameras ); + sceneCameraDisplay.setDisplay( config.getKey( 'project/renderer/showSceneCameras' ) === true && Object.keys( cameras ).length > 0 ? 'block' : 'none' ); + + } + + } ); + + signals.objectRemoved.add( function ( object ) { + + if ( object !== null ) { + + object.traverse( removeCamera ); + cameraSelect.setOptions( cameras ); + sceneCameraDisplay.setDisplay( config.getKey( 'project/renderer/showSceneCameras' ) === true && Object.keys( cameras ).length > 0 ? 'block' : 'none' ); + + } + + } ); + + signals.sceneCamerasChanged.add( function () { + + sceneCameraDisplay.dom.setAttribute( 'layout', config.getKey( 'project/renderer/sceneCameras' ) || 'topLeft' ); + sceneCameraDisplay.setDisplay( config.getKey( 'project/renderer/showSceneCameras' ) === true && Object.keys( cameras ).length > 0 ? 'block' : 'none' ); + + } ); + + function addCamera( object ) { + + if ( object.isCamera === true ) { + + cameras[ object.uuid ] = object.name; + } + } - function removeCamera(object) - { - if(object.isCamera === true) - { - delete cameras[object.uuid]; + function removeCamera( object ) { + + if ( object.isCamera === true ) { + + delete cameras[ object.uuid ]; + } + } // object picking @@ -609,15 +618,17 @@ var Viewport = function ( editor ) { sceneHelpers.updateMatrixWorld(); scene.updateMatrixWorld(); - if(sceneCameraDisplay.dom.style.display != 'none') - { - var cam = scene.getObjectByProperty('uuid', cameraSelect.getValue()); - if(cam !== undefined && cam.isCamera === true) - { - renderer.render(scene, cam); + if ( sceneCameraDisplay.dom.style.display != 'none' ) { + + var cam = scene.getObjectByProperty( 'uuid', cameraSelect.getValue() ); + if ( cam !== undefined && cam.isCamera === true ) { + + renderer.render( scene, cam ); var dom = renderer.domElement; - ctx.drawImage(dom, 0, 0, dom.width, dom.height, 0, 0, canvas.width, canvas.height); + ctx.drawImage( dom, 0, 0, dom.width, dom.height, 0, 0, canvas.width, canvas.height ); + } + } renderer.render( scene, camera ); @@ -627,7 +638,7 @@ var Viewport = function ( editor ) { renderer.render( sceneHelpers, camera ); } - + } return container;
true
Other
mrdoob
three.js
450e71cba34aa0524e67341548dc7635cdf3fc7f.json
Reset branch to dev
editor/js/Editor.js
@@ -80,7 +80,6 @@ var Editor = function () { this.loader = new Loader( this ); this.camera = this.DEFAULT_CAMERA.clone(); - this.sceneCameras = []; this.scene = new THREE.Scene(); this.scene.name = 'Scene';
true
Other
mrdoob
three.js
450e71cba34aa0524e67341548dc7635cdf3fc7f.json
Reset branch to dev
editor/js/Sidebar.Object.js
@@ -8,8 +8,6 @@ Sidebar.Object = function ( editor ) { var signals = editor.signals; - var sceneCameras = editor.sceneCameras; - var container = new UI.Panel(); container.setBorderTop( '0' ); container.setPaddingTop( '20px' ); @@ -314,41 +312,6 @@ Sidebar.Object = function ( editor ) { container.add( objectUserDataRow ); - // view from camera - var cameraViewRow = new UI.Row().setDisplay( editor.selected !== null && editor.selected.isCamera ? 'block' : 'none' ); - container.add( cameraViewRow ); - - cameraViewRow.add( new UI.Text( strings.getKey( 'sidebar/object/view' ) ).setWidth( '90px' ) ); - - var cameraViewCheckbox = new UI.Checkbox( false ).onChange( update ).onClick( function () { - - var object = editor.selected; - if ( object.isCamera !== true ) return; - - if ( sceneCameras.indexOf( object ) === - 1 ) { - - if ( sceneCameras.length === 4 ) { - - alert( "Only 4 scene cameras can be shown at once." ); - cameraViewCheckbox.setValue( false ); - return; - - } - - sceneCameras.push( object ); - cameraViewCheckbox.setValue( true ); - - } else { - - sceneCameras.splice( sceneCameras.indexOf( object ), 1 ); - cameraViewCheckbox.setValue( false ); - - } - - signals.sceneGraphChanged.dispatch(); - - } ); - cameraViewRow.add( cameraViewCheckbox ); // @@ -560,12 +523,12 @@ Sidebar.Object = function ( editor ) { 'intensity': objectIntensityRow, 'color': objectColorRow, 'groundColor': objectGroundColorRow, - 'distance': objectDistanceRow, - 'angle': objectAngleRow, - 'penumbra': objectPenumbraRow, - 'decay': objectDecayRow, - 'castShadow': objectShadowRow, - 'receiveShadow': objectReceiveShadow, + 'distance' : objectDistanceRow, + 'angle' : objectAngleRow, + 'penumbra' : objectPenumbraRow, + 'decay' : objectDecayRow, + 'castShadow' : objectShadowRow, + 'receiveShadow' : objectReceiveShadow, 'shadow': objectShadowRadius }; @@ -726,17 +689,6 @@ Sidebar.Object = function ( editor ) { } - if ( object.isCamera === true ) { - - cameraViewRow.setDisplay( 'block' ); - cameraViewCheckbox.setValue( sceneCameras.indexOf( object ) !== - 1 ); - - } else { - - cameraViewRow.setDisplay( 'none' ); - - } - objectVisible.setValue( object.visible ); objectFrustumCulled.setValue( object.frustumCulled ); objectRenderOrder.setValue( object.renderOrder );
true
Other
mrdoob
three.js
450e71cba34aa0524e67341548dc7635cdf3fc7f.json
Reset branch to dev
editor/js/Sidebar.Settings.Viewport.js
@@ -6,42 +6,14 @@ Sidebar.Settings.Viewport = function ( editor ) { var signals = editor.signals; var strings = editor.strings; - var config = editor.config; var container = new UI.Div(); container.add( new UI.Break() ); container.add( new UI.Text( strings.getKey( 'sidebar/settings/viewport/grid' ) ).setWidth( '90px' ) ); var show = new UI.THREE.Boolean( true ).onChange( update ); - container.add( show, new UI.Break() ); - - container.add( new UI.Text( strings.getKey( 'sidebar/settings/viewport/view' ) ).setWidth( '90px' ) ); - - var sceneViewOptions = new UI.Select().setOptions( { - left: 'left', - right: 'right', - top: 'top', - bottom: 'bottom' - } ); - - if ( config.getKey( 'sceneCameraView' ) !== undefined ) { - - sceneViewOptions.setValue( config.getKey( 'sceneCameraView' ) ); - - } else { - - sceneViewOptions.setValue( 'left' ); - - } - - sceneViewOptions.onChange( function () { - - config.setKey( 'sceneCameraView', sceneViewOptions.getValue() ); - signals.sceneGraphChanged.dispatch(); - - } ); - container.add( sceneViewOptions ); + container.add( show ); /* var snapSize = new UI.Number( 25 ).setWidth( '40px' ).onChange( update );
true
Other
mrdoob
three.js
450e71cba34aa0524e67341548dc7635cdf3fc7f.json
Reset branch to dev
editor/js/Storage.js
@@ -6,7 +6,7 @@ var Storage = function () { var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; - if ( indexedDB === undefined ) { + if ( indexedDB === undefined ) { console.warn( 'Storage: IndexedDB not available.' ); return { init: function () {}, get: function () {}, set: function () {}, clear: function () {} };
true
Other
mrdoob
three.js
450e71cba34aa0524e67341548dc7635cdf3fc7f.json
Reset branch to dev
editor/js/Strings.js
@@ -97,7 +97,6 @@ var Strings = function ( config ) { 'sidebar/object/frustumcull': 'Frustum Cull', 'sidebar/object/renderorder': 'Render Order', 'sidebar/object/userdata': 'User data', - 'sidebar/object/view': 'Show View', 'sidebar/geometry/type': 'Type', 'sidebar/geometry/new': 'New', @@ -253,7 +252,6 @@ var Strings = function ( config ) { 'sidebar/settings/shortcuts/focus': 'Focus', 'sidebar/settings/viewport/grid': 'Grid', - 'sidebar/settings/viewport/view': 'Cameras', 'sidebar/history/history': 'HISTORY', 'sidebar/history/persistent': 'persistent',
true