1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00

Extrude and Shape geometries #112

This commit is contained in:
Kevin Levron 2022-02-03 19:58:55 +01:00
parent 5ad5e878e7
commit 74c2f509e2
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import { PropType } from 'vue'
import { geometryComponent } from './Geometry'
import { ExtrudeGeometry, ExtrudeGeometryOptions, Shape } from 'three'
export const props = {
shapes: { type: [Object, Array] as PropType<Shape | Shape[]> },
options: { type: Object as PropType<ExtrudeGeometryOptions> },
} as const
export function createGeometry(comp: any): ExtrudeGeometry {
return new ExtrudeGeometry(comp.shapes, comp.options)
}
export default geometryComponent('ExtrudeGeometry', props, createGeometry)

View File

@ -0,0 +1,14 @@
import { PropType } from 'vue'
import { geometryComponent } from './Geometry'
import { Shape, ShapeGeometry } from 'three'
export const props = {
shapes: { type: [Object, Array] as PropType<Shape | Shape[]> },
curveSegments: { type: Number },
} as const
export function createGeometry(comp: any): ShapeGeometry {
return new ShapeGeometry(comp.shapes, comp.curveSegments)
}
export default geometryComponent('ShapeGeometry', props, createGeometry)

View File

@ -5,6 +5,7 @@ export { default as CircleGeometry } from './CircleGeometry'
export { default as ConeGeometry } from './ConeGeometry' export { default as ConeGeometry } from './ConeGeometry'
export { default as CylinderGeometry } from './CylinderGeometry' export { default as CylinderGeometry } from './CylinderGeometry'
export { default as DodecahedronGeometry } from './DodecahedronGeometry' export { default as DodecahedronGeometry } from './DodecahedronGeometry'
export { default as ExtrudeGeometry } from './ExtrudeGeometry'
export { default as IcosahedronGeometry } from './IcosahedronGeometry' export { default as IcosahedronGeometry } from './IcosahedronGeometry'
export { default as LatheGeometry } from './LatheGeometry' export { default as LatheGeometry } from './LatheGeometry'
export { default as OctahedronGeometry } from './OctahedronGeometry' export { default as OctahedronGeometry } from './OctahedronGeometry'
@ -12,6 +13,7 @@ export { default as PlaneGeometry } from './PlaneGeometry'
export { default as PolyhedronGeometry } from './PolyhedronGeometry' export { default as PolyhedronGeometry } from './PolyhedronGeometry'
export { default as RingGeometry } from './RingGeometry' export { default as RingGeometry } from './RingGeometry'
export { default as SphereGeometry } from './SphereGeometry' export { default as SphereGeometry } from './SphereGeometry'
export { default as ShapeGeometry } from './ShapeGeometry'
export { default as TetrahedronGeometry } from './TetrahedronGeometry' export { default as TetrahedronGeometry } from './TetrahedronGeometry'
export { default as TorusGeometry } from './TorusGeometry' export { default as TorusGeometry } from './TorusGeometry'
export { default as TorusKnotGeometry } from './TorusKnotGeometry' export { default as TorusKnotGeometry } from './TorusKnotGeometry'