three-fatline

A ThreeJS Line object with variable width

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
three-fatline
6860.7.02 days ago5 years agoMinified + gzip package size for three-fatline in KB

Readme

three-fatline
!NPM packagenpm-imgnpm-url !Build Sizebuild-size-imgbuild-size-url !NPM Downloadsnpm-downloads-imgnpm-downloads-url
A modularized version of https://github.com/mrdoob/three.jsm/blob/master/examples/js/lines/.
See the example (source)

Usage Example:

import { Line2, LineGeometry, LineMaterial } from 'three-fatline';

const geometry = new LineGeometry();
geometry.setPositions([-160, 200, 0, 0, -200, 0, 160, 200, 0]); // [ x1, y1, z1,  x2, y2, z2, ... ] format

const material = new LineMaterial({
  color: 'red',
  linewidth: 10, // px
  resolution: new THREE.Vector2(640, 480) // resolution of the viewport
  // dashed, dashScale, dashSize, gapSize
});

const myLine = new Line2(geometry, material);

myLine.computeLineDistances();