Skip to content

[Mesh] 2D display of mesh has a side effect on field values  #3796

@chapuisk

Description

@chapuisk

Describe the bug

First issue : when rendering a field in a 2D display, it changes the values of cells {0,0} and {1,0} to reflect min and max (sort of meta-data) of init field (or the very first changes) - and then those cells do not change anymore. Turning the display to 3D solve the problem. Also if you have a 2D and a 3D display, those 2 cells are the same in BOTH displays, meaning it mess up directly with field values.

Second issue : when rendering a field in a 2D display, it seems that cells with max x and max y (i.e. in the display the bottom line and the column at the right) are not properly rendered

To Reproduce
Steps to reproduce the behavior:
Run the model at the bottom of the issue

Expected behavior
Mesh should not mess up with fields

Screenshots

See a random experiments :

Screen Shot 2023-04-26 at 16 33 04

Desktop (please complete the following information):

  • OS: macOS Monterey (also on windows 11)
  • PC Model: Apple M1
  • GAMA version: 1.9.1
  • Java version: JDK embedded
  • Graphics cards / Display system:

Additional context

The model I use to generate screenshots:

model NewModel

global {
	
	field f <- field(100,100);
	
	init {
		do upfield( range(100) collect ({rnd(100),rnd(100)}) , 10);
	}
	
	reflex flex {
		do upfield( range(5) collect ({rnd(100),rnd(100)}) , 10);
	}
	
	action upfield(list<point> c, int up) { loop xy over:c { f[xy] <- f[xy] + up; } }
	
}

experiment xp type:gui {
	output {
		display main type:3d {
			mesh f scale:0.0 color:palette([#black, #green, #yellow, #pink]);
		}
		display main type:2d {
			mesh f scale:0.0 color:palette([#black, #green, #yellow, #pink]);
		}
	}
}

Metadata

Metadata

Assignees

Labels

About GridsThis issue concerns grids and fieldsV. 1.9.1Bug specific to the 1.9.1 release😱 BugThe issue reveals a bug in GAMA

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions