MCPcopy Create free account
hub / github.com/NikLever/ThreeJS-PathEditor / getCenterPoint

Method getCenterPoint

preview.js:99–112  ·  view source on GitHub ↗
(mesh)

Source from the content-addressed store, hash-verified

97 }
98
99 getCenterPoint(mesh) {
100 const middle = new Vector3();
101 const geometry = mesh.geometry;
102
103 geometry.computeBoundingBox();
104
105 middle.x = (geometry.boundingBox.max.x + geometry.boundingBox.min.x) / 2;
106 middle.y = (geometry.boundingBox.max.y + geometry.boundingBox.min.y) / 2;
107 middle.z = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2;
108
109 mesh.localToWorld( middle );
110
111 return middle;
112 }
113
114 nodesToShape( nodes ){
115 const shape = new Shape();

Callers 1

showMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected