how to buffer only one side ?

16 views
Skip to first unread message

Srirama Bhamidipati

unread,
May 8, 2014, 7:48:33 AM5/8/14
to gama-p...@googlegroups.com
hi,

i would like to know if it is possible to buffer to only one side of a line segment (edge) in a graph ? Or may be something to define as an offset ? I want to show quantity moved on an edge ( that is bidirectional  ) and that quantity differs by direction.

regards,
Srirama

Srirama Bhamidipati

unread,
May 8, 2014, 8:05:04 AM5/8/14
to gama-p...@googlegroups.com
Something to this effect.
Capture.JPG

Patrick Taillandier

unread,
May 8, 2014, 8:13:36 AM5/8/14
to gama-p...@googlegroups.com
Hi,

There is no simple solution for that. You can try to use a buffer + offset.

I just modified the road traffic tutorial model 1 with that (and by removing the opengl type from the display):

species road  {

aspect base {

draw (shape + 3.0) at_location (location + 1.5) color: #gray;

draw shape color: #yellow ;

}

}


And I get the attached result (not perfect, but not so bad ;) )
Cheers,

Patrick


--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

tutorial_gis_city_traffic_model_display_city_display_size_658x831_cycle_0_time_1399551080606.png

Srirama Bhamidipati

unread,
May 8, 2014, 8:27:51 AM5/8/14
to gama-p...@googlegroups.com
Smart :) 

Seeking some confirmations here ;)

Q1. The location units will be meters I guess ?
Q2. And if I give negative units to the location, the buffer will move to the opposite side of line ?
Q3. Does the location (+/-) then depend on the from and to node of the edge ?  I mean lets say, (from viewers perspective) an edge has fromNode (south) and toNode (north) then offset I assume will go to the left. And if the same edge has fromNode (north) and toNode (south) then the offset will go right ?
Q4 What is this new # tag ? (twitter effect) ? :D

regards,
Srirama

Patrick Taillandier

unread,
May 8, 2014, 9:12:07 AM5/8/14
to gama-p...@googlegroups.com
Q1: yep, all distance in GAMA is in meters
Q2: I think so
Q3: hum.... not sure. After, you can module the sign of the buffer by a given expression. 

bool to_south <- shape.points[0].y < shape.points[length(shape.points) - 1].y

draw (shape + 3.0) at_location (location + (to_south ? 1.5 : - 1.5)) color: #gray;

Q4: in GAMA 1.6, we used the symbol "°" to define units. However, this symbol is pretty hard to find on US keyboard, so now you can either use ° or # to define units (for instance: #m #km #s #h #km/#h...). Another new nice feature is that you can use # (or °) to define color: #red #blue, #yellow ...


--
Reply all
Reply to author
Forward
0 new messages