Guest User

Untitled

a guest
Jul 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. /**
  2. * File: building_exampe_stackexchange.cga
  3. * Created: 19 Jul 2018 21:13:58 GMT
  4. * Author: eric
  5. */
  6.  
  7. version "2018.1"
  8.  
  9. attr your_building_height_attribute_name = 10
  10. @Range("gable", "hip", "pyramid", "shed")
  11. attr your_roof_form_attribute_name = "hip"
  12. attr roofAngle = 30
  13.  
  14. @StartRule
  15. footprint -->
  16. extrude(your_building_height_attribute_name)
  17. comp(f) {top : roof | front : X. | back : X. | left : X. | right : X. | bottom : X.}
  18.  
  19. roof -->
  20. case your_roof_form_attribute_name == "gable" : roofGable
  21. case your_roof_form_attribute_name == "hip" : roofHip
  22. case your_roof_form_attribute_name == "pyramid" : roofPyramid
  23. else : roofShed
  24.  
  25. roofGable -->
  26. roofGable(roofAngle)
  27.  
  28. roofHip -->
  29. roofHip(roofAngle)
  30.  
  31. roofPyramid -->
  32. roofPyramid(roofAngle)
  33.  
  34. roofShed -->
  35. roofShed(roofAngle)
Add Comment
Please, Sign In to add comment