x3d_generate_node
Generate a single X3D node with specified field values, leveraging the official x3d.py library to ensure type correctness and return the XML fragment.
Instructions
Generate a single X3D node with specified field values.
Uses the official x3d.py library (X3DPSAIL) to construct the node,
ensuring type correctness by construction. Returns the XML fragment
for the node.
Args:
node_name: The X3D node name. Examples: Box, Sphere, Material, Transform,
Viewpoint, DirectionalLight, IndexedFaceSet, ImageTexture.
fields: JSON string of field name-value pairs. Examples:
'{"size": [2, 3, 1]}' for Box
'{"diffuseColor": [1, 0, 0], "transparency": 0.5}' for Material
'{"translation": [1, 2, 0], "rotation": [0, 1, 0, 1.57]}' for Transform
'{"radius": 2.5}' for Sphere
'{}' for defaults
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | {} | |
| node_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |