Hi Forma team!
Could you please guide me on how to correctly create a Forma building element with multiple polygons, representing CORE, CORRIDOR, and LIVING_UNITs via embedded view sdk?
I see that SDK allows for multiple ways to create elements. Maybe there is the right one that I'm missing?
[edit]: it's easy to create basic 2.5d building with a floorStack, but does it allow to nest multiple polygons and unit types?
const floors = Array.from({ length: numFloors }, (_, index) => ({
polygon: [
[0, 0],
[floorLength, 0],
[floorLength, floorWidth],
[0, floorWidth],
[0, 0]
],
height: floorHeight,
}));
const { urn } = await Forma.elements.floorStack.createFromFloors({
floors: floors,
})
const transform = [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
centerX, centerY, minZ, 1,
]
await Forma.proposal.addElement({ urn, transform });