Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cfb2407
Add fast path for indices on non-invertible TransformedGrid
marcosdanieldasilva Nov 1, 2025
dceddeb
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
6f0baf0
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
c24448c
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
fcb44c6
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
5d09201
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
0af0ce5
fix test names
marcosdanieldasilva Nov 2, 2025
28f6486
Merge branch 'dev' of https://github.com/marcosdanieldasilva/Meshes.j…
marcosdanieldasilva Nov 2, 2025
67f4573
Update test/indices.jl
marcosdanieldasilva Nov 2, 2025
a9325df
Update test/indices.jl
marcosdanieldasilva Nov 2, 2025
e0f3f42
fix indices transform
marcosdanieldasilva Nov 2, 2025
472f37d
fix transform in indices
marcosdanieldasilva Nov 2, 2025
f5bb602
Merge branch 'dev' of https://github.com/marcosdanieldasilva/Meshes.j…
marcosdanieldasilva Nov 2, 2025
c7c91f9
_reversetransform and indices
marcosdanieldasilva Nov 19, 2025
47b064b
Add fast path for indices on non-invertible TransformedGrid
marcosdanieldasilva Nov 1, 2025
882db7a
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
4201d1a
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
14f0e65
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
04b9b9d
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
c49779f
fix test names
marcosdanieldasilva Nov 2, 2025
8cb03f5
Update src/indices.jl
marcosdanieldasilva Nov 2, 2025
2cdb267
fix indices transform
marcosdanieldasilva Nov 2, 2025
9894eea
fix transform in indices
marcosdanieldasilva Nov 2, 2025
e5fcb80
Update test/indices.jl
marcosdanieldasilva Nov 2, 2025
52144ea
Update test/indices.jl
marcosdanieldasilva Nov 2, 2025
5627ca4
_reversetransform and indices
marcosdanieldasilva Nov 19, 2025
8a7352a
Merge branch 'dev' of https://github.com/marcosdanieldasilva/Meshes.j…
marcosdanieldasilva Nov 21, 2025
308b316
update
marcosdanieldasilva Nov 21, 2025
281ff84
tab in Meshes.jl
marcosdanieldasilva Nov 21, 2025
cc2d07c
formatter
marcosdanieldasilva Nov 21, 2025
897644d
Merge branch 'JuliaGeometry:master' into dev
marcosdanieldasilva Nov 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/indices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ function indices(grid::OrthoRectilinearGrid, box::Box)
LinearIndices(size(grid))[range] |> vec
end

function indices(grid::TransformedGrid, geometry::Geometry)
# construct reverse transform from revertible steps
revtrans = reduce(→, reverse(filter(isrevertible, transform(t))))

# find indices in non-transformed space
indices(parent(grid), revtrans(geometry))
end

# ----------------
# CARTESIAN RANGE
# ----------------
Expand Down
14 changes: 14 additions & 0 deletions test/indices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,18 @@
@test linds[2, 2] == only(indices(grid, p4))
@test linds[10, 10] == only(indices(grid, p5))
@test isempty(indices(grid, p6))

# transformed grid
g = cartgrid(20, 20)
poly1 = PolyArea(cart.([(3, 3), (9, 9), (3, 15), (17, 15), (17, 3)]))
expectedinds = indices(g, poly1)
linds = LinearIndices(size(g))
@test linds[12, 6] expectedinds
taff = Rotate(Angle2d(T/ 2)))
tmorph = Morphological(c -> Cartesian(c.x + c.y, c.y, c.x - c.y))
tseq = taff tmorph
grid = TransformedGrid(g, tseq)
poly2 = taff(poly1)
actualinds = indices(grid, poly2)
@test actualinds == expectedinds
end
Loading