From e659b55f9b015f4291be7a50ab4d3f078f13e117 Mon Sep 17 00:00:00 2001 From: Hirako Date: Sat, 29 Jul 2017 13:31:47 +0700 Subject: [PATCH] Adds types for Extrude, adds missing export for other meshes #297 --- types/components/meshes/index.d.ts | 3 +++ types/whs-tests.ts | 43 ++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/types/components/meshes/index.d.ts b/types/components/meshes/index.d.ts index b4ac0f608..09b9b6dcb 100644 --- a/types/components/meshes/index.d.ts +++ b/types/components/meshes/index.d.ts @@ -1,5 +1,8 @@ export * from './Box'; export * from './Cone'; +export * from './Cylinder' +export * from './Dodecahedron'; +export * from './Extrude'; export * from './Sphere'; export * from './Text'; export * from './Tetrahedron'; diff --git a/types/whs-tests.ts b/types/whs-tests.ts index f5a498d46..7fec23a40 100644 --- a/types/whs-tests.ts +++ b/types/whs-tests.ts @@ -1,4 +1,8 @@ -import {MeshStandardMaterial} from 'three'; +import { + MeshStandardMaterial, + Shape, + Vector2 +} from 'three'; import { Loop, @@ -13,9 +17,10 @@ import { Box, Cone, CubeCamera, + Extrude, OrthographicCamera, PerspectiveCamera, - Sphere, + Sphere } from './components'; import { @@ -103,6 +108,40 @@ const cone = new Cone({build: false}); cone.buildGeometry({buffer: true}); cone.addTo(app); +const shape = new Shape([ + new Vector2(-4,-4), + new Vector2(-2,0), + new Vector2(-4,4), + new Vector2(0,2), + new Vector2(4,4), + new Vector2(2,0), + new Vector2(4,-4), + new Vector2(0,-2) +]); + +let extrude = new Extrude({ + build: false, + geometry: { + shapes: shape, + options: { + bevelEnabled: false, + bevelSize: 0, + amount: 2 + } + } +}); + +extrude = new Extrude({ + geometry: { + shapes: [shape, shape], + options: { + bevelEnabled: false, + bevelSize: 0, + amount: 2 + } + } +}); + // Cameras const cubeCamera = new CubeCamera({