Help with Sbuilder

This is the Forum to discuss the use of SBuilderX (version 3.10 and above). For previous versions of SBuilder please use the "SBuilder for Flight Simulator FS2004" forum.
hawkryan
Posts: 10
Joined: Thu Feb 03, 2011 7:37 pm

Help with Sbuilder

Post by hawkryan » Sun Apr 03, 2011 12:15 pm

I have a serious problem with my SBX-file. When compiling it turns land to water and vice verca, and suddenly my backup is faulty also. It is many month of work spoiled if not solved. Please help somebody.

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Help with Sbuilder

Post by meshman » Sun Apr 03, 2011 3:53 pm

The SBX file is plain text and could be opened with Notepad or a similar type editor. The structuring of the file isn't so complex to see what's going on. You would have polygon/lines being identified, a GUID being applied for what the line/polygon does and then a listing of the vertices.

If you'd like to attach or upload the .SBP and .SBX files, I or someone else can take a look. I assisted another developer who ran into problems because everything was in one file and got messed up. Doing a lot of cutting and pasting from his .SBX file into smaller, more manageable files helped get him back onto his way to completion
Lance

hawkryan
Posts: 10
Joined: Thu Feb 03, 2011 7:37 pm

Re: Help with Sbuilder

Post by hawkryan » Sun Apr 03, 2011 4:09 pm

I have opened the SBX-file i Notepad, but don`t know what to look for to find the problem. I have opened the BGL-file in TMF viewer, and can see the problem there, but no solution. I hav e send a mail to you. I don`t know if you have got it. If possible I will mail the SBX-file to you. And hopefully you can find the error.

User avatar
luisfeliztirado
Posts: 436
Joined: Sun May 15, 2005 9:15 am
Location: Santo Domingo

Re: Help with Sbuilder

Post by luisfeliztirado » Mon Apr 04, 2011 12:05 am

Unfortunately, very complex files are difficult to manage. You have probably attempted to make modifications to the hydro polygons or their holes after creating a large amount of other elements, all containing many vertices. At that point, SBuilderX (and SBuilder as well) can confuse the elements and reverse water to land and vice versa.

If you have a good backup, then your project is saved. If not, but if you have compiled to FS 9, then you can try loading that vtp file in SBuilder and your project will be saved.

Otherwise, you will have to start over again, wiser but perhaps not happier.

Best regards.
Luis

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Help with Sbuilder

Post by meshman » Mon Apr 04, 2011 12:54 am

Greets Luis,

Me thinks you've hit the nail on the head. I had Ryan send over copies of the SBX and SBP files. Impressive work, something that reflects a level of passion not seen too often.

I've broken out the polys (600+) from the lines (2,000+) so far. The polys by themselves won't process correctly, so I'm going to see about cutting the parent/hole polys out from the rest and see how that looks.

I'm suppose to be working today (again?), fixing the house to sell. But I'm tired and getting dirty in some scenery work is better than getting dirty in the yard! Plus I'm old and tired. No excuse, just fact!

Off to dissect the Faroes some more. :mrgreen:


P.S. Ryan posted a screenie of the problem at Avsim.
Lance

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Help with Sbuilder

Post by meshman » Fri Apr 08, 2011 7:10 pm

I have spent a little time looking, working and dissecting Ryan's files, but not enough to get a better clue as to what's happening.

Getting into the v4 (good) SBX file and the v5 (bad) SBX file I isolated the parent/child polygons. There is the one parent and 29 childs for each. Seven of the polygons have been changed from v4 to v5. Making a new SBX file with just the total of 30 polygons reveals that v4 compiles and displays OK, while v5 gets inverted around most all the work, where land is water and vice versa. Why? Haven't figured THAT out yet, if I do in fact figure it out?

If anyone (Luis or Luis) wants to take a peek at the SBX files please let me know. They are small for those still on dial-up... :lol:
Lance

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

Re: Help with Sbuilder

Post by Luis Sa » Fri Apr 08, 2011 11:42 pm

Hello Lance and Luis,

I am extremely grateful for the support you give to SBuilderX users. I take this opportunity to acknowledge this help. Most of the time I dedicate to SBuilderX these days is to login in (almost everyday) into the management section of this forum to approve new users or to delete spammers. Unless the financial crisis here in Portugal changes my plans, I expect to retire this summer. If that happens I will gain the time to dedicate again to scenery design.

In relation to the problematic SBX file with broken master/child polygon structure, I can try to discover the problem. I need to get the SBuilderX source files and set up the developing environment but I will give it a try.

Best Regards, Luis

User avatar
luisfeliztirado
Posts: 436
Joined: Sun May 15, 2005 9:15 am
Location: Santo Domingo

Re: Help with Sbuilder

Post by luisfeliztirado » Sat Apr 09, 2011 1:23 pm

Good luck to you, Luis, the situation is so difficult at the moment. Hopefully, as of next year, you will be able to spend more time on a beautiful boat sailing the lovely Mediterranean. Some of my fondest memories are there, the bright clear skies, the dark blue waters, soft breezes, and a nice boat.

Best regards.
Luis

rhumbaflappy
Posts: 419
Joined: Sat Oct 16, 2004 10:11 pm

Re: Help with Sbuilder

Post by rhumbaflappy » Sat Apr 09, 2011 2:43 pm

I wonder if the polys could be split into a set of QMID11 polys... I'm not sure what this would do to the child polys.

I could work on this as well if Lance sends me a copy.

Dick
Dick

meshman
Posts: 219
Joined: Sun Jan 01, 2006 11:54 pm

Re: Help with Sbuilder

Post by meshman » Sat Apr 09, 2011 3:57 pm

Greets Luis, Luis and Dick,

I'll look up your email and send off a copy of the SBX files, Dick. Trying to get a house up for sale by the end of the month doesn't give me a lot of time to tinker. I want to check the six problem child polys that are causing the problems, but some are large and stepping through the points one by one will take some time. I don't know if there is a twist in one of them or not? And cutting to QMID11 boundaries? You'll see!

Ryan does have a workable version, which saves his work from the past two months. He just needs to check out those six polys to see how any lines or "inner poly work" may be amiss.

And Dick, I have an old time mesh question I'll ask also. My scenery tinkering only goes back to FS9, so I'm wandering and wondering on another issue.
Lance

rhumbaflappy
Posts: 419
Joined: Sat Oct 16, 2004 10:11 pm

Re: Help with Sbuilder

Post by rhumbaflappy » Sun Apr 10, 2011 8:11 pm

I seem to have found the answer. The winding direction of the hole polys is causing the problem.

If you reverse the winding of the root poly ( Poly.1 ), then the holes work OK and the BGL compiles properly.

Alternately, I fiddled with the hole polys by editing the SBX file to remake them as polys ( not holes ). I then loaded the SBX file and made them holes again, one by one. It worked. Comparing the original SBX to the newly 'holed' SBX, I found the winding direction of the holes was reversed from the original file. This means the relative winding direction of the polys was causing the problem.

I don't know why it happened. But the quick fix if this is suspected, is to change the direction of the base poly, and leave the holes alone... this means you change the direction of 4 points rather than hundreds of points in the SBX file with a text editor.

Dick
Dick

User avatar
luisfeliztirado
Posts: 436
Joined: Sun May 15, 2005 9:15 am
Location: Santo Domingo

Re: Help with Sbuilder

Post by luisfeliztirado » Mon Apr 11, 2011 12:04 am

I knew we could count on you, Dick. Did you notice, please, which way the windings were when wrong? It has been a long time, but I seem to remember that outer polygons wind in a clockwise direction, while inner polygons should wind counter clockwise.

Nonetheless, I also remember Doug mentioning that it did not matter and that SHP2Vec would correct any incorrect windings.

So, in the problem file, were both outer and inner polygons winding the same? Would that mean that compilation would be incorrect, in spite of what Doug said? Interesting.

Best regards.
Luis

rhumbaflappy
Posts: 419
Joined: Sat Oct 16, 2004 10:11 pm

Re: Help with Sbuilder

Post by rhumbaflappy » Mon Apr 11, 2011 2:11 am

Hi Luis.

I didn't check the relative directions, but I do know changing either the holes or the base poly would fix the problem... so that indicates no preference as to clockwise or counter for either holes or the base. But I suspect they need to be in different directions. I'll have to look.

Edited+++++++++++

The original version 5 had all polys clockwise. Changing the outer "base" poly to counter-clockwise fixes the problem. It seems they should be different, but not in any specific order.

I seem to recall I made smaller projects with everything clockwise, and the result was OK... But I also recall problems with some SRTM shoreline shapefile data similar to what Ryan has found.

Dick
Dick

User avatar
luisfeliztirado
Posts: 436
Joined: Sun May 15, 2005 9:15 am
Location: Santo Domingo

Re: Help with Sbuilder

Post by luisfeliztirado » Tue Apr 12, 2011 1:31 pm

This is great and will save Luis a lot of trouble when he checks whether SBuilderX is causing the problem. Thanks, Dick.

Thanks.
Luis

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

Re: Help with Sbuilder

Post by Luis Sa » Wed Apr 13, 2011 1:37 am

luisfeliztirado wrote:This is great and will save Luis a lot of trouble when he checks whether SBuilderX is causing the problem. Thanks, Dick.
Thanks.
Luis
Hello,

I am not able to check this until after the Easter (yes, sailing :D ) but, if I remember, outer polygons in SHAPE file definitions have their points listed in clockwise order and holes in anticlockwise order. When you create these polygons in SBuilderX the order of the points is forced in that way. For example if you draw 1 big and 1 small polygons, both in clockwise order, and then you set the smaller as a hole, you will notice that the point order of the small polygon changes to anticlockwise (just pass the mouse over the points and check the labels).

Note that this point ordering is not used by SBuilderX in deciding which is a parent and which is a child. For example you can export the last example and opening it in an editor change the order of the smaller polygon (it has just 3 points in my example !) back to clockwise order as it was at creation time (before I declare it as a hole). If I select the parent polygon and move it to the right in my display and I append the modified SBX I get 2 identical polygons (each with a hole). The right one is OK. The left one is OK until it is ...

(I would like to check this part but I can not at this moment)

... exported as a shape file or compiled. In fact I have just exported my 2 polygon project as a shape file and appended the result into a new SBuilderX project. The left polygon has not been corrected with this export/import. The points of the hole remain in clockwise order!

If I had the code with me now I could do the following: before saving a shape file, after reading a 3rd party shape or before compiling (eg creating the shape file for the compiler) everything polygon would go though the checking clock/anticlockwise routine. The routines exist and the change would result in a very few lines of code.

Regards (and thanks for discovering one more particularity of SBuilderX), Luis

ps: I am not sure if Lance send me an email. I did not received (or saw) it. But for the moment the problem is "solved".

Post Reply