All Projects → ycw → three-strip

ycw / three-strip

Licence: MIT license
Generate strip geometry for three.js. Supports taper, twist, dasharray and uvgen.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to three-strip

3dtilesrendererjs
Renderer for 3D Tiles in Javascript using three.js
Stars: ✭ 333 (+2120%)
Mutual labels:  threejs, geometry
Cga.js
CGA 3D 计算几何算法库 | 3D Compute Geometry Algorithm Library webgl three.js babylon.js等任何库都可以使用
Stars: ✭ 313 (+1986.67%)
Mutual labels:  threejs, geometry
THREEg.js
three.js addon to create special or extended geometries. The addon generates indexed or non indexed BufferGeometries.
Stars: ✭ 33 (+120%)
Mutual labels:  threejs, geometry
humke-4d-geometry
A web-based 4D Geometry viewer
Stars: ✭ 51 (+240%)
Mutual labels:  threejs, geometry
Ifc.js
Ifc viewer for client applications.
Stars: ✭ 211 (+1306.67%)
Mutual labels:  threejs, geometry
Threef.js
three.js addon, to produce almost infinite many time-varying geometries / buffer geometries with functions (cylindrical coordinates)
Stars: ✭ 19 (+26.67%)
Mutual labels:  threejs, geometry
Three Mesh Bvh
A BVH implementation to speed up raycasting against three.js meshes.
Stars: ✭ 302 (+1913.33%)
Mutual labels:  threejs, geometry
Threejs Sandbox
Set of experiments and extensions to THREE.js.
Stars: ✭ 163 (+986.67%)
Mutual labels:  threejs, geometry
three-csg-ts
CSG library for use with THREE.js
Stars: ✭ 312 (+1980%)
Mutual labels:  threejs, geometry
source-engine-model-loader
Three.js loader for parsing Valve's Source Engine models
Stars: ✭ 54 (+260%)
Mutual labels:  threejs, geometry
blockcraft-public
BlockCraft is a WebGL implementation of an infinite procedurally-generated voxel world that runs on the browser. This project originally spawned as a Minecraft Classic clone but has expanded to include multiplayer PvP, crafting, shaders and much more!
Stars: ✭ 22 (+46.67%)
Mutual labels:  threejs
pcc geo cnn v2
Improved Deep Point Cloud Geometry Compression
Stars: ✭ 55 (+266.67%)
Mutual labels:  geometry
frontend-park
哈喽大家好~我是荣顶!这是一个有趣的前端趣味知识公园~该项目是我平时捣鼓前端相关技术的一些案例集合。
Stars: ✭ 66 (+340%)
Mutual labels:  threejs
react-with-threejs-example
An example project integrating React with three.js
Stars: ✭ 27 (+80%)
Mutual labels:  threejs
polygon-splitter
A small (<10kb minified) javascript library for splitting polygons by a polyline.
Stars: ✭ 20 (+33.33%)
Mutual labels:  geometry
building-editor
3D model editor for building/architecture
Stars: ✭ 24 (+60%)
Mutual labels:  threejs
gl-bench
⏱ WebGL performance monitor with CPU/GPU load.
Stars: ✭ 146 (+873.33%)
Mutual labels:  threejs
PolyDraw
✳️ PTSource PolyDraw is a free 3D polygonal modeller for Windows x86 and x64, for creating or modifying 3D objects using a mesh of 3D points and parametric NURBS Curves .Exports and imports to over 40 formats including WebVR and 3D Printing.
Stars: ✭ 17 (+13.33%)
Mutual labels:  threejs
s2
R bindings for Google's s2 library for geometry on the sphere
Stars: ✭ 29 (+93.33%)
Mutual labels:  geometry
icosa-viewer
3D Viewer component for Tilt Brush / Open Brush, Google Blocks files and their derivatives
Stars: ✭ 24 (+60%)
Mutual labels:  threejs

About three-strip

Generate strip geometry for three.js. Supports taper, twist, dasharray and uvgen.

Testbed

Installation

via cdn

https://cdn.jsdelivr.net/gh/ycw/three-strip@{VERSION}/build/three-strip.js

or npm

$ npm i ycw/three-strip
$ npm i ycw/three-strip#{VERSION_TAG}

Usage

import * as THREE from "three";
import { Strip, StripGeometry, StripHelper } from "three-strip";

const curve = new THREE.LineCurve3(..);
const radius = (i, I) => 1 - i / I; // taper
const tilt = (i, I) => i / I * Math.PI; // twist
const strip = new Strip(curve, radius, tilt);

const segments = 100;
const geom = new StripGeometry(strip, segments);
const mesh = new THREE.Mesh(geom, mat);
scene.add(mesh);

scene.add(new StripHelper(strip, segments));

Docs

Strip

new (curve, radius?, tilt?);
// curve: 3d curve or curvepath
// radius: half breadth
// tilt: twist angle (in radian) around tangent
  • .curve
  • .radius
  • .tilt
  • .computeFrames(nSeg) : Get r-handed coords frames.

StripGeometry ( extends BufferGeometry )

new (strip, nSeg, uvFn?);
new (strip, [nSeg, dashArray?, dashOffset?], uvFn?);
// nSeg: segment count ( +ve int )
// dashArray: dash-gap list ( +ve ints )
// dashOffset: dash offset ( int )
// uvFn: uvgen fn ( see UvPreset )

Ex. dashed strip

new StripGeometry(strip, [10, [1, 2, 3]]);
// since dashArray has odd number of values, it's repeated
// to yield even number of values, i.e. [1,2,3,1,2,3]

StripHelper ( extends LineSegments )

new (strip, segments, size?, xColor?, yColor?, zColor?);
  • .strip
  • .segments : segment count
  • .size : axes length
  • .xColor : x-axis color
  • .yColor : y-axis color
  • .zColor : z-axis color
  • .update() : update helper

Ex. update helper props

const helper = new StripHelper(strip, 10);
helper.xColor.setClassName("purple");
helper.segments *= 2;
helper.update();

UvPreset

UvPreset.dash; // arr of dash-space uv fns.
UvPreset.strip; // arr of strip-space uv fns.

Ex.

new StripGeometry(strip, [100, [1, 2]], UvPreset.dash[0]);
new StripGeometry(strip, 100, UvPreset.strip[0]);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].