polygon_path icon indicating copy to clipboard operation
polygon_path copied to clipboard

A custom 3d curve node for Godot engine, used as a basis for other addons

Polygon Path

polygon_path

A curve node constrained on a 3D plane with the following features :

  • Better visualization compared to the built in Path node
  • Holds a 2D polygon representation of the curve. Polygon resolution is exposed
  • Check if a 3D point is inside or outside the curve. (3D position is projected to the path plane before the check)

See it in action here

Disclaimer

This addon is still a work in progress and is not considered production ready.

There is a lot of thing about how the gizmos is handled that is plain wrong and this should not be used as an example at all. If you're looking for a way to write 3d gizmos, look at this source file instead : https://github.com/HungryProton/concept_graph/blob/master/src/editor/gizmos/box_gizmo_plugin.gd

Installation

  • Clone this repository to you addons folder
  • Enable the plugin from Godot (Project Settings -> Plugins -> Set gm_path to active)

How to use

  • Add a PolygonPath node to your scene
  • When a PolygonPath is selected, new controls will appear on top of the viewport
  • 3 modes are available
    • First button is the Select mode, allows you to move the handles
    • Second button is the Add mode, clicking on the plane will add a new point at the end of the path
    • Third button is the Remove mode
  • The Close curve button (Not working yet) closes the loop
  • The Show polygon button display the internal polygon generated fom the path. The is_inside method relies on this polygon for the calculations.
  • The Show Grid button display the plane where the path is constrained to.

Licence

Unless stated otherwise, the content of this project is available under the MIT licence. Note that some icons (namely the select, create and delete curve point) comes from the GodotEngine editor and are distributed under the CC-BY 4.0 licence