CGA: Merging shapes from different trees

590
0
04-25-2018 02:06 AM
Status: Open
Jonas_BromandFuchs
New Contributor II

I believe CGA coding would be much more accesible, if you could merge shapes from different shape trees.

For example when making rules for roofs and the building footprint has a complex or nonrectangular shape, you have to get an overview (usually via different split.indexes or occlusion queries) to know if the shape is a part of the central roof or marks the end of the roof. (This operation usually also requires trigonometric gymnastics, which are beyond the abilities of some of my colleagues in the architectural profession)

I figure this might be somewhat similar to the label function and could look somewhat like this:

Footprint -->

   primitiveQuad(width, length)

   SplitFootprint

SplitFootprint -->

   split(x) { '0.5: r(0, split.index * rotationAttr, 0) RaiseBuilding }*

RaiseBuilding -->

   extrude(height)

   comp(f) { vertical: Facade. | top: Label("roof")  RoofConstruction | bottom: NIL }

RoofConstruction -->

   mergeShapes("roof")   # <<< proposed new function, merges all shapes labeled "roof" into a new large shape

   cleanupGeometry(all, 0.1)

   roofHip(roofHeight)

Tags (2)