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

Expose 3D Delaunay tetrahedralization in Geometry3D #83353

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

Chubercik
Copy link
Contributor

Whilst working on a benchmark test for the godot-benchmarks suite I have come to the realization that there is no way to access Delaunay3D in GDScript (even though the functionality itself is implemented in Godot here - to be used only by the LightmapGI's bake method).

If merged, you'll be able to use the method via scripting as Geometry3D.tetrahedralize_delaunay(points).

The interface is the same as in other related methods, returning indices into tetrahedralized points.

@MewPurPur
Copy link
Contributor

Makes sense to me, we have this for 2D and this has use cases in 3D (like nice-looking destructible objects).

@Chaosus Chaosus added this to the 4.3 milestone Oct 15, 2023
@Chubercik Chubercik marked this pull request as draft October 15, 2023 10:46
core/core_bind.cpp Outdated Show resolved Hide resolved
@Chubercik Chubercik marked this pull request as ready for review October 15, 2023 11:16
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, haven't tested but if the Delaunay3D code works then this should work

Just a minor performance detail

core/math/geometry_3d.h Outdated Show resolved Hide resolved
@Chaosus Chaosus modified the milestones: 4.3, 4.2 Oct 15, 2023
@Chubercik
Copy link
Contributor Author

Chubercik commented Oct 25, 2023

The tetrahedralization seems to be working just fine:

2023-10-25 04-08-18

The GIF above shows the result of using the Geometry3D.tetrahedralize_delaunay() method on a set of 1000 points scattered randomly in 3D space.

@Chubercik
Copy link
Contributor Author

Out of curiosity (and for future reference), was this PR postponed due to there being a feature freeze for the 4.2 release?

CC @akien-mga

@AThousandShips
Copy link
Member

Yes, exactly

@akien-mga akien-mga merged commit acd37f9 into godotengine:master Jan 4, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@Chubercik Chubercik deleted the expose_delaunay_3d branch January 4, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants