|
POST
|
hi. occlusion checks need '3d scopes' (volumes) to work properly with a certain precision. ( as with every computer thingy, it all only works within certain precision, thus you need to give the computer a little room to work properly. occlusions on floating rotated 2d polys thus usually gives you a headache. Tackling this can sometimes be a little tricky, but I've had good success with strategies like this : pseudo code : comp(f) Face Face --> scale down 10% # to avoid overlaps with neighbor faces extrude (0.05) TestVolume TestVolume --> case overlaps : comp(f){bottom : reverseNormals ShapeOverlaps | all : NIL} else : ShapeDoesNotOverlap. ShapeOverlaps --> scale back up to full size continue.
... View more
05-08-2012
05:12 AM
|
0
|
0
|
1123
|
|
POST
|
you can export all the elements you want : - graph segments, e.g. via the shp format - shapes, e.g. via the shp format - 3d models, e.g. via dae, fbx, obj, 3ds, .. CityEngine uses 'shapes' plus 'CGA rules' to produce '3D Models', which then can be exported. --> exporting shapes is not the same as exporting 3d models. choose what you want to export on the first page of the Exporter dialog. ok ? 🙂
... View more
05-04-2012
05:32 AM
|
0
|
0
|
3335
|
|
POST
|
Hi, those two indicators show the 2 memory types CityEngine uses : Java memory (left) and Native memory (right). [ CityEngine is written using 2 programming languages : Java and C++ ] Thus you're running out of Java memory. The reason for this is that Java reserves a certain amount of memory for CityEngine and this memory can not be used for any other application. Due to this fact, the developers had to agree on this certain amount of memory which is okay for most users. Some users with big datasets may - as you - run into issues with this. But of course this amount can be set. (PM me to get instructions) Though editing this amount has it's risks if the user's not perfectly aware of the steps taken. To get an overview of how much the VRAM is used, check : Help > About CityEngine > Installation Details > System Info > OpenGL
... View more
05-04-2012
05:25 AM
|
0
|
0
|
5121
|
|
POST
|
oh, and the screenshot : [ATTACH=CONFIG]14057[/ATTACH]
... View more
05-03-2012
08:11 AM
|
0
|
0
|
2241
|
|
POST
|
I'll reply more soon, have to run. here's how I usually report positions : try on a simple quadratic Lot for example. check the mouse coordinates via the Navigation Display in the viewport. CGA :
Lot -->
scatter(surface,3,uniform) { PutInstance }
PutInstance -->
s(.5,.5,.5)
r(0,45,0)
center(xz)
i("builtin:cube")
s(.001,.001,.001)
center(xz)
report("xpos", convert(x, scope, world, pos, 0,0,0))
report("ypos", convert(y, scope, world, pos, 0,0,0))
report("zpos", convert(z, scope, world, pos, 0,0,0))
Python : from scripting import *
# Get a CityEngine instance
ce = CE()
#globals
instancePointList = []
# Called before the export start.
def initExport(exportContextUUID):
ctx = ScriptExportModelSettings(exportContextUUID)
# Called for each shape before generation.
def initModel(exportContextUUID, shapeUUID):
ctx = ScriptExportModelSettings(exportContextUUID)
shape = Shape(shapeUUID)
# Called for each shape after generation.
def finishModel(exportContextUUID, shapeUUID, modelUUID):
ctx = ScriptExportModelSettings(exportContextUUID)
shape = Shape(shapeUUID)
model = Model(modelUUID)
reports = model.getReports()
fillList = [] # vector as list [x,y,z]
if(model.getReports().has_key('xpos')):
xPosArray = reports['xpos']
yPosArray = reports['ypos']
zPosArray = reports['zpos']
i=0
for o in xPosArray:
fillList = []
fillList.append (xPosArray)
fillList.append (yPosArray)
fillList.append (zPosArray)
print fillList
instancePointList.append(fillList)
i += 1
# Called after all shapes are generated.
def finishExport(exportContextUUID):
ctx = ScriptExportModelSettings(exportContextUUID)
print instancePointList
... View more
05-03-2012
08:08 AM
|
0
|
0
|
2241
|
|
POST
|
I am not perfectly sure what you mean if the streets are '2d or 3d' .. 🙂 You can move the end points of streets (nodes) also up vertically with the move tool (w key), so they're 3d. The 'Dynamic City Layouts' - CityEngine's tools to create streets - are 3D. In general, what they do is create a series of shapes which are to be used with CGA. CGA always needs to have an input geometry for use with CGA, thus to create 3d street geometries, you need tools to create the shapes for those streets. I hope this makes sense.
... View more
05-03-2012
06:46 AM
|
0
|
0
|
3335
|
|
POST
|
an initial input. it may happen that the report is not perfectly up to date if you see there's 2 entries when there should be just 1. try 'ctrl-shift-g' to set a new seed, then have a fresh look at the reports tab. * * * just recently I asked one of the devs about the output structure of the reports and he mentioned that this is the most generic form for all possible reporting uses. thus, one has to rearrange the reported data using Python for the specific need using the script based exporter method within the finishModel() method. since reporting is supposed to be generic, the output of the reported data is not given back 'layouted' specific for transformation/rotation/scaling usage. * * * btw. all reported values are stored in a list, one value after the other. The 'Reports Tab' just reads that list and displays some statistic data of that list, but not all of course.
... View more
05-02-2012
06:11 AM
|
0
|
0
|
2241
|
|
POST
|
hi .. it does not matter what you export to FBX, whether this is streets or buildings is the same. what error message did you get ? was the file created or not ? let me know. 🙂
... View more
05-02-2012
03:34 AM
|
0
|
0
|
3335
|
|
POST
|
first step : check the following manual page, it shows the Connection Editor basics : Help > Manual > Mapping Attributes > Mapping Attributes with Connection Editor [ check the attr icon with the black triangle pointing in a rectangle ] additionally : it is important to understand that CityEngine uses some heuristics to find the right connections automatically when a rule is assigned to a shape : If you assign a rule e.g. to a 'Lot' via Drag'n'Drop, CityEngine checks if : 1st priority] an Object Attr exists for the initialized attrs. If so, the connection automatically is made to the Object Attr 2nd priority] a Map Layer attribute exists for the initialized attrs. If so, the connection automatically is made to the corresponding Map Layer attr 3rd priority] the Rule value is used I hope this helps you further ! oh, and also good to know, the @StartRule annotation adapts some behavior : Once drag-n-dropped and a StartRule is defined within a cga rule file, the model generation is directly triggered ( great for demos ! ). let me know if questions remain.
... View more
04-30-2012
11:13 AM
|
0
|
0
|
1070
|
|
POST
|
hey ! that's easy to do. just create a new Map Layer of the 'mapping type'. choose your image file and create an attribute in the dialog. once the layer has been generated, you can check (and edit) the layer attributes in the Inspector. usually, I create mapped attributes based on the image brightness, then create a simple function which maps that value range from 0-1 to a desired range, e.g. 300 x brightness + 20 once this is created, point your CGA rule via the Attribute Connection Editor to the specific layer's target attr value. don't forget to initialize the attr in your rule too ! (e.g. just attr mappedHeight = 0) let me know if it works.
... View more
04-29-2012
11:49 PM
|
0
|
0
|
1070
|
|
POST
|
maybe like so ?
attr floorHeight = 3
@Hidden
attr multistory = false
Lot -->
alignScopeToAxes(y)
LotAligned(scope.sy)
LotAligned(yDim) -->
alignScopeToAxes(y)
extrude(world.y, 100)
split(y) {yDim : BaseVolume | ~1 : NIL}
BaseVolume -->
comp(f) {side : alignScopeToAxes(y) BaseFacade(scope.sy) | top : Top. | all : NIL }
BaseFacade(yDim) -->
case yDim >=
floorHeight:
set(multistory, true)
Printer
else:
Printer
Printer -->
print (multistory)
... View more
04-26-2012
10:42 AM
|
0
|
0
|
1487
|
|
POST
|
hey ! great to hear ! let me know the specific technical questions first, we then can tackle the task of 'generalizing' the rules to create more variety in the actual building volumes. that's usually the more complex task when learning CE. 😮
... View more
04-26-2012
10:21 AM
|
0
|
0
|
2839
|
|
POST
|
Hi, here's some code to get you started .. It shows how I would begin, when trying different things. It's not the final thing you'd want to use, just shows you some strategies, ok ? A screenshot : [ATTACH=CONFIG]13838[/ATTACH]
attr Number_Floors = 3
attr Floor_Height = 2.8
attr Tile_Width = 3.5
attr Relative_Bay_Height = 0.5
attr Bay_Angle = 60
attr Bay_Border_Thickness = 0.1
attr Bay_Border_Depth = 0.12
attr Bay_Window_LowerHeight = 0.8
Lot -->
extrude(world.y, Number_Floors * Floor_Height )
comp(f) {side : Facade | top : Roof. }
Facade -->
split(y) {~Floor_Height : Floor }*
Floor -->
split(x) {~Tile_Width : Tile }*
Tile -->
30%:
roofGable(Bay_Angle,0,0,false,0) # Reorient Roof vertically !
split(y) { ' Relative_Bay_Height : alignScopeToAxes(y) BayWindowVolume(scope.sy) | ~1 : NIL }
else :
Facade.
BayWindowVolume(yDim) -->
comp(f) {back : NIL | side : BayWindowSide | all : Rest. }
BayWindowSide -->
alignScopeToAxes(y)
split(y) {Bay_Border_Thickness : BayBorder | ~1 : BayWindow | Bay_Border_Thickness : BayBorder}
BayBorder -->
s('1.10,'1,Bay_Border_Depth)
center(x)
i("builtin:cube")
trim()
BayWindow -->
split(y){Bay_Window_LowerHeight : Wall. | ~1 : BayWindowFrame}
BayWindowFrame -->
offset(-.1)
comp(f){border : Frame | inside : Glass.}
Frame -->
extrude(.05)
... View more
04-26-2012
07:03 AM
|
0
|
0
|
2839
|
|
POST
|
attr multistory = false
BaseFacade -->
case scope.sy >=
floorHeight:
set(multistory, true)
Shape.
else:
BaseSide.
Try this, should work. (did not test the code). I assume you just need to define a Shape or NIL or something in the code.
... View more
04-25-2012
07:11 AM
|
0
|
0
|
1487
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-06-2012 08:40 AM | |
| 1 | 09-30-2013 08:33 AM | |
| 1 | 08-07-2013 04:45 AM | |
| 1 | 10-15-2012 02:19 AM | |
| 1 | 01-30-2014 12:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|