CGA rule for slope plane/slab. ESRI house example

1057
5
Jump to solution
06-05-2023 04:59 AM
plfontes
New Contributor III

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.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
CherylLau
Esri Regular Contributor

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.

View solution in original post

5 Replies
JonasObertuefer
Esri Contributor

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

0 Kudos
plfontes
New Contributor III

No worries, and I appreciate the consideration.

0 Kudos
CherylLau
Esri Regular Contributor

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.

plfontes
New Contributor III

Challenge accepted! 🙂
Thanks for the suggestion.

0 Kudos
plfontes
New Contributor III

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 .