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

T-Junction solution #13

Open
TomWor opened this issue Mar 6, 2020 · 2 comments
Open

T-Junction solution #13

TomWor opened this issue Mar 6, 2020 · 2 comments

Comments

@TomWor
Copy link

TomWor commented Mar 6, 2020

Hi @fogleman
I'm trying to wrap my head around your voxel optimization and triangulation code and can't seem to find the part that you referenced in your medium article:

"Each rectangular face starts with four edges. These edges are first segmented where T-junctions occur. We still have a quad, but these points indicate where we need the triangle vertices to be when we triangulate the quad. I use a recursive solution, repeatedly splitting the polygon into two polygons."

I was looking for recursion along these lines but can't find it:

fauxgl/voxel.go

Line 193 in 265867c

func triangulateVoxelFaces(plane voxelPlane, faces []voxelFace) []*Triangle {

Could you point me to the part where you split the polygons?

@fogleman
Copy link
Owner

fogleman commented Mar 6, 2020

Good question. Looks like I only did that on a branch:

52b69ba

@TomWor
Copy link
Author

TomWor commented Mar 6, 2020

Ha, in a way that's even better as I can look at that code in isolation.
Thank you!

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

2 participants