New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

icomesh

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icomesh

Fast icosphere mesh generation

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

icomesh

Fast JavaScript icosphere mesh generation library for WebGL visualizations. Interactive demo:

Icosphere mesh

Icosphere is a type of geodesic polyhedron that provides a good quality triangular mesh approximation of a sphere with relatively evenly distributed vertices. This project is inspired by an article by Andreas Kahler.

Build Status minzipped size Simply Awesome

Example

import icomesh from 'icomesh';

// generate an icosphere with 4 subdivisions
const {vertices, triangles} = icomesh(4);

API

icomesh(order = 4, uvMap = false)

Generates an icosphere mesh with order subdivisions (4 by default, 10 max). Returns an object with:

  • vertices: A Float32Array array of x, y, z vertices.
  • triangles: A Uint16Array or Uint32Array array of triangle indices.
  • uv: if uvMap is true, a Float32Array of u, v values for mapping vertices to a texture with an equirectangular projection.

You can reuse vertex data for normals because they are equal for a unit sphere.

Install

Install with npm install icomesh or yarn add icomesh (module environments only), or use a browser build from CDN:

Keywords

icosphere

FAQs

Package last updated on 27 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts