Skip to content

Simplify fast halo based on footprint#207

Open
gpeairs wants to merge 2 commits intomainfrom
gp/footprint-halo
Open

Simplify fast halo based on footprint#207
gpeairs wants to merge 2 commits intomainfrom
gp/footprint-halo

Conversation

@gpeairs
Copy link
Copy Markdown
Member

@gpeairs gpeairs commented Apr 22, 2026

Components can implement their own halo function to customize or simply to speed up exclusion area calculation. A common pattern is to specialize footprint, which should return a single GeometryEntity covering the entire component, and then delegate halo to SchematicDrivenLayout.footprint_halo:

DeviceLayout.footprint(comp::MyComponent) = Circle(comp.outer_radius + comp.gap)
DeviceLayout.halo(comp::MyComponent, d, d_i=nothing; kw...) =
    SchematicDrivenLayout.footprint_halo(comp, d, d_i; kw...)

footprint_halo offsets the footprint once and replicates it across all matching layers in the component, handling memoization and layer filtering automatically. This avoids the per-element, per-layer Clipper calls of the default halo.

Previously this required a lot of boilerplate.

gpeairs added 2 commits April 22, 2026 16:10
Introduces footprint_halo(comp, outer_delta, inner_delta) which computes
halos from a component's footprint geometry rather than per-element offsets.
Significantly faster for components with simple bounding shapes.

- New footprint_halo function in components.jl with layer replication
- footprint(::Ellipse) identity method in polygons.jl
- ExampleStarIsland migrated to use footprint_halo (10 lines -> 2 lines)
- Tests for multi-layer, only_layers, inner_delta, and memoization
- Updated autofill.md documentation
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/schematics/components/components.jl 90.90% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant