Doing UV split on roundabout Street shape

3097
8
Jump to solution
02-24-2013 04:59 AM
AndreasHeldt
New Contributor II
Hi,

I'm trying to get a UV split on roundabouts working, but apparently CE messes up my geometry. Originally I work in a bigger rule file, but I could reproduce it with this simple snippet:

version "2012.1"  Street -->  split(v, unitSpace, 0)  {   3: TestShape   | 3: TestShape  }   TestShape -->  tileUV(0, 1, 1)  texture("builtin:uvtest.png")


When applied to a roundabout Street shape, I get the following model:

[ATTACH=CONFIG]22125[/ATTACH]

This is it with the source shapes visible, too:

[ATTACH=CONFIG]22126[/ATTACH]

The wireframe looks right, but the geometry is messed up (see the z-fighting in the screenshots). When I export the model and view it, the problem is more visible:

[ATTACH=CONFIG]22124[/ATTACH]

Any ideas how I could work around this? It's really annoying because I try to split the shape into individual driving lanes and adding features like separator lines.
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: matthiasbuehler

hey ..

here's a fix.

Street -->    comp(f) {all :    split(v, unitSpace, 0)   {    3: TestShape    | 3: TestShape    | ~1 : X.   }  }   TestShape -->  tileUV(0, 1, 1)  texture("builtin:uvtest.png")


you see that you go first to each individual segment shape, then use the uv-split.

the issue is here that if a 'closed shape' is detected, the hole is filled automatically. for some usages, this is wanted, in this case here it is not wanted. we'll have to rethink the heuristics on this. I'll create a ticket.

thanks for reporting this ! very interesting case !

Matt

View solution in original post

0 Kudos
8 Replies
by Anonymous User
Not applicable
Original User: obrjo181

you've just forgotten to set up the scope and projection for your texture in your rule file, so your code should be:

Street -->
 split(v, unitSpace, 0)
 {
  3: TestShape
  | 3: TestShape
 }
 
TestShape -->
 setupProjection(0,scope.xz, scope.sx, scope.sy) 
   projectUV(0) 
 tileUV(0, 1, 1)
 texture("builtin:uvtest.png")


Then the textures will be displayed properly.
0 Kudos
AndreasHeldt
New Contributor II
The texture is just fine, and is correctly displayed. The goal is to split the Street shape of the roundabout into several rings by doing a split along the v axis. CE is messing up the geometry.

Fyi, with your solution, I get a completely filled circle. Textures show fine, but there is just too much and, more importantly, messed up geometry here.
0 Kudos
by Anonymous User
Not applicable
Original User: zsoftware

This is a pretty severe problem - we're forced to remove all roundabouts from our city and as blocks reconfigure, our artists have to rebuilt parts of the city. No professional opinion here?
0 Kudos
by Anonymous User
Not applicable
Original User: matthiasbuehler

I'm not 'official support'. I'm basically doing free support work here to help out the professional support analysts. If you would like to get official tech support, please contact your local Esri Distributor and ask them for an annual Subscription.

* * *

I simply did not yet have the time to ask the developer about this.

It seems the UV split has the issue of splitting such round geometries with continuous UVs. I'll report the problem as a bug. The best tip at the moment is to use premodeled assets for the roundabouts via i() to mimic the UV split.

Matt
0 Kudos
AndreasHeldt
New Contributor II
I'm sorry, didn't knew that - I've contacted our local distributor's support now, too. Hopefully they can sort this out.

In the meantime I'll look if it is possible to pre-model the geometry I need - we're doing some post-export mesh analysis to get precise street data but the current approach isn't working on roundabouts because of this bug.

Regards,
Oliver
0 Kudos
by Anonymous User
Not applicable
Original User: matthiasbuehler

hey ..

here's a fix.

Street -->    comp(f) {all :    split(v, unitSpace, 0)   {    3: TestShape    | 3: TestShape    | ~1 : X.   }  }   TestShape -->  tileUV(0, 1, 1)  texture("builtin:uvtest.png")


you see that you go first to each individual segment shape, then use the uv-split.

the issue is here that if a 'closed shape' is detected, the hole is filled automatically. for some usages, this is wanted, in this case here it is not wanted. we'll have to rethink the heuristics on this. I'll create a ticket.

thanks for reporting this ! very interesting case !

Matt
0 Kudos
AndreasHeldt
New Contributor II
Hi,

I've tried it and have to say it works very well, the mesh now looks right! Unfortunately this approach seems to make the u coordinates discontinuous along the u axis. We're strongly relying on continuous UV-Coordinates for detecting driving lanes later on so this fix only works half for us. I'll look if we can maybe circumvent this by treating roundabouts differently when figuring out the exact street layout.

Many thanks for this fix!
0 Kudos
by Anonymous User
Not applicable
Original User: matthiasbuehler

that's no problem at all, just do the tileUV before. :o

Street -->
 tileUV(0, 1, 1)
 comp(f) {all :
 split(v, unitSpace, 0)
 {
  3: TestShape
  | 3: TestShape
 }
 }
TestShape -->
 texture("builtin:uvtest.png")
0 Kudos