|
POST
|
Labels work with occlusion queries (inside, overlaps, touches). You can give something a label, and then in another shape, you can check if you occlude with something that has a given label. label Operation Occlusion Queries What you could do is extrude your shapes and assign a label to the extruded shapes. For example, the black shapes would get the label "black". Then, you could use the touches() query with the label "black" to see if the shape touches another shape with the label "black". attr elevationNumber = 0
@range (0.0,1.0)
attr minElevation = 0.2
@range (0.0,1.0)
attr maxElevation = 0.6
Lot -->
case elevationNumber <= minElevation: color(0,0,0) Cube("black")
case elevationNumber >= maxElevation: color(0,0,0) Cube("black")
else: color(1,1,1) Cube("white")
Cube(colorLabel) -->
extrude(10)
label(colorLabel)
TestNeighbor
TestNeighbor -->
case touches(inter, "black"):
s('1,20,'1)
else:
X.
... View more
09-18-2017
09:20 AM
|
1
|
0
|
1011
|
|
POST
|
For the first problem, I'm not sure exactly what you are referring to. Could you please circle it in the image? Would you be able to post the scene and code? For the second problem, yes, it is possible to create a single residential building on a parcel. In the International City rule, I think there is a rule called ResidentialBlockStripeSubdivide. This rule recursively subdivides a shape into many residential lots. You can skip this subdivision by calling ResidentialLot instead of it.
... View more
09-18-2017
08:50 AM
|
0
|
0
|
1009
|
|
POST
|
After some investigation, we found that this is a bug. The bug is due to imprecision at large scales. For example, if you scale down the stuff in the scene so that the buildings are more like real-world building sizes, then the accuracy will be better, and it won't behave like it does in the screenshots. Thanks for sharing your project and helping us find this bug.
... View more
09-01-2017
04:21 AM
|
0
|
0
|
5108
|
|
POST
|
There are actually many possible issues that could be happening besides the one that Thomas mentioned. There could also be a bug. In order to help find out what's going on, would it be possible to post your scene and rules? How is the dome shape being enlarged in 04? In the help doc: Context (and Occlusion) Queries Shapes of a scenario are not considered by queries of default shapes. -> This is because we do not want the default set to be influenced by any other scenario. For example, we do not want scenario 1 to influence the default shapes. If this were the case, then, when you look at scenario 2, you would see default shapes that were influenced by scenario 1, and this is not good. We want each scenario to be independent of the other scenarios, and we want the default shapes to be the same in each scenario. The default objects should not change depending on what scenario you are looking at.
... View more
07-25-2017
04:16 AM
|
1
|
1
|
5108
|
|
POST
|
With reports, you can report the area of each A3 plot, and you can also retrieve the sum of these areas. Then, in the dashboard, you can create a chart that divides each A3 plot area by the sum to get the percentage area for each A3 plot. In the rule above, you don't need to pass geometry.area to the A03 rule because you can just call it in the A03 rule. Then, you can report this area. Then, all reports will be summed, and you can see the SUM (along with the count, min, max, avg) for the report called "AreaA3" in the Reports section in the Inspector. This will be the sum coming from all objects that are selected. report("AreaA3", geometry.area) You can also create a dashboard which will display the sum for all objects in the scene (whether they are selected or not). Window -> Show Dashboard -> Add a Chart -> Select the report -> Key number -> Report = AreaA3. Or, you can use sub-reports to create a column for each A3 plot in a bar chart. The suffix after the period is the sub-report name. Then, select the parent report (name before the period) to create a bar chart in the dashboard. To create names for the sub-reports, you could use the indices from the splits to create a unique name for each A3 plot. lot -->
alignScopeToGeometry(yUp, 1)
rotateScope (0,rotateLot,0)
split(x) { b1 : A01(split.index) | r1 : B01 | ~1 : A01(split.index) | r2: C01 | s1 : D01}
A01(ind1) -->
split(z) {a0Dist : A02(ind1, split.index) | a0Dist : A02(ind1, split.index) | ~1 : Grass}
A02(ind1, ind2) -->
innerRectangle(edge) {shape : A03(ind1, ind2) | remainder = Grass}
A03(ind1, ind2)-->
print(area)
report("AreaA3." + ind1 + "_" + ind2, geometry.area)
In the Dashboard, you could create a bar/pie/stack chart with Report = AreaA3.* and Divide By = AreaA3. Then each bar/section in the chart will represent an A3 plot and will show its percentage area. Here is a tutorial on reporting: Tutorial 11: Reporting—CityEngine Tutorials | ArcGIS Desktop
... View more
06-30-2017
07:22 AM
|
0
|
0
|
823
|
|
POST
|
I think the streets are being made curvy because the graph cleanup is trying to clean up two streets that are really close to each other/next to each other. Maybe you could try to uncheck "Run Graph Cleanup Tool after Import" in the import dialog box.
... View more
06-30-2017
06:14 AM
|
1
|
0
|
1023
|
|
POST
|
I can't think of a better way that I would recommend than the tutorials and examples for learning CityEngine. (Help -> Download Tutorials and Examples).
... View more
06-28-2017
01:14 AM
|
0
|
0
|
710
|
|
POST
|
Sorry, the visual rule editor is no longer available.
... View more
06-24-2017
06:57 AM
|
0
|
0
|
635
|
|
POST
|
You could try to just change the file extension from .spk to .slpk. They are the same file type; the .spk is getting renamed to .slpk for consistency reasons.
... View more
06-22-2017
01:02 AM
|
0
|
7
|
3970
|
|
POST
|
I can't see why this doesn't work. Can you think of something that might be different about your scene compared to tutorial 15? Would you be able to post your scene?
... View more
06-21-2017
02:24 AM
|
0
|
4
|
3558
|
|
POST
|
If you can calculate the values of the attributes in the code, I would recommend creating one attribute and setting the value of this attribute for each apartment in the code using the set() operation. The disadvantage of this approach is that you cannot see the attribute values for each apartment in the Inspector (because you can only see the attribute value for the whole building at the beginning of the rule). The set() operation allows you to set the value of the attribute differently for different shapes in the shape tree. set Operation One minor thing: For an input footprint with dimensions in x and z, I would switch the axes for the x and y splits in your code. Here's how you can add a boolean attribute isOccupied and set it for each apartment to a random true/false value. Then, the apartment is colored green if the attribute is true and red if the attribute is false. attr isOccupied = true
Lot -->
extrude(height)
split(y) { ~floor_height: Floor }*
Floor -->
split(x) { ~apt_width: split(z) { ~apt_depth: Apartment }* }*
Apartment -->
set(isOccupied, 50%: true else: false)
ColoredApartment
ColoredApartment -->
case isOccupied:
color(0,1,0)
else:
color(1,0,0)
Note that you could also do this without the attribute isOccupied by passing the random true/false value as parameters in the rules. Lot -->
extrude(height)
split(y) { ~floor_height: Floor }*
Floor -->
split(x) { ~apt_width: split(z) { ~apt_depth: Apartment(50%: true else: false) }* }*
Apartment(aptIsOccupied) -->
case aptIsOccupied:
color(0,1,0)
else:
color(1,0,0)
You could also pass values for the split indices if you need these values to calculate the values of the attribute. Here, the attribute is set to true only for apartments with even numbered indices. attr isOccupied = true
getVal_isOccupied(floor_index, col_index, row_index) =
case floor_index%2==0 && col_index%2==0 && row_index%2==0:
true
else:
false
Lot -->
extrude(height)
split(y) { ~floor_height: Floor(split.index) }*
Floor(floor_index) -->
split(x) { ~apt_width: Column(floor_index, split.index) }*
Column(floor_index, col_index) -->
split(z) { ~apt_depth: Apartment(floor_index, col_index, split.index) }*
Apartment(floor_index, col_index, row_index) -->
set(isOccupied, getVal_isOccupied(floor_index, col_index, row_index))
ColoredApartment
ColoredApartment -->
case isOccupied:
color(0,1,0)
else:
color(1,0,0)
If you want to set values in the Inspector, I would recommend using string lists to store the values for each apartment. String lists are a set of strings separated by a semi-colon. Go to the section "String List Utility Functions" on the main CGA reference page here for more info on what string functions are available: CGA Reference Index
... View more
06-21-2017
02:15 AM
|
1
|
1
|
1049
|
|
POST
|
Did Tutorial 15 work for you? I noticed you are using version 2015.2. You could try upgrading to 2016.1, but I don't think it should make a difference in this case since exporting Tutorial 15 with 2015.2 also worked for me.
... View more
06-21-2017
01:16 AM
|
0
|
6
|
3558
|
|
POST
|
That's strange. I can't seem to reproduce it. The layers are all in the correct order if I follow the steps to export the scene in Tutorial 15 (Help -> Download Tutorials and Examples). Does this tutorial work for you? Tutorial 15: Publish web scenes—CityEngine Tutorials | ArcGIS Desktop I noticed that there's an asterix in the Scene tab which means that the scene has not been saved. Does saving the scene help? The exporter should export the scene with the changes even if the scene is not saved, but it would be interesting to know if this helps or not.
... View more
06-20-2017
09:05 AM
|
0
|
8
|
3558
|
| 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
|