2
0

ShapeGeometry.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html>
  2. <html lang="ar">
  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 class="rtl">
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. ينشئ هندسة متعددة الأضلاع من جانب واحد من شكل واحد أو أكثر من المسارات.
  14. </p>
  15. <iframe
  16. id="scene"
  17. src="scenes/geometry-browser.html#ShapeGeometry"
  18. ></iframe>
  19. <script>
  20. // iOS iframe auto-resize workaround
  21. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  22. const scene = document.getElementById( 'scene' );
  23. scene.style.width = getComputedStyle( scene ).width;
  24. scene.style.height = getComputedStyle( scene ).height;
  25. scene.setAttribute( 'scrolling', 'no' );
  26. }
  27. </script>
  28. <h2>Code Example</h2>
  29. <code>
  30. const x = 0, y = 0;
  31. const heartShape = new THREE.Shape();
  32. heartShape.moveTo( x + 5, y + 5 );
  33. heartShape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );
  34. heartShape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );
  35. heartShape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );
  36. heartShape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );
  37. heartShape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );
  38. heartShape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );
  39. const geometry = new THREE.ShapeGeometry( heartShape );
  40. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  41. const mesh = new THREE.Mesh( geometry, material ) ;
  42. scene.add( mesh );
  43. </code>
  44. <h2>المنشئ (Constructor)</h2>
  45. <h3>[name]([param:Array shapes], [param:Integer curveSegments])</h3>
  46. <p>
  47. shapes — [page:Array] من الأشكال أو [page:Shape shape] واحد. الافتراضي هو
  48. شكل مثلث واحد.<br />
  49. curveSegments - [page:Integer] - عدد القطاعات لكل شكل. الافتراضي هو
  50. 12.
  51. </p>
  52. <h2>الخصائص (Properties)</h2>
  53. <p>انظر فئة [page:BufferGeometry] الأساسية للخصائص المشتركة.</p>
  54. <h3>[property:Object parameters]</h3>
  55. <p>
  56. كائن به خاصية لكل من معلمات المُنشئ. أي تعديل بعد التجسيد لا يغير الهندسة.
  57. </p>
  58. <h2>الطرق (Methods)</h2>
  59. <p>انظر فئة [page:BufferGeometry] الأساسية للطرق المشتركة.</p>
  60. <h2>المصدر (Source)</h2>
  61. <p>
  62. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  63. </p>
  64. </body>
  65. </html>