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

Make miter limit and arc tolerance configurable for polypath offsetting #36369

Closed
wants to merge 2 commits into from
Closed

Make miter limit and arc tolerance configurable for polypath offsetting #36369

wants to merge 2 commits into from

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Feb 19, 2020

Supersedes #29758 (makes API not consistent due to binding limit without including core/method_bind_ext.gen.inc which would result in engine binary size bloat, AFAIK).

Closes #29886.

The first commit breaks compat by combining PolyJoinType and PolyEndType into a single PolyConnection enum. The second commit exposes both miter and arc parameters which was impossible to do due to binding limit of 5 parameters. I can squash these together if the changes are acceptable.

Example

# Produces a thin corridor with round corner passages and dead-ends.
var polyline = [Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]
var polygons = Geometry.offset_polyline_2d(polyline, 20.0, Geometry.JOIN_ROUND | Geometry.END_BUTT)

godot-polyline-offset-example

var polygons = Geometry.offset_polyline_2d(polyline, 20.0, Geometry.JOIN_MITER | Geometry.END_ROUND)

godot-polyline-offset-example2

Test project

geometry-clipper-test.zip

@Xrayez Xrayez requested a review from a team as a code owner February 19, 2020 19:43
@Xrayez Xrayez marked this pull request as draft May 26, 2020 23:09
@Xrayez
Copy link
Contributor Author

Xrayez commented May 27, 2020

Closing this for now due to the same reasons as in #35929 (comment).

This probably has to be approved first godotengine/godot-proposals#913.

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.

Miter limit should be parameter with default value, not hardcoded.
3 participants