Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mrdoob/three.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0ee09c94b04b5551d53d82461bbaec31c3b63fb7
Choose a base ref
...
head repository: mrdoob/three.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b7fd5487c47977f576679c04b0a559a8607e92d
Choose a head ref
  • 4 commits
  • 23 files changed
  • 2 contributors

Commits on May 30, 2019

  1. Copy the full SHA
    b8a14f7 View commit details
  2. Merge pull request #16614 from Mugen87/dev32

    JSM: Added module and TS files for fat lines.
    Mugen87 authored May 30, 2019
    Copy the full SHA
    394a496 View commit details
  3. Triangle: fix import d.ts

    sciecode committed May 30, 2019
    Copy the full SHA
    2ba4234 View commit details
  4. Merge pull request #16616 from sciecode/dev2

    Triangle: fix import d.ts
    Mugen87 authored May 30, 2019
    Copy the full SHA
    3b7fd54 View commit details
11 changes: 11 additions & 0 deletions docs/manual/en/introduction/Import-via-modules.html
Original file line number Diff line number Diff line change
@@ -133,6 +133,17 @@ <h2>Importable Examples</h2>
<li>TeapotBufferGeometry</li>
</ul>
</li>
<li>lines
<ul>
<li>Line2</li>
<li>LineGeometry</li>
<li>LineMaterial</li>
<li>LineSegments2</li>
<li>LineSegmentsGeometry</li>
<li>Wireframe</li>
<li>WireframeGeometry2</li>
</ul>
</li>
<li>loaders
<ul>
<li>3MFLoader</li>
2 changes: 1 addition & 1 deletion examples/js/lines/Line2.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ THREE.Line2.prototype = Object.assign( Object.create( THREE.LineSegments2.protot

isLine2: true,

copy: function ( source ) {
copy: function ( /* source */ ) {

// todo

2 changes: 1 addition & 1 deletion examples/js/lines/LineGeometry.js
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ THREE.LineGeometry.prototype = Object.assign( Object.create( THREE.LineSegmentsG

},

copy: function ( source ) {
copy: function ( /* source */ ) {

// todo

2 changes: 1 addition & 1 deletion examples/js/lines/LineSegments2.js
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototy

}() ),

copy: function ( source ) {
copy: function ( /* source */ ) {

// todo

4 changes: 1 addition & 3 deletions examples/js/lines/LineSegmentsGeometry.js
Original file line number Diff line number Diff line change
@@ -9,8 +9,6 @@ THREE.LineSegmentsGeometry = function () {

this.type = 'LineSegmentsGeometry';

var plane = new THREE.BufferGeometry();

var positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];
var uvs = [ - 1, 2, 1, 2, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 2, 1, - 2 ];
var index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];
@@ -249,7 +247,7 @@ THREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.Insta

},

copy: function ( source ) {
copy: function ( /* source */ ) {

// todo

2 changes: 1 addition & 1 deletion examples/js/lines/Wireframe.js
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ THREE.Wireframe.prototype = Object.assign( Object.create( THREE.Mesh.prototype )

}() ),

copy: function ( source ) {
copy: function ( /* source */ ) {

// todo

2 changes: 1 addition & 1 deletion examples/js/lines/WireframeGeometry2.js
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ THREE.WireframeGeometry2.prototype = Object.assign( Object.create( THREE.LineSeg

isWireframeGeometry2: true,

copy: function ( source ) {
copy: function ( /* source */ ) {

// todo

8 changes: 8 additions & 0 deletions examples/jsm/lines/Line2.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { LineGeometry } from './LineGeometry';
import { LineSegments2 } from './LineSegments2';
import { LineMaterial } from './LineMaterial';

export class Line2 extends LineSegments2 {
constructor(geometry?: LineGeometry, material?: LineMaterial);
isLine2: boolean;
}
38 changes: 38 additions & 0 deletions examples/jsm/lines/Line2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* @author WestLangley / http://github.com/WestLangley
*
*/


import { LineSegments2 } from "../lines/LineSegments2.js";
import { LineGeometry } from "../lines/LineGeometry.js";
import { LineMaterial } from "../lines/LineMaterial.js";

var Line2 = function ( geometry, material ) {

LineSegments2.call( this );

this.type = 'Line2';

this.geometry = geometry !== undefined ? geometry : new LineGeometry();
this.material = material !== undefined ? material : new LineMaterial( { color: Math.random() * 0xffffff } );

};

Line2.prototype = Object.assign( Object.create( LineSegments2.prototype ), {

constructor: Line2,

isLine2: true,

copy: function ( /* source */ ) {

// todo

return this;

}

} );

export { Line2 };
12 changes: 12 additions & 0 deletions examples/jsm/lines/LineGeometry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {
Line
} from '../../../src/Three';

import { LineSegmentsGeometry } from './LineSegmentsGeometry';

export class LineGeometry extends LineSegmentsGeometry {
constructor();
isLineGeometry: boolean;

fromLine(line: Line): this;
}
103 changes: 103 additions & 0 deletions examples/jsm/lines/LineGeometry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* @author WestLangley / http://github.com/WestLangley
*
*/


import { LineSegmentsGeometry } from "../lines/LineSegmentsGeometry.js";

var LineGeometry = function () {

LineSegmentsGeometry.call( this );

this.type = 'LineGeometry';

};

LineGeometry.prototype = Object.assign( Object.create( LineSegmentsGeometry.prototype ), {

constructor: LineGeometry,

isLineGeometry: true,

setPositions: function ( array ) {

// converts [ x1, y1, z1, x2, y2, z2, ... ] to pairs format

var length = array.length - 3;
var points = new Float32Array( 2 * length );

for ( var i = 0; i < length; i += 3 ) {

points[ 2 * i ] = array[ i ];
points[ 2 * i + 1 ] = array[ i + 1 ];
points[ 2 * i + 2 ] = array[ i + 2 ];

points[ 2 * i + 3 ] = array[ i + 3 ];
points[ 2 * i + 4 ] = array[ i + 4 ];
points[ 2 * i + 5 ] = array[ i + 5 ];

}

LineSegmentsGeometry.prototype.setPositions.call( this, points );

return this;

},

setColors: function ( array ) {

// converts [ r1, g1, b1, r2, g2, b2, ... ] to pairs format

var length = array.length - 3;
var colors = new Float32Array( 2 * length );

for ( var i = 0; i < length; i += 3 ) {

colors[ 2 * i ] = array[ i ];
colors[ 2 * i + 1 ] = array[ i + 1 ];
colors[ 2 * i + 2 ] = array[ i + 2 ];

colors[ 2 * i + 3 ] = array[ i + 3 ];
colors[ 2 * i + 4 ] = array[ i + 4 ];
colors[ 2 * i + 5 ] = array[ i + 5 ];

}

LineSegmentsGeometry.prototype.setColors.call( this, colors );

return this;

},

fromLine: function ( line ) {

var geometry = line.geometry;

if ( geometry.isGeometry ) {

this.setPositions( geometry.vertices );

} else if ( geometry.isBufferGeometry ) {

this.setPositions( geometry.position.array ); // assumes non-indexed

}

// set colors, maybe

return this;

},

copy: function ( /* source */ ) {

// todo

return this;

}

} );

export { LineGeometry };
28 changes: 28 additions & 0 deletions examples/jsm/lines/LineMaterial.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
Color,
MaterialParameters,
ShaderMaterial,
Vector2
} from '../../../src/Three';

export interface LineMaterialParameters extends MaterialParameters {
color?: number;
dashed?: boolean;
dashScale?: number;
dashSize?: number;
gapSize?: number;
linewidth?: number;
resolution?: Vector2;
}

export class LineMaterial extends ShaderMaterial {
constructor(parameters?: LineMaterialParameters);
color: Color;
dashed: boolean;
dashScale: number;
dashSize: number;
gapSize: number;
isLineMaterial: boolean;
linewidth: number;
resolution: Vector2;
}
Loading