|
POST
|
It looks like all the buildings do face a consistent direction. It seems like rotating the scope -90 deg before inserting the model might make the door face the street front. However, a better solution would be to rotate the model 90 deg so that the x axis is along the back of the house and the z axis is along the left side of the house, and then resave the dae file. Note: After a block subdivision, the scopes of the lots are such that the x axis is in the direction of the first street front edge (that is, one of the edges that touches a street) but positioned at the back of the lot. The z axis is perpendicular to it and points towards the street front edge.
... View more
11-30-2016
02:46 AM
|
1
|
0
|
437
|
|
POST
|
I guess my response wasn't too clear. One of the advantages of using cga to generate buildings is that you can generate a variety of buildings (of different styles) with just a single cga file. Attributes can describe many different factors that you can set to different values. You can specifically create preset styles using the style keyword. Probability and randomness can also help generate variation or choose different styles. It is possible to generate 3000 different buildings with just a single rule file. If you do want to separate some code into multiple files, you can use imports as well to create links between files.
... View more
11-30-2016
01:32 AM
|
1
|
6
|
3287
|
|
POST
|
No, there is no way to export to OSM directly from CityEngine. However, it seems you might be able to export your 2D shapes to FileGDB and import the gdb into something else like ArcGIS Desktop and use this free add-on for OpenStreetMap data. ArcGIS Editor for OpenStreetMap | Overview
... View more
11-30-2016
01:14 AM
|
0
|
1
|
779
|
|
POST
|
You could create different cga files for each style, but one of the advantages of writing cga to generate buildings is that you can create a variations just by changing the attribute values in the cga file. For example, you could have an attribute that specifies the height of the building, the window size, the facade color, or if there are facade decorations. You can have attributes to describe many different factors. Then, each initial shape or building footprint can be assigned different values for these attributes to produce different buildings from the same rule file. Randomness and probability can even be built into the rules to increase variety. Of course, if the architectural styles you have in mind are completely different, it may become easier at some point to just write separate cga rule files for each different style. That programming choice is up to you.
... View more
11-28-2016
02:35 AM
|
0
|
2
|
3287
|
|
POST
|
Yes, I see this is a problem. Sorry, unfortunately, the step size is automatically determined and cannot be changed. Thank you for the valuable input. If you really need to use the integer values in the code, you can create another variable and use rint() to round the values you get from the slider. You just won't see the rounded values in the slider. @Range(2, 10)
attr a = 2
const b = rint(a)
... View more
11-25-2016
03:03 AM
|
1
|
4
|
1082
|
|
POST
|
Yes, higher resolution textures may be downsampled but only if they are above the max texture sizes set in the Edit -> Preferences window.
... View more
11-22-2016
01:26 AM
|
0
|
0
|
1839
|
|
POST
|
This is a bit tricky. When setting attributes in Python, it's the user set values of these attributes that are changed. The default values for the attribute type are not changed. So, if you have a block with the attribute type whose source is "default", its value won't change. If you have a block with the attribute type whose source is a user-set value (bold in the Inspector), then this value will change. Basically, this means that in Python you have to set the attribute value and set the source to be "USER" as you've figured out.
... View more
11-21-2016
10:01 AM
|
1
|
0
|
889
|
|
POST
|
A resolution of 214 x 150 is small and seems a bit strange to be a default. You can check the max texture size here: Edit -> Preferences -> General -> Procedural Runtime -> Max texture height, Max texture width. I think the default is 2048.
... View more
11-21-2016
09:14 AM
|
0
|
1
|
1839
|
|
POST
|
One way to create something like this is to 1) Create the main gable roof 2) Comp split the roof face onto which you want to add the dormer part 3) Split the roof face to get the footprint for the dormer part 4) Extrude in the world.up direction to create the dormer part
... View more
11-21-2016
08:48 AM
|
0
|
0
|
821
|
|
POST
|
First, in the rule above, I noticed that the UV texture coordinates are not set. The texture() operation only sets the filename but does not set the UV coordinates. If the shape doesn't have UV coordinates, it can be set and applied using setupProjection() and projectUV(). (But, you mention this in the text that you were able to get this working, so maybe this is not the problem.) Second, using file paths that reference something outside of the CityEngine workspace is not possible. This is why paths that start with "C:/" will not work. You can only access files within the CityEngine workspace. You can access files outside of the current project though. See Matt's reply to this post about absolute and relative paths. https://community.esri.com/thread/184099-import-cga-rule-from-different-cityengine-project?et=watches.email.outcome#comment… For example, ESRI.lib is outside of your project but inside the workspace. Here is some code that uses a texture from ESRI.lib. The attribute wall_tex has the @File annotation which allows users to choose a file through a file browser (click on drop down arrow for attribute in Inspector). Alternatively, you can link the attribute to get the filepath from the object attribute wall_tex which is assigned to the shape (Click on drop down arrow next to attribute -> Connect Attribute -> Select "Object attribute"). @File
attr wall_tex = "/ESRI.lib/assets/Facades/International/Groundfloors/g_f001_t001_Educational_000.jpg"
Lot -->
extrude(50)
comp(f) { all: Face }
Face -->
setupProjection(0, scope.xy, '1, '1)
texture(wall_tex)
projectUV(0)
... View more
11-16-2016
02:36 AM
|
0
|
0
|
766
|
|
POST
|
Yes, city scale models exist at LOD3. These are sometimes available for purchase through other sources. For example, PLW Modelworks is such a company (PLW Modelworks ). There are also cities that have built models of their cities using their own private data (for example, Zurich).
... View more
11-11-2016
02:46 AM
|
0
|
0
|
1019
|
|
POST
|
No, there is no export to SVG available. You can take a screenshot of the viewport and save it in a raster graphics format (like png, jpg, tif) but not in a vector graphics format like svg. You can import the raster graphics format into Illustrator too. Click on the arrow next to the icon with the star in the Viewport's toolbar -> Save Snapshot.
... View more
11-10-2016
01:22 AM
|
0
|
0
|
1241
|
|
POST
|
It looks like the data contains shapes that are not quite flat. Are they supposed to be building footprints? If so, then that's great because that makes it easy to create your building models using cga. The rule you started with is a good start. It extrudes the footprint to create the building with a flat roof. Then, you can use comp to get the top face and then create a gable roof on top of that with height determined by the HCL attribute. It looks like you were able to link the attributes correctly, so it looks like the code is getting the height information from the H2 attribute on the shapes. To link the rule attributes to the object attributes, you have to use the same names in the rule file, which you have done. In some cases, you might need to specify the connection in the Inspector by clicking on the drop down box for the attribute -> Connect Attribute -> select Object attribute, but in your case, it seems to have done this automatically for you. attr H2 = 0
attr HCL = 0
Lot -->
extrude(H2) Mass.
comp(f) { top : roofGable(byHeight, HCL) Roof. }
In screenshot6, it looks like the shapes you started with are not flat building footprints. If you can get the building footprints, you can create the models using cga code. Or, if you have the building shells instead, you can just import those into CityEngine without needing to write any cga rules to generate the shells.
... View more
11-09-2016
03:20 AM
|
0
|
0
|
720
|
|
POST
|
Yes, it is possible. I'm glad you figured it out. However, I want to mention that there are few bug fixes related to attribute propagation in imported files, and I would recommend upgrading to CityEngine 2016.1 to get these fixes. For example, (in case someone is interested in code), this line will set the attribute called height in child1 to the value of height coming from child2. Both child1 and child2 are imported files. set(child1.height, child2.height)
... View more
11-09-2016
02:15 AM
|
0
|
0
|
619
|
| 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
|