How to use the EdgesGeometry function from three

Find comprehensive JavaScript three.EdgesGeometry code examples handpicked from public code repositorys.

19
20
21
22
23
24
25
26
27
28
const geometry = new THREE.BoxGeometry(
  dx, // width
  dy, // height
  dz // depth
);
const edges = new THREE.EdgesGeometry(geometry);

let material;

if (dashed) {
fork icon0
star icon2
watch icon1

131
132
133
134
135
136
137
138
139
140
let geometry = new THREE.BoxBufferGeometry(
  width,
  height,
  length
)
var edges = new THREE.EdgesGeometry( geometry )
var line = new THREE.LineSegments(
  edges,
  new THREE.LineBasicMaterial({ color: 0x999999 })
)
fork icon263
star icon0
watch icon2

51
52
53
54
55
56
57
58
59
60
}

function addGrid(){
    // Add basic box layout and lights
    var geometry = new THREE.BoxGeometry(...boxSize);
    geometry = new THREE.EdgesGeometry(geometry);
    var material = new THREE.LineBasicMaterial( { color: 0xffffff, lineWidth: true } );

    var cube = new THREE.LineSegments( geometry, material );
    scene.add( cube );
fork icon26
star icon28
watch icon0

+ 2 other calls in file

347
348
349
350
351
352
353
354
355
356
  indices.push(j, j + 1, j + 2);
}
mesh.setIndex(indices);

// Create the wireframe geometry
const edges = new THREE.EdgesGeometry(mesh, threshOldAngle);

// Add this wireframe geometry to the global wireframe geometry
for (let l = 0; l < edges.attributes.position.count * 3; l++)
  pos.push(edges.attributes.position.array[l]);
fork icon15
star icon10
watch icon0

+ 14 other calls in file

426
427
428
429
430
431
432
433
434
435
436


function boundingBox(bb, color, opacity) {
    bb = bb.clone()
    let d = bb.max.clone().sub(bb.min)
    let geom = new THREE.CubeGeometry(d.x, d.y, d.z)
    geom = new THREE.EdgesGeometry(geom)
    let mat = new THREE.LineBasicMaterial({
        color: color,
        linewidth: 2,
        transparent: true,
fork icon2
star icon14
watch icon0

+ 2 other calls in file

103
104
105
106
107
108
109
110
111
112
113
    this.renderer.render(this.scene, this.camera)
  }
}


function buildShape(geometry, x, z, isHorizon = false) {
  const edges = new THREE.EdgesGeometry(geometry)
  const material = new THREE.LineBasicMaterial({color: LIGHT_GREEN})
  const shape = new THREE.LineSegments(edges, material)
  shape.blocking = !isHorizon
  shape.position.x = x
fork icon0
star icon0
watch icon0

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)