ConvexGeometry.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. [name] can be used to generate a convex hull for a given array of 3D points.
  14. The average time complexity for this task is considered to be O(nlog(n)).
  15. </p>
  16. <h2>Import</h2>
  17. <p>
  18. [name] is an add-on, and must be imported explicitly.
  19. See [link:#manual/introduction/Installation Installation / Addons].
  20. </p>
  21. <code>
  22. import { ConvexGeometry } from 'three/addons/geometries/ConvexGeometry.js';
  23. </code>
  24. <h2>Code Example</h2>
  25. <code>const geometry = new ConvexGeometry( points );
  26. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  27. const mesh = new THREE.Mesh( geometry, material );
  28. scene.add( mesh );
  29. </code>
  30. <h2>Examples</h2>
  31. <p>[example:webgl_geometry_convex geometry / convex ]</p>
  32. <h2>Constructor</h2>
  33. <h3>[name]( [param:Array points] )</h3>
  34. <p>
  35. points — Array of [page:Vector3 Vector3s] that the resulting convex hull will contain.
  36. </p>
  37. <h2>Source</h2>
  38. <p>
  39. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/ConvexGeometry.js examples/jsm/geometries/ConvexGeometry.js]
  40. </p>
  41. </body>
  42. </html>