error 7

General discussion about Scenery Design. Questions about SBuilder for Flight Simulator FS2004.
Post Reply
marc
Posts: 25
Joined: Thu Apr 29, 2004 6:29 pm

error 7

Post by marc » Fri Dec 03, 2004 11:09 pm

Buenas Dias -

Luis - tx for Sb -

when working with polygons - and go for compilation - sb return runtime error 7 - out of memory [}:)] [}:)] [?]

why - poligon is not of big size and looks ok.

tx
marc

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Sat Dec 04, 2004 12:00 am

Bom dia Marc,

Could you send me the small project that gives the error?

Regards, Luis

marc
Posts: 25
Joined: Thu Apr 29, 2004 6:29 pm

Post by marc » Sat Dec 04, 2004 7:56 am

Yes sure Luis;

i'll send it to you by email - i'm not so good into attachments on forums.

thanks a milliiiiiiiion !! [;)]

marc

User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

Post by Luis Sa » Sat Dec 04, 2004 11:10 am

Hello Marc,

Thank for the file. Here is what I found.

In generating LWM polys, Sbuilder slices the polygons along LOD13 borders. This slicing (division) sometimes generates polygons with more points than the original ones. Here is an example. Place your attention on the south west LOD13. The polygon has 4 points inside this LOD13 square.

Image


Now if you generate the LWM BGL and appended it back, you will get this:

Image

In order to make my point clear I manually moved the 4 polygons apart to show the number of points. You see that the SW corner polygon has in fact 4 + 2 (on the borders) + 1 (on the corner) = 7 points:

Image

The extra border points are dealt with properly by SBuilder. At some stage I will have 6 points and I have to figure out if I have to close the polygon clockwise or anticlockwise. This means that I have to decide how many corners points I need to add. The error in your project happens at this stage. I declared my arrays with space for 5 extra corner points (I thought that at most I would have 4 corners! so I gave room for 5!). Here is what can happen if the algorithm fails:

Image

As you see there are 3 extra corners points instead of a single one!

What I did after receiving your file was to make room for 15 (!!!) extra points. Now it does not crash but the appended LWM file has polygons that go around the corners. Something is wrong with the algorithms or with the original data. I spend a lot trying to correct my algorithm errors. If I decide to change this I will probably pick a library of computational algorithms instead of implementing my own algorithms (I am no expert on this matter). So what I only can suggest you at this stage is: allways append back the BGL to see if the SBuilder algorithms have done the right job. If not, manuually edit the position of the point (normally is a ill point) which confuses SBuilder.

Kind Regards, Luis

marc
Posts: 25
Joined: Thu Apr 29, 2004 6:29 pm

Post by marc » Sat Dec 04, 2004 3:44 pm

Dear Louis;

Superb explanation !!

thanks marco

Post Reply