LatheGeometry - Verge3D 用户手册 - Soft8Soft
Description: 了解如何在使用 Verge3D 制作的交互式 3D 应用程序中使用 LatheGeometry

BufferGeometry →

# LatheGeometry

Creates meshes with axial symmetry like vases. The lathe rotates around the Y (vertical) axis.

## Code Example

`const points = []; for (let i = 0; i < 10; i++) { points.push(new v3d.Vector2(Math.sin(i * 0.2) * 2 + 1, (i - 5) * 0.5)); } const geometry = new v3d.LatheGeometry(points); const material = v3d.MaterialUtils.createStandardPBRMaterial(); material.side = v3d.DoubleSide; const lathe = new v3d.Mesh(geometry, material); app.scene.add(lathe);`

## Constructor

### LatheGeometry(points : Array, segments : Integer, phiStart : Float, phiLength : Float)

- points — array of two-dimensional vectors. The X-coordinate of each point must be greater than zero. Default is an array with `(0, -0.5)`, `(0.5, 0)`, and `(0, 0.5)` which creates a simple diamond shape.
- segments — the number of circumference segments to generate. Default is `12`.
- phiStart — the starting angle in radians. Default is `0`.
- phiLength — the radian (0 to 2π) range of the lathed section: 2π is a closed lathe, less than 2π is a portion. Default is 2π.

This creates a LatheGeometry based on the parameters.

Procedural geometry is fun. However, in real life applications this feature is rarely needed. It would be more efficient do design lathes in the preferred modelling suite and export/load to Verge3D via glTF.

## Properties

See the base BufferGeometry class for common properties.

### # .parameters : Object

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

## Methods

See the base BufferGeometry class for common methods.

## 源代码

关于如何获取此模块的源代码，请查看 本页。