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

Add a Path3D editor Option to "mimic" a closed curve #8650

Closed
GreenCrowDev opened this issue Dec 13, 2023 · 2 comments · Fixed by godotengine/godot#86195
Closed

Add a Path3D editor Option to "mimic" a closed curve #8650

GreenCrowDev opened this issue Dec 13, 2023 · 2 comments · Fixed by godotengine/godot#86195

Comments

@GreenCrowDev
Copy link

Describe the project you are working on

A plugin for procedural mesh generation.

Describe the problem or limitation you are having in your project

It's no secret that in the past few years there's been a lot of discussion and proposals to implement "closed curves" when talking about Path3D/Path2D and Curve3D/Curve2D.
The limitation is clear: having a "closed" and "continous" curve is cumbersome and not easily achievable, but it's something you would want almost all times.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The implementation I have in mind is very simple and straightforward, should be easy to implement, and will not even need to modify the Curve3D class.
The idea is to just have an option in the Path3D editor that will "synchronize" the first and the last point of the curve mimicking a closed curve without any other hassle.
Basically when this option is true, the last point will have the same position, handle position, and tilt of the first point.
This "mode" could alse be automatically activated when pressing the "Close Curve" button, but this is not mandatory.
I think this also has a lot of pros with respect to implement a Curve3D is_closed property, that would require a lot of work and could even be undesirable at times.
I can probably try an implementation in the next days.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

path3d_screenshot

If this enhancement will not be used often, can it be worked around with a few lines of script?

This would be used a lot if someone wishes to work with paths and curves.

Is there a reason why this should be core and not an add-on in the asset library?

This should be core behaviour and desirable to have directly in the engine.

@Calinou
Copy link
Member

Calinou commented Dec 14, 2023

I would prefer to have proper closed curve support, like we have for Line2D since 4.2. This makes runtime modifications significantly easier and avoids any situations where points could get out of sync. This is particularly the case when you have tangents for the start and end point and you want them to match for the curve to be smooth over its last/first point.

@GreenCrowDev
Copy link
Author

@Calinou I would probably prefer that too. One of the reasons I proposed this implementation is because after all these years Curve3D still has not the closed property, even though everyone agree with that...
Why though? Would the implementation of a proper closed property be too difficult?
Do you think that if I'd take a look at the issue you mentioned I'd be able to implement that in a proper way for Curve3D?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants