|
@@ -0,0 +1,113 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="it">
|
|
|
+ <head>
|
|
|
+ <meta charset="utf-8" />
|
|
|
+ <base href="../../../" />
|
|
|
+ <script src="page.js"></script>
|
|
|
+ <link type="text/css" rel="stylesheet" href="page.css" />
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ [page:BufferGeometry] →
|
|
|
+
|
|
|
+ <h1>[name]</h1>
|
|
|
+
|
|
|
+ <p class="desc">Crea una geometria estrusa da una forma di tracciato (path shape).</p>
|
|
|
+
|
|
|
+ <iframe id="scene" src="scenes/geometry-browser.html#ExtrudeGeometry"></iframe>
|
|
|
+
|
|
|
+ <script>
|
|
|
+
|
|
|
+ // iOS iframe auto-resize workaround
|
|
|
+
|
|
|
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
|
|
|
+
|
|
|
+ const scene = document.getElementById( 'scene' );
|
|
|
+
|
|
|
+ scene.style.width = getComputedStyle( scene ).width;
|
|
|
+ scene.style.height = getComputedStyle( scene ).height;
|
|
|
+ scene.setAttribute( 'scrolling', 'no' );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <h2>Codice di Esempio</h2>
|
|
|
+
|
|
|
+
|
|
|
+ <code>
|
|
|
+ const length = 12, width = 8;
|
|
|
+
|
|
|
+ const shape = new THREE.Shape();
|
|
|
+ shape.moveTo( 0,0 );
|
|
|
+ shape.lineTo( 0, width );
|
|
|
+ shape.lineTo( length, width );
|
|
|
+ shape.lineTo( length, 0 );
|
|
|
+ shape.lineTo( 0, 0 );
|
|
|
+
|
|
|
+ const extrudeSettings = {
|
|
|
+ steps: 2,
|
|
|
+ depth: 16,
|
|
|
+ bevelEnabled: true,
|
|
|
+ bevelThickness: 1,
|
|
|
+ bevelSize: 1,
|
|
|
+ bevelOffset: 0,
|
|
|
+ bevelSegments: 1
|
|
|
+ };
|
|
|
+
|
|
|
+ const geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
|
|
|
+ const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
|
|
|
+ const mesh = new THREE.Mesh( geometry, material ) ;
|
|
|
+ scene.add( mesh );
|
|
|
+ </code>
|
|
|
+
|
|
|
+
|
|
|
+ <h2>Costruttore</h2>
|
|
|
+
|
|
|
+
|
|
|
+ <h3>[name]([param:Array shapes], [param:Object options])</h3>
|
|
|
+ <p>
|
|
|
+ shapes — Shape o un array di shape. <br />
|
|
|
+ options — Oggetto che può contenere i seguenti parametri.
|
|
|
+
|
|
|
+ <ul>
|
|
|
+ <li>curveSegments — int. Numero di punti sulle curve. Il valore predefinito è 12.</li>
|
|
|
+ <li>steps — int. Numero di punti utilizzati per suddividere i segmenti lungo la profondità della spline estrusa. Il valore predefinito è 1.</li>
|
|
|
+ <li>depth — float. Profondità per estrudere la forma. Il valore predefinito è 1.</li>
|
|
|
+ <li>bevelEnabled — bool. Applica la smussatura alla forma. Il valore predefinito è true.</li>
|
|
|
+ <li>bevelThickness — float. Quanto in profondità nella forma originale va la smussatura. Il valore predefinito è 0.2.</li>
|
|
|
+ <li>bevelSize — float. Distanza dal contorno della forma a cui si estende lo smusso. Il valore predefinito è bevelThickness - 0.1.</li>
|
|
|
+ <li>bevelOffset — float. Distanza dal contorno della forma a cui inizia lo smusso. Il valore predefinito è 0.</li>
|
|
|
+ <li>bevelSegments — int. Numero di strati di smusso. Il valore predefinito è 3.</li>
|
|
|
+ <li>extrudePath — THREE.Curve. Un path spline 3D lungo il quale deve essere eatrusa la forma. Smussi non supportati per l'estrusione del percorso.</li>
|
|
|
+ <li>UVGenerator — Object. Oggetto che fornisce le funzioni di generatore UV</li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ Questo oggetto estrude una forma 2D in una geometria 3D.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <p>
|
|
|
+ Quando viene creata una Mesh con questa geometria, se desideri utilizzare un materiale separato per
|
|
|
+ la sua faccia e i suoi lati estrusi, puoi utilizzare l'array dei materiali. Il primo materiale
|
|
|
+ sarà applicato alla faccia; il secondo materiale sarà applicato ai lati.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <h2>Proprietà</h2>
|
|
|
+ <p>Vedi la classe base [page:BufferGeometry] per le proprietà comuni.</p>
|
|
|
+
|
|
|
+ <h3>[property:Object parameters]</h3>
|
|
|
+ <p>
|
|
|
+ Un oggetto con una proprietà per ognuno dei parametri del costruttore. Qualsiasi modifica dopo l'istanziazione non cambia la geometria.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <h2>Metodi</h2>
|
|
|
+ <p>Vedi la classe base [page:BufferGeometry] per i metodi comuni.</p>
|
|
|
+
|
|
|
+ <h2>Source</h2>
|
|
|
+
|
|
|
+ <p>
|
|
|
+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
+ </p>
|
|
|
+ </body>
|
|
|
+</html>
|