Skip to content
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

Bug in polygon tracing with intersect #248

Closed
asinghvi17 opened this issue Jan 10, 2025 · 1 comment
Closed

Bug in polygon tracing with intersect #248

asinghvi17 opened this issue Jan 10, 2025 · 1 comment

Comments

@asinghvi17
Copy link
Member

asinghvi17 commented Jan 10, 2025

import GeometryOps as GO
import GeoInterfaceMakie
using GLMakie

w1 = 0.15
w2 = 0.3
h = 1

reg1 = Makie.Polygon([
	Point(w1,0),
	Point(w2,h),
	Point(-w2,h),
	Point(-w1,0),
	Point(-w2,-h),
	Point(w2,-h),
])

reg2 = Makie.Polygon([
	Point(0,w1),
	Point(h,w2),
	Point(h,-w2),
	Point(0,-w1),
	Point(-h,-w2),
	Point(-h,w2),
])

p3 = GO.intersection(reg1, reg2; target=GO.PolygonTrait())

with_theme(Poly=(;alpha=0.5)) do
	poly(reg1, label="Reg 1")
	poly!(reg2, label="Reg 2")
	poly!(p3, label="Intersection")
	axislegend()
	current_figure()
end

iTerm2 yIvuni
There's clearly a tracing issue here...will have to take a look at the a and b lists

cc @aplavin

@asinghvi17
Copy link
Member Author

Nevermind, the outer ring was not closed. Need to fix that!

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

No branches or pull requests

1 participant