This repository was archived by the owner on Oct 19, 2020. It is now read-only.
File tree 22 files changed +35
-33
lines changed
aframe/component/architecture-toolkit
22 files changed +35
-33
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import updateSchema from './common/update-schema.js'
6
6
import generateNormals from '../../../utils/data3d/buffer/get-normals'
7
7
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
8
8
import cloneDeep from 'lodash/cloneDeep'
9
- import closetData3d from '../../../scene/structure/parametric-objects/closet'
9
+ import getClosetData3d from '../../../scene/structure/parametric-objects/closet'
10
10
import dataToMaterials from './common/data-to-materials'
11
11
12
12
export default {
@@ -28,7 +28,7 @@ export default {
28
28
29
29
attributes . materials = dataToMaterials ( data )
30
30
31
- closetData3d ( attributes )
31
+ getClosetData3d ( attributes )
32
32
. then ( data3d => {
33
33
34
34
// create new one
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import updateSchema from './common/update-schema.js'
6
6
import generateNormals from '../../../utils/data3d/buffer/get-normals'
7
7
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
8
8
import cloneDeep from 'lodash/cloneDeep'
9
- import columnData3d from '../../../scene/structure/parametric-objects/column'
9
+ import getColumnData3d from '../../../scene/structure/parametric-objects/column'
10
10
import dataToMaterials from './common/data-to-materials'
11
11
12
12
export default {
@@ -28,10 +28,10 @@ export default {
28
28
var attributes = cloneDeep ( data )
29
29
30
30
attributes . materials = dataToMaterials ( data )
31
-
31
+
32
32
// construct data3d object
33
33
34
- var data3d = columnData3d ( attributes )
34
+ var data3d = getColumnData3d ( attributes )
35
35
. then ( data3d => {
36
36
// create new one
37
37
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import getMaterial from '../../../scene/structure/parametric-objects/common/get-
5
5
import updateSchema from './common/update-schema.js'
6
6
import generateNormals from '../../../utils/data3d/buffer/get-normals'
7
7
import cloneDeep from 'lodash/cloneDeep'
8
- import doorData3d from '../../../scene/structure/parametric-objects/door'
8
+ import getDoorData3d from '../../../scene/structure/parametric-objects/door'
9
9
import dataToMaterials from './common/data-to-materials'
10
10
11
11
export default {
@@ -53,7 +53,7 @@ export default {
53
53
attributes . materials = dataToMaterials ( data )
54
54
55
55
// construct data3d object
56
- var data3d = await doorData3d ( attributes )
56
+ var data3d = await getDoorData3d ( attributes )
57
57
58
58
// create new one
59
59
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change 5
5
import getSchema from './common/get-schema.js'
6
6
import updateSchema from './common/update-schema.js'
7
7
import cloneDeep from 'lodash/cloneDeep'
8
- import floorData3d from '../../../scene/structure/parametric-objects/floor'
8
+ import getFloorData3d from '../../../scene/structure/parametric-objects/floor'
9
9
import dataToMaterials from './common/data-to-materials'
10
10
11
11
export default {
@@ -29,7 +29,7 @@ export default {
29
29
attributes . materials = dataToMaterials ( data )
30
30
31
31
// construct data3d object
32
- var data3d = await floorData3d ( attributes )
32
+ var data3d = await getFloorData3d ( attributes )
33
33
34
34
// create new one
35
35
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Promise from 'bluebird'
4
4
import getSchema from './common/get-schema.js'
5
5
import updateSchema from './common/update-schema.js'
6
6
import cloneDeep from 'lodash/cloneDeep'
7
- import kitchenData3d from '../../../scene/structure/parametric-objects/kitchen'
7
+ import getKitchenData3d from '../../../scene/structure/parametric-objects/kitchen'
8
8
import dataToMaterials from './common/data-to-materials'
9
9
10
10
export default {
@@ -28,7 +28,7 @@ export default {
28
28
29
29
// get meshes and materials
30
30
// promise base because it loads external meshes
31
- var data3d = await kitchenData3d ( attributes )
31
+ var data3d = await getKitchenData3d ( attributes )
32
32
33
33
// create new one
34
34
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import generatePolygonBuffer from '../../../utils/data3d/buffer/get-polygon'
7
7
import generateExtrusionBuffer from '../../../utils/data3d/buffer/get-extrusion'
8
8
import generateNormals from '../../../utils/data3d/buffer/get-normals'
9
9
import cloneDeep from 'lodash/cloneDeep'
10
- import polyfloorData3d from '../../../scene/structure/parametric-objects/polyfloor'
10
+ import getPolyfloorData3d from '../../../scene/structure/parametric-objects/polyfloor'
11
11
import dataToMaterials from './common/data-to-materials'
12
12
13
13
export default {
@@ -31,7 +31,7 @@ export default {
31
31
attributes . materials = dataToMaterials ( data )
32
32
33
33
// construct data3d object
34
- var data3d = await polyfloorData3d ( attributes )
34
+ var data3d = await getPolyfloorData3d ( attributes )
35
35
36
36
// create new one
37
37
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import getMaterial from '../../../scene/structure/parametric-objects/common/get-
5
5
import updateSchema from './common/update-schema.js'
6
6
import generateNormals from '../../../utils/data3d/buffer/get-normals'
7
7
import cloneDeep from 'lodash/cloneDeep'
8
- import wallRailing3d from '../../../scene/structure/parametric-objects/railing'
8
+ import getRailingData3d from '../../../scene/structure/parametric-objects/railing'
9
9
import dataToMaterials from './common/data-to-materials'
10
10
11
11
export default {
@@ -29,7 +29,7 @@ export default {
29
29
attributes . materials = dataToMaterials ( data )
30
30
31
31
// construct data3d object
32
- let data3d = await wallRailing3d ( attributes )
32
+ let data3d = await getRailingData3d ( attributes )
33
33
34
34
// create new one
35
35
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import updateSchema from './common/update-schema.js'
6
6
import generateNormals from '../../../utils/data3d/buffer/get-normals'
7
7
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
8
8
import cloneDeep from 'lodash/cloneDeep'
9
- import stairsData3d from '../../../scene/structure/parametric-objects/stairs'
9
+ import getStairsData3d from '../../../scene/structure/parametric-objects/stairs'
10
10
import dataToMaterials from './common/data-to-materials'
11
11
12
12
export default {
@@ -29,7 +29,7 @@ export default {
29
29
30
30
attributes . materials = dataToMaterials ( data )
31
31
32
- var data3d = await stairsData3d ( attributes )
32
+ var data3d = await getStairsData3d ( attributes )
33
33
34
34
// create new one
35
35
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import updateSchema from './common/update-schema.js'
5
5
import generateNormals from '../../../utils/data3d/buffer/get-normals'
6
6
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
7
7
import cloneDeep from 'lodash/cloneDeep'
8
- import wallData3d from '../../../scene/structure/parametric-objects/wall'
8
+ import getWallData3d from '../../../scene/structure/parametric-objects/wall'
9
9
import getMaterial from '../../../scene/structure/parametric-objects/common/get-material.js'
10
10
import dataToMaterials from './common/data-to-materials'
11
11
export default {
@@ -86,7 +86,7 @@ export default {
86
86
attributes . materials = dataToMaterials ( data )
87
87
88
88
// get meshes and materials from el3d modules
89
- let data3d = await wallData3d ( attributes )
89
+ let data3d = await getWallData3d ( attributes )
90
90
91
91
// create new one
92
92
this_ . mesh = new THREE . Object3D ( )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import getSchema from './common/get-schema.js'
4
4
import getMaterial from '../../../scene/structure/parametric-objects/common/get-material.js'
5
5
import updateSchema from './common/update-schema.js'
6
6
import cloneDeep from 'lodash/cloneDeep'
7
- import windowData3d from '../../../scene/structure/parametric-objects/window'
7
+ import getWindowData3d from '../../../scene/structure/parametric-objects/window'
8
8
import dataToMaterials from './common/data-to-materials'
9
9
10
10
export default {
@@ -57,7 +57,7 @@ export default {
57
57
attributes . materials = dataToMaterials ( data ) ;
58
58
59
59
// construct data3d object
60
- let data3d = await windowData3d ( attributes , parentAttributes )
60
+ let data3d = await getWindowData3d ( attributes , parentAttributes )
61
61
if ( deleteGlass ) delete data3d . meshes . glass
62
62
63
63
// create new one
Original file line number Diff line number Diff line change @@ -35,5 +35,6 @@ export default function applyDefaults(element3d) {
35
35
else if ( defaultVal !== undefined ) element3d [ key ] = defaultVal
36
36
}
37
37
} )
38
+
38
39
return element3d
39
40
}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import generateNormals from '../../../utils/data3d/buffer/get-normals'
7
7
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
8
8
import getMaterials3d from './common/get-materials'
9
9
10
- export default function getData3d ( attributes ) {
10
+ export default function ( attributes ) {
11
11
return Promise . all ( [
12
12
generateMeshes3d ( attributes ) ,
13
13
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import generatePolygonBuffer from '../../../utils/data3d/buffer/get-polygon'
6
6
import generateExtrusionBuffer from '../../../utils/data3d/buffer/get-extrusion'
7
7
import getMaterials3d from './common/get-materials'
8
8
9
- export default function getData3d ( attributes ) {
9
+ export default function ( attributes ) {
10
10
return Promise . all ( [
11
11
generateMeshes3d ( attributes ) ,
12
12
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import generateNormals from '../../../utils/data3d/buffer/get-normals'
4
4
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
5
5
import getMaterials3d from './common/get-materials'
6
6
7
- export default function getData3d ( attributes ) {
7
+ export default function ( attributes ) {
8
8
return Promise . all ( [
9
9
generateMeshes3d ( attributes ) ,
10
10
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import generateNormals from '../../../utils/data3d/buffer/get-normals'
6
6
import generateUvs from '../../../utils/data3d/buffer/get-uvs'
7
7
import getMaterials3d from './common/get-materials'
8
8
9
- export default function getData3d ( attributes ) {
9
+ export default function ( attributes ) {
10
10
return Promise . all ( [
11
11
generateMeshes3d ( attributes ) ,
12
12
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import getMaterials3d from './common/get-materials'
8
8
9
9
import loadData3d from '../../../utils/data3d/load'
10
10
11
- export default function getData3d ( attributes ) {
11
+ export default function ( attributes ) {
12
12
return Promise . all ( [
13
13
generateMeshes3d ( attributes ) ,
14
14
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
@@ -36,6 +36,7 @@ export function getDefaultMaterials(){
36
36
}
37
37
38
38
function generateMeshes3d ( a ) {
39
+ console . log ( 'generateMeshes3d' , a )
39
40
40
41
// external meshes
41
42
@@ -56,7 +57,7 @@ function generateMeshes3d (a) {
56
57
oven = a . ovenType !== 'none' ,
57
58
cooktop = a . cooktopType !== 'none' ,
58
59
microwave = a . microwave ,
59
- largeCooktop = cooktop && a . cooktopType . slice ( - 2 ) === '90' ,
60
+ largeCooktop = ( cooktop !== 'none' ) && ( a . cooktopType . slice ( - 2 ) === '90' ) ,
60
61
cabinetType = a . cabinetType
61
62
62
63
// config
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import cloneDeep from 'lodash/cloneDeep'
8
8
import getMaterials3d from './common/get-materials'
9
9
10
10
11
- export default function getData3d ( attributes ) {
11
+ export default function ( attributes ) {
12
12
return Promise . all ( [
13
13
generateMeshes3d ( attributes ) ,
14
14
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import sortBy from 'lodash/sortBy'
10
10
import loadData3d from '../../../utils/data3d/load'
11
11
12
12
13
- export default async function getData3d ( attributes ) {
13
+ export default function ( attributes ) {
14
14
return Promise . all ( [
15
15
generateMeshes3d ( attributes ) ,
16
16
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import generateUvs from '../../../utils/data3d/buffer/get-uvs'
6
6
import cloneDeep from 'lodash/cloneDeep'
7
7
import getMaterials3d from './common/get-materials'
8
8
9
- export default function getData3d ( attributes ) {
9
+ export default function ( attributes ) {
10
10
return Promise . all ( [
11
11
generateMeshes3d ( attributes ) ,
12
12
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import getMaterials3d from './common/get-materials'
9
9
import sortBy from 'lodash/sortBy'
10
10
import loadData3d from '../../../utils/data3d/load'
11
11
12
- export default async function getData3d ( attributes ) {
12
+ export default function ( attributes ) {
13
13
return Promise . all ( [
14
14
generateMeshes3d ( attributes ) ,
15
15
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import generatePolygonBuffer from '../../../utils/data3d/buffer/get-polygon'
4
4
import generateNormals from '../../../utils/data3d/buffer/get-normals'
5
5
import getMaterials3d from './common/get-materials'
6
6
7
- export default async function getData3d ( attributes , parentAttributes ) {
7
+ export default function ( attributes , parentAttributes ) {
8
8
return Promise . all ( [
9
9
generateMeshes3d ( attributes , parentAttributes ) ,
10
10
getMaterials3d ( attributes . materials , getDefaultMaterials ( ) )
Original file line number Diff line number Diff line change @@ -9,4 +9,4 @@ test('applyDefaults', () => {
9
9
expect ( _el3d . h ) . toBe ( 2.4 )
10
10
expect ( _el3d . x ) . toBe ( 0 )
11
11
expect ( _el3d . children ) . toEqual ( [ ] )
12
- } ) ;
12
+ } ) ;
You can’t perform that action at this time.
0 commit comments