|
POST
|
Maybe you could use the occlusion queries (inside, overlaps, touches) with labels to check if the bridge intersects a specific building (with a specific label) on the other side. What might work is a recursive function that keeps translating (or repositioning) the bridge until the intersection test passes. You might want to keep track of the building position/scope on the first side or test for intersection on the first side as well. For example, you could create two faces, one for each side of the bridge and test if they are inside the buildings. Then, once you find a good position, you could recreate the bridge again from the two faces on the bridge's ends. Don't forget to make sure the recursion will always stop at some point.
... View more
09-29-2017
08:49 AM
|
2
|
5
|
4429
|
|
POST
|
You can use the i() operation to insert obj files. i Operation In the Paris example, the code extrudes a footprint to the building's height, then it splits it into facades and floors and puts textures on each floor. In this example, there is no obj file for the entire building. To create a courtyard, you can use setback() to split a lot into a courtyard and building footprint. Then, insert the obj on the building footprint using i(). To get different shapes for the courtyard, you can also use other operations (or a combination of them) like split, splitArea, offset, setback, shapeL, shapeU, shapO, and innerRectangle. setback Operation
... View more
09-29-2017
07:43 AM
|
0
|
0
|
704
|
|
POST
|
This is a bug. Thank you for helping us find this. Your screenshots are great with the coordinate system and the download extent numbers, and they really helped us track this down. We suspect there is a feet to meters conversion problem somewhere. The coordinate system in your current scene is in feet, so there is a problem with the data download, but if you start with a new scene, you should be able to get the data, and then import it into your current scene. I think this workaround might work for you. 1) Open a new scene 2) File -> Get Map Data 3) Select the area you want to download 4) In the maps folder, find the newly downloaded elevation.tif file, and drag it into your original scene (with the coordinate system in feet). 5) A dialog will pop up, and you can specify the texture to be texture.jpg.
... View more
09-28-2017
09:41 AM
|
2
|
0
|
1616
|
|
POST
|
You can display the grid (drop down arrow next to icon in viewport toolbar), and the information display will tell you the current grid size. The grid cell size changes as you zoom in and out.
... View more
09-28-2017
08:47 AM
|
0
|
0
|
741
|
|
POST
|
No, sorry, there currently isn't a way to specify the sorting order except for the three options: alphabetical, ascending, and descending. Adding a zero in front of the single digit numbers is the only way I can think of too.
... View more
09-22-2017
02:03 AM
|
0
|
0
|
471
|
|
POST
|
When you set some edges of a polygon shape to be street edges (Shapes -> Set Street Edges), then there is an object attribute called streetWidth which contains a list of street widths. It's just a workaround, but you can change the values in this list (numbers separated by semicolons, and ending with a semicolon). The list starts with the first edge of the polygon (shown in orange when shape is selected) and goes counterclockwise around the polygon. Then, you can connect a rule attribute to this object attribute to access the values in the cga code where the setbacks are called.
... View more
09-22-2017
01:56 AM
|
2
|
2
|
2400
|
|
POST
|
Sorry, the fence rule is not released yet. For local edits, there is a tutorial available (which is similar to but not the same as the example in the video): Tutorial 20: Local edits—CityEngine Tutorials | ArcGIS Desktop
... View more
09-21-2017
08:18 AM
|
0
|
0
|
816
|
|
POST
|
You can pass the values for split.index and split.total to future rules. Lot -->
split(x) { ~1: Col(split.index, split.total) }*
Col(col_ind, nCols) -->
split(z) { ~1: Cell(split.index, col_ind, nCols) }*
Cell(row_ind, col_ind, nCols) -->
//cell index starting at 0 = row_ind*nCols + col_ind
//cell index starting at 1 = row_ind*nCols + col_ind + 1
...
... View more
09-21-2017
08:09 AM
|
1
|
0
|
898
|
|
POST
|
Maybe this doesn't work for you, but would it be possible to put a rule on top of your parcel shapes which sets an attribute to store the parcel area and then create the different buildings on that parcel? For example, in the rule, you could split a parcel into 4 lots (or n lots), where each lot gets a building. The buildings could be created using attributes for setbacks or height. These attributes can be set randomly (or by some schema) in the rule for each of the 4 buildings. Then, the user can change the height or setbacks for each of the 4 buildings using local edits if desired. If all 4 buildings are created in the same rule (at the parcel level), then you have access to the parcel area, and you wouldn't need to run python scripts to store reported values in object attributes. With local edits in 2017.0, you will have to create a handle for each attribute you want to be able to change locally. It's just an idea, and I haven't tried this out yet, so maybe there are caveats that I haven't thought about. Local edits tutorial: Tutorial 20: Local edits—CityEngine Tutorials | ArcGIS Desktop As for the Python way, I wrote a response to your question here: https://community.esri.com/message/704045-using-python-to-create-an-object-attribute-from-a-rule-attribute#comment-716987
... View more
09-21-2017
07:40 AM
|
1
|
0
|
8122
|
|
POST
|
I don't think you want to try to get the rule attribute. In Python, you could either get the initial value set in the cga file for this attribute or the user set value (e.g. if you want to get the value the user sets in the Inspector), but you don't want either of these values, and instead you want a value that is calculated within a rule. Therefore, I think you want to get the reported value for the parcel area. For each parcel shape, you can get the reported value for parcel area and then assign this to an object attribute of the parcel shape. To do this, create a Python Main script and a Python Export script (right click on scripts -> New -> Python Module). The following code assumes that a cga rule that reports the parcel area to "ParcelArea" has been applied to the selected parcel shapes. The script reads the value for "ParcelArea" and sets an object attribute called "parcelArea" to have this value. In your Python Main script, run the export script on your desired set of shapes. # get list of selected shapes
shapeList = ce.getObjectsFrom(ce.selection, ce.isShape)
# run export script to get reported values and set obj attr
expSettings = ScriptExportModelSettings()
expSettings.setScript("exportScript.py")
ce.export(shapeList, expSettings)
In your Python Export script (called exportScript.py in above code), you only need to add two lines (8 and 11) to the end of the finishModel() method. # Called for each shape after generation.
def finishModel(exportContextOID, shapeOID, modelOID):
ctx = ScriptExportModelSettings(exportContextOID)
shape = Shape(shapeOID)
model = Model(modelOID)
# get reported value for ParcelArea
r = model.getReports()["ParcelArea"][0]
# set object attr to reported parcel area
ce.setAttribute(shape, "parcelArea", r)
# print to console
print(str(shape) + ": ParcelArea = " + str(r))
Beware that if you change your parcel shapes (e.g. resize them), then the object attribute won't have the correct parcel area anymore, which also means that your buildings will not be receiving the correct parcel area, and you'll have to rerun the python script to update the object attribute.
... View more
09-21-2017
07:21 AM
|
1
|
4
|
5925
|
|
POST
|
The occlusion test above should work. In Edit -> Preferences -> General -> Procedural Runtime, what is the value for Maximum distance for occlusion? If this is 0, then overlaps() will return true (due to numerical imprecision) because the floors are touching the neighboring floors (above and below) that were created in the split. This value is by default 0.001. So, if this value is zero, this might be a reason why the floors are red even when they are not touching the lower building. (Note: You can also add the keyword inter to your occlusion tests to only test between objects in the scene and not within objects. This is faster than using the keyword "all".) What is the rule FloorEnvelope doing? I tested the code with FloorEnvelope as a terminal shape, and this seems to work for me. In this rule, are other shapes being created that might interfere with the occlusion testing? Is there a comp split? comp splits create ghost shapes that are used in occlusion testing. As a note, if shapes are generated, then occlusion testing should work between them. You should not need to reopen the scene if you move your query object. If you change the cga code of the occluder object without regenerating, then you might get some unexpected results. Would you be willing to post your scene and code? I'm not really sure why it's not working.
... View more
09-21-2017
05:27 AM
|
0
|
0
|
1703
|
|
POST
|
Yes, you are correct. The reason why all 9 buildings are the same height is because they all have the same MaxFAR value and the same geometry.area value, and these are the two values that are used to calculate the reachable GFA value that is passed into the first call of ReachRecursion(). They all have the same geometry.area value because they were created using the splits in x and z which created plots of the same size. If you want different size buildings, you'll have to create building footprints of different sizes, or you'll have to change the MaxFAR value for each of the buildings. To create building footprints, these operations might be helpful: innerRectangle, split, splitArea, offset, setback, shapeL, shapeU, shapeO, convexify. To add variation, you can use case statements, stochastic rules, the p() function which calculates probability, and the rand() function. Conditional Rule Stochastic Rule p Function rand Function
... View more
09-20-2017
06:44 AM
|
1
|
3
|
3589
|
|
POST
|
No, sorry, this is not possible if the data extent is in fact too large. There is a limit to the extent of the scene that can exist, and this limit is about a couple hundreds of kilometers, which should be sufficient for large scale cities. If the data extent is larger than this limit, then the data cannot be imported into a single scene. If the data extent is not so large but it is more than a couple hundred kilometers away from the existing data in a scene, then this will also not work. If it is an option for you, you could try to make multiple different scenes for the data. If you can put your data in a FileGDB, then when importing the FileGDB, you can specify the extent of the data you want to download.
... View more
09-19-2017
06:23 AM
|
1
|
2
|
4095
|
|
POST
|
You should be able to use Get Map Data with existing scenes that already have a coordinate system set. The data downloaded will be converted to the coordinate system of the existing scene. There is a limit on the extent of the downloadable data though. The data you want to download needs to be within a radius (maybe approximately 500km?... just guessing on the exact number) of the content in the existing scene. In 2017.0 and I think in 2016.1, there is an error message at the top if you try to select a region that is outside the downloadable extent, and the OK button is grayed out, but I don't think 2016.0 displays this message: "Selected region is out of bounds of current coordinate system. Open an empty scene or a scene with a fitting coordinate system." Of course, you can start with a new scene, and then Get Map Data will download data into the scene and set the coordinate system to UTM. morrisonb, geoinformacao, achipman_crec If you could tell me exactly what coordinate system you are using, where your existing data is in that coordinate system (camera icon in top right corner of viewport -> Information Display -> look at coordinates), and the location of the data you want to download in Get Map Data, then I can try to reproduce the problem, and maybe there is a bug. Or, if you are able to post a scene and let me know the extent of your desired data download, that would also help.
... View more
09-19-2017
05:45 AM
|
1
|
3
|
1880
|
|
POST
|
Unfortunately, the doc seems to be missing some explanations, and we'll try to update it with Matt's explanations. Thanks for asking about it. The links that Matt posted are the current doc pages that explain these default start rules. First, I'd like to say that start rules and attributes are different. Lot, LotInner, and LotCorner are start rules. They define which rule to start with in the code (in the rule file that is assigned to the shape). Attributes are not really part of this discussion. They are like parameters that describe properties that a user can change, and they can appear in the code with the keyword attr in front. Default start rules are automatically assigned to shapes that are dynamically created by street networks. The default start rule Lot is also automatically assigned to shapes from Get Map Data, as you've noticed. Lot, LotInner, and LotCorner are default start rules that are automatically assigned to shapes generated by blocks. Street, Sidewalk, Joint, Crossing, Junction, Freeway, FreewayEntry, Roundabout, and RoundaboutIsland are default start rules that are automatically assigned to street shapes (the first link in Matt's post). I think there are just these two sets of default start rules. The street shapes doc page explains one set, and I think the doc is currently missing some explanation about the other set (Lot, LotInner, LotCorner). These default start rules are automatically assigned to shapes when the street network is created or when the shapes are downloaded using Get Map Data, but these rule assignments can be easily changed in the Inspector. These names can also be used on any shape. They are not protected keywords that users should avoid using. You can assign the start rule name Lot or LotInner to any shape you want. This just means that the shape will look for a rule called Lot or LotInner in the code, and it will start executing the code with that start rule. Then, the keywords street.front, street.back, street.left, street.right are selectors that can only be used in certain contexts such as in the setback operation or the comp operation. For example, this allows you to create a setback on a certain side of the lot (e.g. to create a front yard). setback Operation Component Split Operation
... View more
09-19-2017
02:59 AM
|
1
|
0
|
2027
|
| 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
|