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:
parent
5ad5e878e7
commit
74c2f509e2
14
src/geometries/ExtrudeGeometry.ts
Normal file
14
src/geometries/ExtrudeGeometry.ts
Normal 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)
|
14
src/geometries/ShapeGeometry.ts
Normal file
14
src/geometries/ShapeGeometry.ts
Normal 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)
|
@ -5,6 +5,7 @@ export { default as CircleGeometry } from './CircleGeometry'
|
||||
export { default as ConeGeometry } from './ConeGeometry'
|
||||
export { default as CylinderGeometry } from './CylinderGeometry'
|
||||
export { default as DodecahedronGeometry } from './DodecahedronGeometry'
|
||||
export { default as ExtrudeGeometry } from './ExtrudeGeometry'
|
||||
export { default as IcosahedronGeometry } from './IcosahedronGeometry'
|
||||
export { default as LatheGeometry } from './LatheGeometry'
|
||||
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 RingGeometry } from './RingGeometry'
|
||||
export { default as SphereGeometry } from './SphereGeometry'
|
||||
export { default as ShapeGeometry } from './ShapeGeometry'
|
||||
export { default as TetrahedronGeometry } from './TetrahedronGeometry'
|
||||
export { default as TorusGeometry } from './TorusGeometry'
|
||||
export { default as TorusKnotGeometry } from './TorusKnotGeometry'
|
||||
|
Loading…
Reference in New Issue
Block a user