moxiaomomo / three-full

A quick way to gather all example modules of threejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

three-full

A quick way to gather almost example modules of threejs

Processing steps (tested on r108)

    1. Using shell to list all modules to a custom file
cd node_modules/three
egrep "export (const|function|class|interface)" examples/* -nr | grep "\.d\.ts" | egrep -v "\/GLTFLoader|\/VTKLoader|\/XLoader|\/TessellateModifier|\/Water2|\/BokehShader2|\/TextureCubeUVNode|\/TextureCubeNode|\/SubSlot" | awk -F: '{print $1}' | sed s/\.d\.ts//g | sort | uniq | awk '{print "export * from '\''three/" $1 "'\'';"}' > /yourpath/somefile.ts
    1. Add the remaining modules to /yourpath/somefile.ts
export { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
export { Water as Water2 } from 'three/examples/jsm/objects/Water2';
export { BokehShader as BokehShader2 } from 'three/examples/jsm/shaders/BokehShader2';
// The following modules can be imported separately manually
// import { VRMLLoader as XLoader } from 'three/examples/jsm/loaders/XLoader';
// import { VRMLLoader as VTKLoader } from 'three/examples/jsm/loaders/VTKLoader';
// import { SubdivisionModifier as TessellateModifier } from 'three/examples/jsm/modifiers/TessellateModifier';
    1. other discussions

mrdoob/three.js#17409

Processing steps (tested on r116)

    1. Using shell to list all modules to a custom file
cd node_modules/three
egrep "export (const|function|class|interface)" examples/* -nr | grep "\.d\.ts" | egrep -v "\/GLTFLoader|\/VTKLoader|\/XLoader|\/TessellateModifier|\/Water2|\/BokehShader2|\/TextureCubeUVNode|\/TextureCubeNode|\/SubSlot" | awk -F: '{print $1}' | sed s/\.d\.ts//g | sort | uniq | awk '{print "export * from '\''three/" $1 "'\'';"}' > /yourpath/somefile.ts
egrep "export (const|function|class|interface)" src/extras/* -nr | grep "\.d\.ts" | awk -F: '{print $1}' | sed s/\.d\.ts//g | sort | uniq | awk '{print "export * from '\''three/" $1 "'\'';"}' >> /yourpath/somefile.ts
    1. Add the remaining modules to /yourpath/somefile.ts
export { GLTFLoader, GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
export { Water as Water2 } from 'three/examples/jsm/objects/Water2';
export { BokehShader as BokehShader2 } from 'three/examples/jsm/shaders/BokehShader2';

About

A quick way to gather all example modules of threejs