|
POST
|
Maybe this could help too? Graph -> Fit Widths to Shapes Fit widths to shapes—Help | Documentation
... View more
01-24-2020
07:03 AM
|
0
|
0
|
2124
|
|
POST
|
Try this. 1) Move your .cej file somewhere else (outside of the ce.lib folder and outside the CityEngine workspace) on your computer. This will be temporary as we will delete this later. In general, don't store anything in ce.lib since this is a library that CityEngine uses internally and is by default hidden from users. 2) In CityEngine, make a new project. 3) From the Windows Explorer window, drag and drop your .cej file onto the scenes folder of your new project in the CityEngine Navigator. When asked, choose to copy it to the workspace (instead of making a link). 4) Verify that your .cej file is now on your computer in the new project you created within the CityEngine workspace. Right click on the .cej file in the scenes folder -> Show in File Manager to see where it is in the Windows Explorer window. 5) Now, you can delete the temporary copy of your .cej file that you made in step (1). Projects overview—Help | Documentation
... View more
01-24-2020
06:55 AM
|
0
|
0
|
1205
|
|
POST
|
Facade A The code assumes that the scope of your facade is aligned such that x is along the width and y is along the height. // Define facade width and height here or set to scope.sx or scope.sy
const facade_width = scope.sx
const facade_height = 9
const door_width = 0.3*facade_width
const door_height = 0.7*(facade_height/3)
const window_width = 0.7*facade_width
const window_height = 0.5*(facade_height/3)
Facade -->
split(y) { ~1: Floor1
| ~1: Floor2
| ~1: Floor3. }
Floor1 -->
split(y) { door_height: split(x) { ~1: Wall
| door_width: Door
| ~1: Wall
| door_width: Door
| ~1: Wall }
| ~1: Wall }
Floor2 -->
split(x) { ~1: Wall
| window_width: WindowTile
| ~1: Wall }
WindowTile -->
split(y) { ~1: Wall
| window_height: Window
| ~1: Wall }
Facade B Modify the Facade A code above by changing the definition of window_width and the Floor2 rule as follows. const window_width = 0.2*scope.sx
Floor2 -->
split(x) { ~1: Wall
| window_width: WindowTile
| ~1: Wall
| window_width: WindowTile
| ~1: Wall }
... View more
01-24-2020
05:23 AM
|
0
|
0
|
857
|
|
POST
|
After importing your data into CityEngine (Import data overview—Help | Documentation), you can apply a cga rule to your shapes. There are two rules for streets that come with CityEngine and can be found in ESRI.lib/rules/Streets. David Wasserman has a Complete Street rule that you can use (Complete Street Rule Update). Or, you can write your own cga rule.
... View more
01-22-2020
04:40 AM
|
1
|
1
|
2180
|
|
POST
|
In the code above, there is a mistake in the output filepath definition. ce.toFSPath() needs a valid folder name. I think you meant: file = ce.toFSPath("assets")+"/instanceMapHaps.txt" Once that is changed, your script seems to work. As for the reported values, every shape in the scene reports its own value, and this is what is written to the output file. No averages or mins are calculated. If you run the script on three buildings, your output file will have three rows (plus the header), one row for each building. For each building, its stats (i.e. usage, GFA, footprint area, number of floors) are written. To get the sum, you could keep a running sum of the desired report similar to how the running count is kept with gInstanceCount.
... View more
01-21-2020
09:45 AM
|
1
|
0
|
1263
|
|
POST
|
I don't understand exactly what you want, but I can say that it is not possible to access the RGB values in a texture image or the average brightness of the image from within CGA. Nicolai's answer is the only way I can think of to access the RGB values in images.
... View more
01-21-2020
06:15 AM
|
0
|
2
|
3316
|
|
POST
|
Unfortunately, there isn’t a good way to do this. I don’t think it’s possible. This is because it is currently not possible to access the terrain elevation from within CGA. Nevertheless, here are some suboptimal ideas. Idea 1 One idea for a workaround is to do something like what this post does and create shapes that follow the terrain and use occlusion queries to test if you intersect the terrain: detecting terrain intersetion with a shape to achieve more realistic window texturing Idea 2 Another idea for a workaround would be to align shapes to the terrain using Project All (instead of Translate), and then, splitting the side facades would give you a door that touches the ground. This will not work, however, when the terrain varies nonlinearly between the vertices of your initial shape. Idea 3 Another idea for a more complicated workaround could be to create a cube that is positioned on the terrain just below the door and use minimumDistance() to query the distance of the door to the terrain. This will not work, however, when the distance from the door to the terrain is larger than the distance from the door to another door’s cube. Where you create your door, create a small cube. NIL everything else so that the door cube is the only geometry in the model. Shapes -> Convert Models to Shapes. Now the door cube is a separate initial shape and is selectable in the Scene Editor. Align door cube shape to terrain using Translate to Minimum. Assign rule to door cube shape to label the geometry for later use in context queries. DoorCube -->
label("DoorCube")
Go back to your rule where you create the door. Now, you can use minimumDistance() to get the distance from the door to the closest door cube. You can use this distance to translate the door, for example. t(0, -minimumDistance(inter, "DoorCube"), 0) Note: You might want to assign a unique ID (in an object attribute) to your footprint shape so that when you create the label on the door cube in step (5), you can include the unique ID in the label string. In step (3), object attributes of the footprint shape are passed to the door cube shape.
... View more
01-21-2020
05:00 AM
|
0
|
0
|
1166
|
|
POST
|
Are you using 2019.0 or 2019.1? What is the rule file and start rule assigned to a building? Does this rule exist in your workspace? Click on a building. In the Inspector, is the attribute Representation set to "realistic with facade textures"? If it is set to "solid color", which is the default, then the buildings will not have a texture from an image but will rather be a single color. What are your viewport settings? Are textures enabled (shortcut keys 6 or 7)?
... View more
01-20-2020
04:12 AM
|
0
|
0
|
763
|
|
POST
|
This will fill in the colors in the order red, yellow, magenta until no tiles are left. Lot -->
split(z) { ~3: Tile(split.index) }*
Tile(ind) -->
case ind%3==0:
color(1,0,0)
case ind%3==1:
color(1,1,0)
else:
color(1,0,1)
If you want to make sure that the colors always appear in a group of three (i.e. you always end on magenta), you can use nested splits. Lot2 -->
split(x) { ~9: ThreeTiles }*
ThreeTiles -->
split(x) { ~1: color(1,0,0) Red.
| ~1: color(1,1,0) Yellow.
| ~1: color(1,0,1) Magenta. }
... View more
01-17-2020
03:45 AM
|
0
|
0
|
929
|
|
POST
|
Matt's answer is saying that if you want to apply a split to the result of a comp, you can't put the split right after the comp, but instead, you need to put the split inside the comp. For example, let's say you start with a building that is a cube. If you want to use comp to get a facade (one side of the cube) and then apply a split to the facade, you need to perform the split inside the curly braces of the comp. comp(f) { side: split(y) { ~floor_height: Floor }* } You could also put the split in a Facade rule. This is the same as above: comp(f) { side: Facade }
Facade -->
split(y) { ~floor_height: Floor }*
... View more
01-17-2020
03:06 AM
|
1
|
0
|
2221
|
|
POST
|
innerRectangle did not exist in 2015.0, and it's not possible to reproduce its result using 2015.0. You can try to use the old, deprecated operation innerRect, which is similar but is not guaranteed to produce the same result as innerRectangle. You cannot get the remainder shape using innerRect, and the result will probably be more similar to alignment=scope than alignment=edge. You can try to replace your above code with (but it will probably be a different result): innerRect
thingA
... View more
01-17-2020
02:47 AM
|
0
|
0
|
1091
|
|
POST
|
First, remove line 11. You can't define functions inside a rule (e.g. Colour --> ...this is the inside part of the rule that I mean), and you don't need to have a function here. (Alternatively, though, you could specify a function that returns a hexadecimal string for the color, and then the rule would call the function inside color). Second, the color operation takes in a string for a hexadecimal color, so you need to put the string inside quotation marks: color("#ffffff") color operation—CGA | ArcGIS Third, the start rule annotation should have some capital letters: @StartRule Annotations—CGA | ArcGIS
... View more
09-12-2019
12:37 AM
|
0
|
0
|
894
|
|
POST
|
After inserting a model in cga using i(), you can rotate it around it's scope's center using r() and specifying the centerSelector as scopeCenter. r operation—CGA | ArcGIS To rotate and scale, you could translate, rotate and scale about the origin, and then translate back. Translate using relative offsets. Lot -->
i(asset, yUp, keepSizeAndPosition)
Transform(assetInfo(asset,tx)/scope.sx, assetInfo(asset,tz)/scope.sz)
Transform(relOffset_x, relOffset_z) -->
t('-relOffset_x, 0, '-relOffset_z)
r(0, 90, 0)
s('2, '1, '0.5)
t('relOffset_x, 0, 'relOffset_z)
... View more
09-10-2019
06:19 AM
|
1
|
0
|
3950
|
|
POST
|
Draw a rectangle that is about 900m x 900m, and put the rule I posted on it, and you will see cubes scattered such that no cube is within 20m of another cube. You can move the slider for the attribute reduce in the Inspector to further reduce the number of cubes.
... View more
09-06-2019
12:20 AM
|
0
|
0
|
2347
|
|
POST
|
One method would be to scatter() some points, create 20m radius spheres at each point, remove spheres that occlude, and then further remove points using p() according to an attribute. This won't let you remove exactly 20% of the original number of points though. @Range(min=0, max=1)
attr reduce = 0
const nPoints = 100
const minDist = 20
const cube_width = 10
Lot -->
scatter(surface, nPoints, uniform) { Point }
Point -->
s(2*minDist, 2*minDist, 2*minDist)
center(xz)
primitiveSphere
label("sphere")
TestSphere
TestSphere -->
case overlaps(intra, "sphere"):
NIL
else:
ReducePoints
ReducePoints -->
case p(reduce):
NIL
else:
s(cube_width, cube_width, cube_width)
center(xz)
primitiveCube
... View more
09-03-2019
10:25 AM
|
0
|
2
|
2347
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-14-2022 07:18 AM | |
| 1 | 06-22-2020 04:54 AM | |
| 1 | 02-17-2020 03:10 AM | |
| 1 | 07-03-2023 03:37 AM | |
| 1 | 06-07-2023 05:26 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-19-2023
12:40 PM
|