Skip to content

Feature: RegionShapes#385

Merged
JonathanMaes merged 4 commits into
mumax:3.11.2from
jplauzie:RegionShapes
Apr 2, 2026
Merged

Feature: RegionShapes#385
JonathanMaes merged 4 commits into
mumax:3.11.2from
jplauzie:RegionShapes

Conversation

@jplauzie

Copy link
Copy Markdown
Contributor

This PR adds a function AllRegionShapes which for a given region value, will return a Shape with all cells in that region. Can be easily looped over all 256 regions. This is intended mainly if one wants to make Shapes of say, Voronoi grains, to be used with Masked().

  • An example file is including showing how each shape can be accessed after AllRegionShapes is called (there is some slightly unusual syntax, it uses 2 sets of parantheses), and also how they can be added together in a simple loop, is attached here: regionshape_example.txt

  • does not yet work with shift/moving frame stuff. I am not sure if it could, or should?

JonathanMaes and others added 2 commits March 12, 2026 15:12
AddsAllregionshape functions. Allows users to given a region (int), return a corresponding Shape

generate shapes for all regions, which can be accessed as:
allregions:= AllRegionShapes()
allregions(i)

where i=0...255
@JonathanMaes
JonathanMaes changed the base branch from master to 3.11.2 March 18, 2026 15:27
Comment thread engine/ext_regionshapes.go Outdated
Comment thread engine/ext_regionshapes.go Outdated
@JonathanMaes JonathanMaes added this to the 3.12 milestone Mar 25, 2026
Add ext_ prefix for extension

Add warnings about shift/redefining regions

add test .mx3 script
@JonathanMaes
JonathanMaes merged commit b2cd426 into mumax:3.11.2 Apr 2, 2026
@JonathanMaes JonathanMaes mentioned this pull request Apr 2, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants