Skip to content

Commit fb61045

Browse files
authored
Update buildingpart.js
1 parent cca6310 commit fb61045

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/buildingpart.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import {PyramidGeometry} from 'pyramid';
1212
import {RampGeometry} from 'ramp';
1313
import {WedgeGeometry} from 'wedge';
14+
import {WedgeGeometry} from 'hipped';
1415
import {BuildingShapeUtils} from './extras/BuildingShapeUtils.js';
1516
/**
1617
* An OSM Building Part
@@ -286,6 +287,15 @@ class BuildingPart {
286287
};
287288
const geometry = new PyramidGeometry(this.shape, options);
288289

290+
material = BuildingPart.getRoofMaterial(this.way);
291+
roof = new Mesh( geometry, material );
292+
roof.rotation.x = -Math.PI / 2;
293+
roof.position.set( 0, this.options.building.height - this.options.roof.height, 0);
294+
} else if (this.options.roof.shape === 'hipped') {
295+
const options = {
296+
depth: this.options.roof.height,
297+
};
298+
const geometry = new HippedGeometry(this.shape, options);
289299
material = BuildingPart.getRoofMaterial(this.way);
290300
roof = new Mesh( geometry, material );
291301
roof.rotation.x = -Math.PI / 2;

0 commit comments

Comments
 (0)