Skip to content

Dilation/Erosion interface in Julia#6

Merged
stevengj merged 3 commits into
mainfrom
dilation
Jul 10, 2026
Merged

Dilation/Erosion interface in Julia#6
stevengj merged 3 commits into
mainfrom
dilation

Conversation

@lxvm

@lxvm lxvm commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a dilation_distance keyword to the ProjectionProblem API in the Julia API that provides an easy way to expand the solid region by approximately dilation_distance in all directions (or shrink/erode it if dilation_distance is negative).

Additionally, in the high-level api, the functions ssp1, ssp1_linear, and ssp2 accept an optional trailing positional argument for the dilation_distance.

Tests were added for the adjoints w.r.t. the filtered density in the presence of a non-zero dilation for both the low-level and high-level APIs.

Additionally, I added an example that demonstrates the effect of the dilation/erosion on Cassini ovals.

image

@stevengj

Copy link
Copy Markdown
Contributor

cc @smartalecH and @romanodev — it would be good to add this to the Python API too.

@smartalecH

Copy link
Copy Markdown
Collaborator

I have a draft for the python implementation locally -- I'll try to push something soon.

@stevengj

stevengj commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Note that this is the algorithm from NanoComp/meep#3087 (comment), which I assume is the same as @smartalecH's draft.

Any comments on the API? A dilation_distance keyword (defaulting to 0 or false … in Julia false == 0, negative for erosion) seems straightforward enough.

Comment thread src/julia/SSP/src/project.jl Outdated
@romanodev

Copy link
Copy Markdown
Collaborator

The API is straightforward. @smartalecH: if your draft is different than the intended approach, I can take a crack at this (or feel free to address only SSP1, and I will follow with SSP2)

Comment thread src/julia/SSP/src/project.jl Outdated
@stevengj stevengj merged commit ed999bc into main Jul 10, 2026
3 checks passed
@stevengj stevengj deleted the dilation branch July 10, 2026 21:57
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.

4 participants