Hi all,
Does anyone has the CGA code for this model (picture attached)? This screenshoot is from a old ESRI video (https://www.youtube.com/watch?v=9tYr95R6-bU&t=25s).
I am really interested to learn how to code this sloped slab that this house has. I have no idea how it was done.
Solved! Go to Solution.
One way to get the floorplates with the slanted part in the middle would be to split the footprint into three pieces, translate the horizontal pieces as desired, then rotate and resize the middle piece recalculating the length using trigonometry according to the desired angle.
Hi @plfontes,
I hoped that I can write you back with good news but unfortunately we don't have permission to share this rule.
cheers
Jonas
No worries, and I appreciate the consideration.
One way to get the floorplates with the slanted part in the middle would be to split the footprint into three pieces, translate the horizontal pieces as desired, then rotate and resize the middle piece recalculating the length using trigonometry according to the desired angle.
Challenge accepted! 🙂
Thanks for the suggestion.
Worked.
/**
* File: slanted_slab.cga
* Created: 7 Jun 2023 13:05:10 GMT
* Author: PFontes
*/
version "2022.1"
attr slabHeight = 0.3
attr higherSlabElevation = 1
attr slantedSlabWidth = 3
slantedSlabLenght = sqrt(pow( higherSlabElevation , 2) + pow( slantedSlabWidth , 2))
slantedSlabAngle = asin( higherSlabElevation / slantedSlabLenght )
@StartRule
Slab -->
t(0, slabHeight, 0)
split(z){~1: HigherSlab | slantedSlabWidth : SlantedSlab | ~1: LowerSlab}
HigherSlab -->
t(0, higherSlabElevation , 0)
extrude(-slabHeight)
SlantedSlab -->
t(0, higherSlabElevation , 0)
r(slantedSlabAngle, 0, 0)
s(scope.sx,1, slantedSlabLenght )
extrude(world.up, -slabHeight)
LowerSlab -->
extrude(-slabHeight)
Thanks @CherylLau .