Public
Edited
Jun 16, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
genererFigures = {
const figures = [];
const features = { Name: "" };

// you can't import anything from outside (no functions or libraries)
// you should not produce any collateral effect
// You have access to fxrand()

// if you are unsure of the scale, make all geometry sizes and positions related
// to a constant;

// you can use the anaverse bool to decide if a function has to be executed in
// anaverse or out of it.

// In the anaverse, there is a global (worker-wide) constant as
// const anaverse = true;

// the following constants are part of the brick API, you should not change them
const ratio = 2;
const blockHeight = 0.96 * ratio;
const blockSide = 0.78 * ratio;

// ------ your code starts here ------

var h1 = 10 + rint(20);
var h2 = 10 + rint(20);
var h3 = 10 + rint(20);
var h4 = 12 + rint(5);

const data = structureMap();

data.forEach((d) => {
// addColonne(figures, { x: d[0], y: 0, z: d[1] }, 5);
// addBasicStep(figures, { x: d[0], y: 0, z: d[1] }, 40, 1);
});

const randorient = () => ["S", "N", "O", "E"][rint(4)];

// arg pattern is = (figures,position,height,top,orientation)
/* , */
const randomBlock = () =>
[addBasicStep, addPyramide, addBasicWallSet, plateForte][rint(3)];

const h = 20 + rint(10);

//addBasicWallSet(figures, { x: 0, y: 0, z: 0 }, h, 1, randorient());

//randomBlock()(figures, { x: 0, y: 0, z: 0 }, h, 0, randorient());
for (let i = -3; i < 3; ++i) {
randomBlock()(figures, { x: i * 24, y: 0, z: 0 }, h, 1, randorient());
}

//bottom

addPlancher(figures);

// ------ your code ends here ------

return { figures, features };
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { blockMap } from "@anaglyph-ic/anaver-se-api-building-blocks-list"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more