IDEA
|
I believe CGA coding would be much more accesible, if you could merge shapes from different shape trees. For example when making rules for roofs and the building footprint has a complex or nonrectangular shape, you have to get an overview (usually via different split.indexes or occlusion queries) to know if the shape is a part of the central roof or marks the end of the roof. (This operation usually also requires trigonometric gymnastics, which are beyond the abilities of some of my colleagues in the architectural profession) I figure this might be somewhat similar to the label function and could look somewhat like this: Footprint --> primitiveQuad(width, length) SplitFootprint SplitFootprint --> split(x) { '0.5: r(0, split.index * rotationAttr, 0) RaiseBuilding }* RaiseBuilding --> extrude(height) comp(f) { vertical: Facade. | top: Label("roof") RoofConstruction | bottom: NIL } RoofConstruction --> mergeShapes("roof") # <<< proposed new function, merges all shapes labeled "roof" into a new large shape cleanupGeometry(all, 0.1) roofHip(roofHeight)
... View more
04-25-2018
02:06 AM
|
1
|
0
|
659
|
POST
|
Hello Thomas, Thanks again. I must have been looking to long to spot the error. Also great tip (albeit obvious for more experienced users than me) to see the log for details. My script is working now. /Jonas
... View more
10-18-2017
06:12 AM
|
0
|
0
|
712
|
POST
|
Hello Thomas, Thank You, for the quick response. Unfortunately, the backslashes (\\) doesn't seem to be the problem. Also, I cannot even get your example to yield a result. I can export a snapshot via the console, but the console have trouble when iterating over objects and as I have to do this quite often it would be nice to have the function as a script. /Jonas
... View more
10-18-2017
03:57 AM
|
0
|
2
|
712
|
POST
|
Hello all, I often need to take snapshots of my scenes and have tried to write a small python script, which would automatically export all my bookmarks. But when running the script nothing happens (or at least the directory is still empty). Any help would be greatly appreciated. /Jonas The full script goes as follows: ''' Created on 14/09/2017 @author: JBF ''' from scripting import * import View3D # get a CityEngine instance ce = CE() def exportImages(directory, Tag=""): views = ce.get3DViews() for v in views: for b in v.getBookmarks(): path = directory + "\_" + str(b) + str(v) + str(viewports.index(v)) + "_" + Tag + "_raw.png" v.restoreBookmark(b, False) v.snapshot(path) if __name__ == '__main__': exportImages("N:\CityEngine_workspace110517\Sportsparken\images\Testmappe")
... View more
10-17-2017
06:14 AM
|
0
|
4
|
1004
|
Title | Kudos | Posted |
---|---|---|
1 | 04-25-2018 02:06 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|