City Engine CGA FIle Problem

416
6
02-25-2014 07:56 PM
AmirSaleem
New Contributor
Hello everyone..
i need a help, i want to categorised some poles data and assigned them a specific pole shape in object, kindly tell help me.
one more thing any texture does not apply to the street network(Road).
Thank You
Tags (2)
0 Kudos
6 Replies
MatthiasBuehler1
Frequent Contributor II
Hi


1] Create the poles as separate asset files ( obj or dae ), add them to the assets folder.
2] Create a rule with the following code
3] Assign the rule to all imported pole position shapes ( originating from attributed point features )

poleFolder = "assets/poletypes/"
attr poleType = ""
attr poleRotation = 0

@StartRule
Pole -->
    alignScopeToAxes(y)  
    s(0,0,0)
    i(poleFolder + poleType  + ".obj")
    r(scopeCenter, 0, poleRotation, 0)
    center(xz)
    Pole.


Let me know if this makes sense ..

Matt
0 Kudos
AmirSaleem
New Contributor
Hi


1] Create the poles as separate asset files ( obj or dae ), add them to the assets folder.
2] Create a rule with the following code
3] Assign the rule to all imported pole position shapes ( originating from attributed point features )

poleFolder = "assets/poletypes/"
attr poleType = ""
attr poleRotation = 0

@StartRule
Pole -->
    alignScopeToAxes(y)  
    s(0,0,0)
    i(poleFolder + poleType  + ".obj")
    r(scopeCenter, 0, poleRotation, 0)
    center(xz)
    Pole.


Let me know if this makes sense ..

Matt


Thank You soo much Matt, this code works but the alignment and location of pole object still not adjust, the pole become to much
large :(
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi Amir,


then it's most possibly those 2 points :

1] make sure the pole size is modeled correctly and in meters
2] make sure the pole assets are modeled near the cartesian origin ( put the pole 'bottom' to 0,0,0 )


ok ?

matt
0 Kudos
AmirSaleem
New Contributor
poleFolder = "assets/Poles/"
attr poleType = ""
attr poleRotation = 0

@StartRule
Pole -->
    alignScopeToAxes(y) 
    s(0,0,0)
    i(poleFolder + poleType  + "overheadpylon.obj")
    r(scopeCenter, 0, poleRotation, 0)
    center(xz)
    Pole.
   
This is my code how can i control the shape and size of pole.
0 Kudos
MatthiasBuehler1
Frequent Contributor II
The code

s(0,0,0)
i()

makes sure that the ORIGINAL size of the asset is taken. Since the scope size (0,0,0) is only a point, CGA falls back to the asset dimension when inserting the asset.

so you have to edit the 'overheadpylon.obj' asset in a 3d modeling application to give it the correct dimensions. Use e.g. Maya, Max, SketchUp or an other similar app.

Ok ?

m.
0 Kudos
AmirSaleem
New Contributor
Thank You Matt for your lots of help. I try the 3D modelling software. i want to ask that there is no other option to solve this problem like we extrude the obj file with the attribute value????
0 Kudos