Power tower are 90 degree rotated

#1
Hi Arno,
i'm trying to create power tower with these steps:


# place point POWERTYPE from POINT
HeadingFromNearestLine|FTYPE="POINT" AND power="tower"|power="line"|hdg

# convert points to polygons: only for scenproc v2
PointToPolygon|FTYPE="POINT" AND power="tower"|8;8|hdg|String;PowerPolygon|PowerTower

# create agn for power tower gen_powertower01 in file hazards.bgl

CreateAGNLibObject|PowerPolygon="PowerTower"|{54382ec5-b1bd-4a43-aa1a-4f5f529356c3}



As you can see, i use default gen_powertower01 , and i've this problem:

most of (almost all) power tower (red circle) are 90 degree rotated, like image

Power Tower.jpg


How can i solve problem?

Can i add 90 degree to hdg?
Or i must create a new rotated object and add it to autogen?

Thank you

Chris
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi Chris,

Did you try to check the generated heading values in a GIS program? Then you can see if the heading was calculated wrong. Might be when there are multiple lines for example that the wrong one was picked to calculate the heading.
 
#3
Hi Arno,
yes, i've checked with QGIS, heading was calculated correctly.
If i use same OGR data but compiled with scenproc 1.1 (and old parameter, without PointToPolygon step), points have same rotation angle of polygons, but when converted to agn are 90 degree rotated.

Here with 1.1
1.1.jpg


Here with version 2
2.jpg



Chris
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
So the heading is the same in both versions, but the model is rotated in v2? Sounds like it must be the step that places the agn or the point2polygon step that adds the offset.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#6
Hi,

I tried to check in the source code what the difference is between v1.1 and the development release. But too many differences to see where this comes from.

So I'll try to setup a test case to reproduce the problem and work from there.
 
Top