POST
|
Hi, this is a code that I made to graph the population and houses by block attributes in a model, it's a simple code that I wanted to share Also, I have a blog were I post some of the my work in CE, cheers GDA – Arquitectura desde SIG, BIM y Programación CODE @Order(0)@Range("Habitantes", "Viviendas") attr Visualizacion = "Habitantes" attr NumeroHabitantes = 0 attr NumeroViviendas = 0 @Range("Si","No") attr Gradiente = "No" @Hidden attr Alt = 100 @Hidden attr DiferenciaCotas = 0 ##################################CODIGO#################################### Lot --> alignScopeToAxes(y) DiferenciaCota(scope.sy) DiferenciaCota(Dif) --> extrude(world.y, Alt) split(y){Dif: Base | ~1:NIL} Base --> set(DiferenciaCotas, scope.sy) comp(f){top: AreaExtr | all: NIL} AreaExtr --> alignScopeToAxes(y) t(0,-DiferenciaCotas,0) NIL Cyl Cyl --> case Visualizacion == "Habitantes" : i("Cyl2.DAE") s(40,(NumeroHabitantes)+DiferenciaCotas,40) center(xyz) t(0,((NumeroHabitantes)+DiferenciaCotas)/2,0) set(material.opacity,0.8) Colorizacion else: i("Cyl2.DAE") s(40,((NumeroViviendas)+DiferenciaCotas)*2,40) center(xyz) t(0,((NumeroViviendas)+DiferenciaCotas)/2,0) set(material.opacity,0.8) Colorizacion Colorizacion --> case Gradiente == "Si": case Visualizacion == "Habitantes": color(NumeroHabitantes/100+0.01, 0,0.3) else: color(0.2,0,NumeroViviendas/50+0.01) else: case Visualizacion == "Habitantes": color(1,.2,0) else: color(.2,.2,1)
... View more
05-23-2017
04:52 PM
|
0
|
1
|
629
|
POST
|
Hi; It should go something like this: attr Height = 0 attr Area = 0 @Range("Y", "N") attr Special = "N" ## Rules ## @StartRule Building --> extrude(Height) comp(f){side : Colour | top : RoofType } RoofType--> case Height < 12 : case Area < 50 : roofGable(22.5) Colour else : 50% : roofHip(20) Colour 25% : roofShed(10) Colour else : roofShed(0) Colour case Height > 12 && Height < 25 : 50% : roofHip(20) Colour 25% : roofGable(22.5) Colour else : roofShed(0) Colour else : roofShed(0) Colour Colour--> case Special == "N" : color("#c7d3de") else : color("#00338d") The mistake is when applying a conditional rule, you must leave the "else" statement for one of the values in the range; in the case of your Colour rule, you have a range of "yes" and "no" but you include an "else" for which there's no parameter, same with your % in the roof rule, 50% + 25% + 25% = 100%, so there's no room for another option
... View more
04-01-2017
11:28 AM
|
2
|
1
|
749
|
POST
|
Hi, I was wondering how the pipes in the Manhole example were made?, are they imported from BIM software?, is there a rule? I've been trying to set up a rule for that, the best I can do is with an imported cylinder (attached file) , but it doesnt work that well Also, are there any examples of cga rule application for sewerage or water installations, that could actually be helpful for engineer or contractors? Thanks!!
... View more
02-26-2017
10:13 AM
|
0
|
2
|
1390
|
POST
|
Hi I watched a video about the M Buehler Favela project, and I want to know how he make a group of polygons follow the terrain surface, he use it to trees and vegetation, I know about the align shape to terrain, but it seems like he use a big polygon and then he divide it into a grid that he adapts to the terrain Thanks
... View more
12-18-2016
10:26 AM
|
0
|
4
|
1939
|
POST
|
Hi I'm looking for good examples of Zoning rules that can manage restrictions like FAR, setbacks, height, density, angles, etc. Thanks
... View more
05-23-2016
05:51 PM
|
0
|
1
|
2081
|
POST
|
Some time ago I found on another thread a fence code, I studied it and now I tried to made it into a fence that includes doors (entrances), but I can't make it work when there's sloped terrain: attr poleHeight = 2 attr barHeight1 = 0.15 attr barHeight2 = 1.7 attr barHeightDoor1 = 0.25 attr barHeightDoor2 = 1.6 attr barDimension = 0.08 attr poleWidth = 0.08 attr poleDist = 3 attr poleThickness = 0.08 attr boardWidth = 0.03 attr boardDist = .08 attr boardHeight = 1.9 attr boardThickness = 0.03 Lot --> extrude(world.y, poleHeight) comp(f){side: FrontFence} FrontFence --> split(x){~.5:Reja("fence") | 2.5: Reja("door") | ~.5:Reja("fence") | .75: Reja("door") | ~.5:Reja("fence")} ########################################################################## # Fence ########################################################################## Reja(Tipo) --> case Tipo =="fence" : MakeBar1("fence") MakeBar2("fence") PutPoles else: MakeBar1("door") MakeBar2("door") PutPoles ########################################################################## # Fence ########################################################################## MakeBar1(Tipo) --> case Tipo == "fence" : split(y) {barHeight1 : NIL | barDimension : extrude(barDimension / 5) t(0,'-1.2,0) Bar | ~1 : NIL} else: split(y) {barHeightDoor1 : NIL | barDimension : extrude(barDimension / 2) t(0,'-1.2,0) Bar | ~1 : NIL} MakeBar2(Tipo) --> case Tipo == "fence" : split(y) {barHeight2 : NIL | barDimension : extrude(barDimension / 5) t(0,'-1.2,0) Bar | ~1 : NIL} else: split(y) {barHeightDoor2 : NIL | barDimension : extrude(barDimension / 2) t(0,'-1.2,0) Bar | ~1 : NIL} Bar --> color(.1,.1,.15) alignScopeToAxes(y) comp(f) {front : BarBevel | back : BarBevel | all : Bar.} BarBevel --> roofGable(45) split(y) {'.1 :comp(f) {bottom : NIL | all : Bar.} | ~1 : NIL} ########################################################################## # Poles ########################################################################## PutPoles --> alignScopeToAxes(y) split(x) {{ poleWidth: MakePole | ~poleDist : PutBoards}* | poleWidth: MakePole } MakePole --> color("#706050") alignScopeToAxes(y) innerRect s('1,'1,poleThickness) i("assets/fencePole.obj") t(0,0,'-1) Pole. ########################################################################## # Boards ########################################################################## PutBoards --> alignScopeToAxes(y) split(x) {{ ~boardDist : NIL | boardWidth: MakeBoard}* | boardDist : NIL } MakeBoard --> alignScopeToGeometry(zUp, 0, world.lowest) s('1,boardHeight,'1) Board Board --> color("#706050") alignScopeToAxes(y) innerRect s('1,'1,boardThickness) i("assets/fenceBoard.obj") Board. When I raise a point on the polygon it starts to distort, how can I fix it? Thanks
... View more
04-10-2016
03:21 PM
|
0
|
0
|
2458
|
POST
|
Hi I was working on a cga excercise when I got stuck writing this split operation: BuildVolume --> split(y){floorHeight("GF") : Volume("GF") | ~1: UpperFloors} I give me the Mismatched token error ( : | ), I don't know whats wrong, in a previous line I used a similar operation with no errors: ScopeAligned(yDim) --> extrude(world.y, 100) split(y){yDim : BaseVolume | ~1: NIL} in the excercise they use the 2015 version, I got the 2014, could that be it?, when I add the tilde the error dissappears (pic 2) but that's not how they do it What I'm not seeing?
... View more
11-30-2015
05:12 PM
|
0
|
1
|
2807
|
POST
|
Hi, I am working on a scene where there's a terrain with a pronounced slope, I'm trying to align the streets with the vertical alignment, but when I get to the crossings it doesn't allow me to rotate them, is there a way to set up a street rule code to rotate them? thanks
... View more
11-30-2015
05:32 AM
|
0
|
1
|
2784
|
POST
|
Hi, here I am again with another question for you all, Im importing Collada buildings in my scene, but when I import them they lost light reflection when I rotate one way or another it doesn't seem to be from the light of the scene, because there's different wall facing to the same orientation with different intensities of light, also from the roof of the buildings Here's an example when I rotate the building with a top view: What can be causing this?
... View more
11-04-2015
05:04 PM
|
0
|
0
|
2462
|
POST
|
Hello everyone, I'm new to CE, I'm starting my first project and I have a question; I'm creating a simple rule to put texture to facades, using the comp function and the fileRandom to select textures for each simple building, but I can't find a way to put textures or to separate facades when are in the same side (pictures), the picture is repeated and fitted in the area of the face I'm using the construction border polygon Is there a way to separate this facades to apply different textures, or a way to "unite" them as one facade? Thanks
... View more
09-18-2015
11:29 AM
|
0
|
2
|
2793
|
Title | Kudos | Posted |
---|---|---|
2 | 12-31-2016 02:00 PM | |
2 | 04-01-2017 11:28 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|