Schemas / Geometry / paint

rig.geometry.nurbs_surface

v0.31.0 · draft 10 fields 7 required

Fields

FieldTypeMeaning
degreeU int required Polynomial degree in U (typically 3)
degreeV int required Polynomial degree in V (typically 3)
countU integer2 – * required Control points along U; at least 2
countV integer2 – * required Control points along V; at least 2
controlPoints array<vec3>min 4 items required Row-major net, U varies fastest. Length is countU * countV
knotsU array<number> required Knot vector in U (non-decreasing)
knotsV array<number> required Knot vector in V (non-decreasing)
weights array<number> optional Optional. Empty or absent = all weights 1 (non-rational). Same length as controlPoints when present
closedU bool optional Optional. Absent = false
closedV bool optional Optional. Absent = false

NURBS surface (control net in 3-space). Format when present.

Curves stay on rig.geometry.spline / rig.geometry.spline3d. Do not flatten a patch to a spline, and do not invent a second curve schema.

A bilinear patch is degreeU/degreeV 1 with a 2×2 net. Open uniform cubic knots for four points in one direction are [0,0,0,0,1,1,1,1].

Tessellation to rig.geometry.mesh is host fulfillment - this schema is the parametric source of truth. Do not also attach a mesh for the same surface unless the mesh is a bake the host may rebuild.

Appearance: compose rig.render.material or rig.paint.fill_stroke.

JSON Schema

Resolves at https://rig.works/schemas/rig.geometry.nurbs_surface.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.geometry.nurbs_surface.schema.json",
  "title": "rig.geometry.nurbs_surface",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "degreeU": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "degreeV": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "countU": {
      "type": "integer",
      "minimum": 2
    },
    "countV": {
      "type": "integer",
      "minimum": 2
    },
    "controlPoints": {
      "type": "array",
      "items": {
        "$ref": "./_defs.schema.json#/$defs/vec3"
      },
      "minItems": 4
    },
    "knotsU": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "knotsV": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "weights": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "closedU": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "closedV": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    }
  },
  "required": [
    "degreeU",
    "degreeV",
    "countU",
    "countV",
    "controlPoints",
    "knotsU",
    "knotsV"
  ]
}

Seen in

cad-boolean.json