{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "https://schema.stfform.at/stfexp.curve.schema.json",
	"title": "Bézier Curve",
	"description": "2D and 3D Bézier Curves in 3D space",
	"stfImplementations": {
		"blender": {
			"representingType": "bpy.types.Curve",
			"link": "https://codeberg.org/stf_format/stf_blender/src/branch/master/stfblender/stf_resources/stfexp/stfexp_curve.py"
		},
		"godot": {
			"representingType": "STFEXP_Curve_Resource",
			"link": "https://codeberg.org/stf_format/stf_godot/src/branch/master/addons/stf_godot/resources/stfexp/STFEXP_Curve.gd"
		}
	},
	"allOf": [{ "$ref": "https://schema.stfform.at/stf.schema.json#/$defs/stf_data_resource" }],
	"properties": {
		"type": {
			"const": "stfexp.curve"
		},
		"dimensions": {
			"enum": [2, 3]
		},
		"splines": {
			"type": "array",
			"items": {
				"type": "object",
				"title": "Spline",
				"properties": {
					"type": {
						"const": "bezier",
						"description": "As of now `bezier` is the only supported curve type."
					},
					"points": {
						"type": "array",
						"items": {
							"type": "object",
							"title": "Bezier Control Point",
							"properties": {
								"translation": {
									"type": "array",
									"items": {
										"type": "number"
									},
									"minItems": 3,
									"maxItems": 3,
									"description": "The (XYZ) position of this control point."
								},
								"handle_in": {
									"type": "array",
									"items": {
										"type": "number"
									},
									"minItems": 3,
									"maxItems": 3,
									"description": "The (XYZ) position of this in-handle (left-handle) of this control point."
								},
								"handle_in_type": {
									"enum": ["free", "aligned", "auto"]
								},
								"handle_out": {
									"type": "array",
									"items": {
										"type": "number"
									},
									"minItems": 3,
									"maxItems": 3,
									"description": "The (XYZ) position of this out-handle (right-handle) of this control point."
								},
								"handle_out_type": {
									"enum": ["free", "aligned", "auto"]
								},
								"tilt": {
									"type": "number"
								}
							},
							"required": [
								"translation",
								"handle_in",
								"handle_in_type",
								"handle_out",
								"handle_out_type",
								"tilt"
							]
						},
						"description": "List of bezier control points.",
						"stfExpand": true
					},
					"cyclic": {
						"type": "boolean",
						"default": false,
						"description": "Whether the spline forms a circle."
					}
				},
				"required": [
					"type",
					"points"
				]
			},
			"description": "List of splines.",
			"stfExpand": true
		}
	},
	"required": [
		"type",
		"dimensions",
		"splines"
	],
	"additionalProperties": false
}