POST
|
Texture --> setupProjection(0, scope.xy, 1, 1) #not necessary for sides texture("images/bricks.jpg") projectUV(0)
... View more
02-04-2015
04:55 PM
|
0
|
4
|
565
|
POST
|
Try this.. keep in mind that the "line" is actually part of the building, not just drawn on. version "2014.0"
attr FloorCount = 10
attr FloorHeight = 2.9
attr FloorLine = 0.1
attr FloorPlusLine = FloorHeight+FloorLine
Lot -->
extrude(FloorCount*FloorPlusLine)
split(y){
{FloorHeight: Floors | FloorLine: FloorLines}* |
FloorPlusLine: Floors # "roof"
}
Floors -->
color (0, rand, rand)
FloorLines -->
color(1,0,0)
... View more
02-04-2015
04:41 PM
|
1
|
1
|
418
|
POST
|
I tried a few things.. the closest I can get to this so far is this, but the ChopChop variable change isn't recognized by "BuildCube" so the scaling's off. BasicShape_3 --> color(0,1,0) convexify(scope.sx) comp(f){ 0: CutOff | 1: SubShapes } CutOff --> set(ChopChop, scope.sx) print(ChopChop) SubShapes --> case scope.sx <= 3: color(1,0,0) else: color(0,1,0) cleanupGeometry(all,1) BuildCube BuildCube --> rotateScope(90,0,270) #alignScopeToAxes() i("builtin:cube") s(scope.sx,Building_Height,Building_Depth-ChopChop) set(material.opacity,0.18) print(Building_Width) print(Building_Width-ChopChop)
... View more
02-04-2015
04:25 PM
|
0
|
3
|
522
|
POST
|
Hi. I'm trying to generate basic building blocks from complex footprints. This works in general (BasicShape_1), but I'd like to refine it a bit. I used convexify to remove smaller extrusions and now I'd like to use the leftover bulk with the cube function.. however, sometimes I end up with multiple parts (see image below, green blocks), meaning I can't use that method. Is there a way to combine them? Also is there a way to force "normal" behavior after splitting? When I scale the cube on the splits, the x-axis points up. Rotating fixes that, but I expect this won't work the same everywhere. script: version "2014.0"
// ADJUSTMENT ATTRIBUTES
attr Roof_Angle = 33
attr Ground_Height = 1.0
attr Floor_Height = 2.8
attr Building_Height = Ground_Height + (aog*Floor_Height)
// ATTRIBUTES
attr daf = 0
attr aog = 0
attr Building_Width = 0
attr Building_Depth = 0
Lot-->
set(Building_Width, scope.sx)
set(Building_Depth, scope.sz)
BasicShape_2
BasicShape_1 -->
i("builtin:cube")
s(Building_Width,Building_Height,Building_Depth)
color(0,0,1)
set(material.opacity,0.15)
BasicShape_2 -->
color(0,1,0)
convexify(scope.sx)
comp(f){all: SubShapes}
SubShapes -->
case scope.sx <= 3:
color(1,0,0)
else:
color(0,1,0)
cleanupGeometry(all,1)
BuildCube_
BuildCube -->
i("builtin:cube")
s(Building_Width,Building_Height,Building_Depth)
set(material.opacity,0.18)
print(Building_Width)
... View more
02-01-2015
05:29 PM
|
0
|
5
|
4302
|
POST
|
Thanks - I ended up using my rule because it allowed bulk alignment and used your suggestion for the roofs since they didn't accept world.*. However now I'm looking for a way to do that - fixing wrong roof(s) is pretty time-consuming in large areas.. any idea how to align the roof to cardinal directions? This is how it usually looks like when I generate a row of buildings:
... View more
02-01-2015
05:07 PM
|
0
|
0
|
449
|
POST
|
Thanks. Not sure if I correctly applied it, but this is what I came up with - might as well post it. version "2014.0"
attr direction = "N" # N, E, S, W
attr roofindex = 0 # 1, 2
Lot -->
case direction == "N": NorthBuilding
case direction == "E": EastBuilding
case direction == "S": SouthBuilding
case direction == "W": WestBuilding
else: NorthBuilding
NorthBuilding -->
cleanupGeometry(all, 0.5)
extrude (4)
comp(f){
world.north: front |
world.west: right |
world.east: left |
world.south: back |
top: top
}
... View more
01-08-2015
07:59 AM
|
0
|
2
|
449
|
POST
|
Thanks, but I need to use fixed heights (floors*3m), so it's not applicable in this case. Might come in handy later, though!
... View more
01-07-2015
06:12 PM
|
0
|
2
|
744
|
POST
|
Hi. I'm creating a few generic buildings with the same rule — it splits a four-sided block into front, sides and back and textures them. However, as can be seen below, that doesn't always work as the index seems to start randomly(?) on any side.. my current solution are four copies of the script that roate through the four sides, but it's pretty annoying. Is it possible to assign the facade index 0 to, say, north?
... View more
01-07-2015
05:44 PM
|
0
|
4
|
4394
|
POST
|
Hi, a gradient would be good - the current colors are just for testing. Ideally I'd like to create dynamic rules for each split (basically like rule_splitindex) but that doesn't seem possible. For full-range rand the range doesn't have to be specified, if you want to save some typing. It's also not really random but uses the lot's seed.. which can be set with set(seedian, <somenumber>). Now if only there was some seed that produced gradients..
... View more
01-07-2015
04:15 PM
|
0
|
4
|
744
|
POST
|
I'm generating some buildings (well, building envelopes) with variable floor counts (attribute "aog") and color for each of the floors. Right now I simply have the maximum number of floors inserted manually and catch the top with "aog-1". Is there a way to do this in a more flexible way? Here's the rule file: version "2014.0"
attr aog = 0
attr maxLength = scope.sx
attr maxWidth = scope.sz
attr maxHeight = 3.0*aog
attr opacityslider = 0.8
#--------------------------------
Lot -->
set(material.opacity,opacityslider)
innerRect
s(maxLength+1,'1,maxWidth+1)
center(xyz)
extrude(maxHeight)
Building
Building -->
comp(f){side: BuildingBody | top: Roof }
BuildingBody -->
split(y){ maxHeight/aog: BuildingFloors }*
BuildingFloors -->
comp(f){all: ColorMe(split.index)}
ColorMe(FloorIndex) -->
case FloorIndex == aog-1: color(0,1,1)
case FloorIndex == 0: color(1,0,0)
case FloorIndex == 1: color(0,1,0)
case FloorIndex == 2: color(0,0,1)
case FloorIndex == 3: color(1,1,0)
case FloorIndex == 4: color(1,0,0)
case FloorIndex == 5: color(0,1,0)
case FloorIndex == 6: color(0,0,1)
case FloorIndex == 7: color(1,1,0)
case FloorIndex == 8: color(1,0,0)
case FloorIndex == 9: color(0,1,0)
case FloorIndex == 10: color(0,0,1)
case FloorIndex == 11: color(1,1,0)
else: color(0.5,0,0)
Roof -->
color(1,1,1)
roofGable(35,0,0,false) Example:
... View more
01-07-2015
01:31 PM
|
0
|
7
|
4740
|
POST
|
Yep, otherwise it wouldn't be very useful in my situation. So could it be done in another way? With Python maybe? Even something like this would be ok, creating the list wouldn't be too hard with Excel:
ThisDoesntWork-->
case gid == 628071: import gid_switch: "rules/628071.cga"
case gid == 628072: import gid_switch: "rules/628072.cga"
case gid == 999: color(0,1,0)
else: color (1,0,1)
... View more
10-21-2014
03:15 PM
|
0
|
1
|
688
|
POST
|
Hmm that's what I wanted to avoid.. but I guess it's probably better to just rewrite the script and do the coloring like in your example. Thanks!
... View more
10-19-2014
12:28 PM
|
0
|
0
|
586
|
POST
|
Thanks! However there's one problem, I can't get the loading to work dynamically. What I'm trying to do is create a base script that calls other scripts based on their gid for each building. It works manually, but when I try to create the path with variables, it doesn't (mismatched token). The same method works for textures, though. I figured if this works, I could use the same method to "switch back" from the second script to the first..
version "2014.0"
attr gid = 0
attr gidpath = "rules/"+gid+".cga"
import gid_switch: "rules/628071.cga" //works, gid of shape
import gid_switch2 : gidpath // doesn't work
import gid_switch2 : "rules/"+gid+".cga" // doesn't work
//test for constructed path for textures, works
attr path = "images/"+gid+"/"
attr end = ".jpg"
Lot -->
texture(path+"chickens"+end)
alignScopeToGeometry(zUp, 0, world.lowest)
setupProjection(0, scope.xy, 0.3, 0.3)
projectUV(0)
gid_switch.Lot //just a color command
... View more
10-19-2014
12:17 PM
|
0
|
1
|
688
|
POST
|
I created a building using vertical splits because some elements (the entrance part) didn't line up with the rest and to keep the number of splits to a minimum. However, now I'd like to split the building horizontally to color its floors separately. Is that possible while retaining the current structure? Here's a photoshop mockup of what I'm trying to do:
... View more
10-16-2014
08:47 AM
|
0
|
3
|
2800
|
Title | Kudos | Posted |
---|---|---|
1 | 07-13-2018 02:05 AM | |
1 | 08-08-2016 06:59 AM | |
1 | 07-12-2018 09:08 AM | |
3 | 04-12-2019 08:20 AM | |
1 | 12-14-2017 07:12 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|