-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Algorithm + manifold and accelerator passthrough in clipping functions #273
base: as/adaptivepredicates
Are you sure you want to change the base?
Conversation
60eabb9
to
b52ef6c
Compare
941f27d
to
bc9a491
Compare
b52ef6c
to
f2d90a8
Compare
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but have to remove line breaks between methods of the same function 😆
struct DoubleSTRtree <: IntersectionAccelerator end | ||
struct SingleNaturalTree <: IntersectionAccelerator end | ||
struct DoubleNaturalTree <: IntersectionAccelerator end | ||
struct ThinnedDoubleNaturalTree <: IntersectionAccelerator end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only one with thinning?
Wondering if it can be a type parameter
""" | ||
FosterHormannClipping{M <: Manifold, A <: Union{Nothing, Accelerator}} <: GeometryOpsCore.Algorithm{M} | ||
|
||
A type that represents the Foster-Hormann clipping algorithm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A type that represents the Foster-Hormann clipping algorithm. | |
Applies the Foster-Hormann clipping algorithm. |
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_cut(T, GI.trait(geom), geom, GI.trait(line), line; exact = True()) | ||
cut(geom, line, ::Type{T} = Float64) where {T <: AbstractFloat} = cut(FosterHormannClipping(), geom, line, T) | ||
cut(m::Manifold, geom, line, ::Type{T} = Float64) where {T <: AbstractFloat} = cut(FosterHormannClipping(m), geom, line, T) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) where {T<:AbstractFloat} | ||
return _difference( | ||
TraitTarget(target), T, GI.trait(geom_a), geom_a, GI.trait(geom_b), geom_b; | ||
alg, TraitTarget(target), T, GI.trait(geom_a), geom_a, GI.trait(geom_b), geom_b; | ||
exact = True(), kwargs..., | ||
) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) where T | ||
return UnionIntersectingPolygons(#=TODO: alg.manifold=#)(GI.MultiPolygon([poly_a, poly_b])) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return GI.MultiPolygon(res) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) where T | ||
union(alg, poly_b, multipoly_a; target, fix_multipoly, kwargs...) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) where T | ||
return GI.MultiPolygon(_union(alg, TraitTarget{GI.PolygonTrait}(), T, trait_a, multipoly_a, trait_b, multipoly_b; fix_multipoly, kwargs...)) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -526,6 +526,11 @@ function _point_filled_curve_orientation( | |||
return iseven(k) ? out : in | |||
end | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f2d90a8
to
974a162
Compare
Not sure of name (too verbose, maybe Foster()?). Intersection accelerators will come into the picture later (next PR) but we need them now to instantiate the struct.
Better than printing out since we can (A) check on it and (B) access the polygons as well as the a_list and b_list in Julia. I have a few plot recipes for them but not sure if they are worth putting in a Makie extension...they would also be inaccessible there. Maybe in GeoMakie? Then we can make full use of customizations etc.
This is a shorter change list as a sampler, to show what needs to happen.
974a162
to
5b0c4a1
Compare
Spun out from #259
Parent: #275 (adaptive predicates)
Child PRs: #274 (trees)
FosterHormannClipping(manifold, accelerator)
algorithm - we can bikeshed the nameTracingError
that actually stores all the context including a_list and b_list, this way we can more effectively diagnose what's going on.