How to use the ShapeUtils function from three

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

112
113
114
115
116
117
118
119
120
121
extractGlyphPoints: function(c, face, scale, offset, path) {

  var pts = [];

  var b2 = THREE.ShapeUtils.b2;
  var b3 = THREE.ShapeUtils.b3;

  var i, i2, divisions,
    outline, action, length,
    scaleX, scaleY,
fork icon1
star icon0
watch icon3

+ 7 other calls in file

88
89
90
91
92
93
94
95
96
97
    //bottomPoints.push([x,y]);
  };
}
//const bottomCurve = new THREE.Curve(bottomPoints);
//const bottomShape = new THREE.Shape(bottomCurve);
//var a = THREE.ShapeUtils.area(bottomPoints);
//const unique = [...new Set(bottomPoints.map(item => item))]

//write algorithm to delete duplicates
var unique = [];
fork icon0
star icon0
watch icon0

+ 3 other calls in file

30
31
32
33
34
35
36
37
38
39
  geometry.vertices.push(new THREE.Vector3(i + 0.6, Math.sin(i) - 0.6, i - 0.6))
  geometry.vertices.push(new THREE.Vector3(i + 0.6, Math.sin(i) - 1.2, i + 0.1))
}

let holes = []
  , triangles = THREE.ShapeUtils.triangulateShape(geometry.vertices, holes)

for (var i = 0; i < triangles.length; i++) {
  geometry.faces.push(new THREE.Face3(triangles[i][0], triangles[i][1], triangles[i][2]))
}
fork icon0
star icon0
watch icon1

Other functions in three

Sorted by popularity

function icon

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