import { Geometry } from "https://deno.land/x/threejs_4_deno@v121/src/core/Geometry.js";
Base class for geometries
Properties
Array of vertex colors, matching number and order of vertices. Used in ParticleSystem, Line and Ribbon. Meshes use per-face-use-of-vertex colors embedded directly in faces. To signal an update in this array, Geometry.colorsNeedUpdate needs to be set to true.
Array of triangles or/and quads. The array of faces describe how each vertex in the model is connected with each other. To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true.
Array of face UV layers. Each UV layer is an array of UV matching order and number of vertices in faces. To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true.
Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object:
morphNormal = { name: "NormalName", normals: [ new THREE.Vector3(), ... ] }
Array of morph targets. Each morph target is a Javascript object:
{ name: "targetName", vertices: [ new THREE.Vector3(), ... ] }
Morph vertices match number and order of primary vertices.
The array of vertices hold every position of points of the model. To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true.
Methods
Computes bounding box of the geometry, updating Geometry.boundingBox attribute.
Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute. Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null.
Computes vertex normals by averaging face normals. Face normals must be existing / computed beforehand.
Removes The object from memory. Don't forget to call this method when you remove an geometry because it can cuase meomory leaks.
Checks for duplicate vertices using hashmap. Duplicated vertices are removed and faces' vertices are updated.