Code Monkey home page Code Monkey logo

primitive-ellipsoid's Introduction

primitive-ellipsoid

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

An ellipsoid geometry for 3D rendering, including normals, UVs and cell indices (faces).

paypal coinbase twitter

Installation

npm install primitive-ellipsoid

Usage

import createEllipsoid from "primitive-ellipsoid";

const radius = 1;
const geometry = createEllipsoid(radius, {
  latSegments: 64,
  lngSegments: 64,
  rx: 2,
  ry: 1,
  rz: 1,
});

console.log(geometry);
// {
//   positions: [ [x, y, z], [x, y, z], ... ],
//   cells: [ [a, b, c], [a, b, c], ... ],
//   uvs: [ [u, v], [u, v], ... ],
//   normals: [ [x, y, z], [x, y, z], ... ]
// }

API

Functions

createEllipsoid(radius, [options])SimplicialComplex

An ellipsoid geometry for 3D rendering, including normals, UVs and cell indices (faces).

Typedefs

vec3 : Array.<number>
Options : Object
SimplicialComplex : Object

Geometry definition.

createEllipsoid(radius, [options]) ⇒ SimplicialComplex

An ellipsoid geometry for 3D rendering, including normals, UVs and cell indices (faces).

Kind: global function
See: Wolfram MathWorld Ellipsoid

Param Type Default Description
radius number 1 Base radius
[options] Options {}

vec3 : Array.<number>

Kind: global typedef

Options : Object

Kind: global typedef
Properties

Name Type Default Description
[latSegments] number 64 Number of latitudinal segments.
[lngSegments] number 64 Number of longitudinal segments.
[rx] number 2 Radius in the x direction.
[ry] number 1 Radius in the y direction.
[rz] number 1 Radius in the z direction.

SimplicialComplex : Object

Geometry definition.

Kind: global typedef
Properties

Name Type
positions Array.<vec3>
normals Array.<vec3>
uvs Array.<vec3>
cells Array.<vec3>

License

MIT. See license file.

primitive-ellipsoid's People

Contributors

dmnsgn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kevzettler

primitive-ellipsoid's Issues

NPM start fails with shader error

Uncaught Error: Vertex shader error: null
    at compileSource (program.js:91)
    at updateProgram (program.js:60)
    at createProgram (program.js:50)
    at Object.program (index.js:420)
    at createPipeline (pipeline.js:44)
    at Object.pipeline (index.js:424)
    at Object.1.../ (index.js:65)
    at o (_prelude.js:1)
    at r (_prelude.js:1)
    at _prelude.js:1`

Screenshot 2020-04-14 13 04 26

Exported module is not transpiled and ES5 compatible

primitive-ellipsoid/index.js

appears to be using default argument syntax and is failing to import into my project which isn't setup for this Ecmascript Feature.

The exported primitive-ellipsoid module in index.js should be transpired to generic ES

Uncaught Error: Module parse failed: /Users/kevzettler/code/crashgiants/node_modules/primitive-ellipsoid/index.js Unexpected token (8:4)
You may need an appropriate loader to handle this file type.
|   // Default to an oblate spheroid
|   const { latSegments = 32, lngSegments = 64, rx = 2, ry = 1, rz = 1 } = {
|     ...options
|   };
| 
    at Object../node_modules/primitive-ellipsoid/index.js (index.js:68)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.