Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function extrudePolygons(d) {
const { data, height } = d;
const { position, normal, uv, indices } = extrudePolygon(
// polygons same with coordinates of MultiPolygon type geometry in GeoJSON
// See http://wiki.geojson.org/GeoJSON_draft_version_6#MultiPolygon
data,
// Options of extrude
{
// Can be a constant value, or a function.
// Default to be 1.
depth: height
}
);
return { position, normal, uv, indices };
}
export function getExtrudeGeometryParams(polygon, height, layer, center) {
const datas = getPolygonPositions(polygon, layer, center);
const shapes = datas;
//Possible later use of geojson
if (!shapes) return null;
height = layer.distanceToVector3(height, height).x;
const { position, normal, uv, indices } = extrudePolygon(shapes, {
depth: height
});
return {
position, normal, uv, indices
};
}