Source
Extensions
The following extensions are supported:Examples
Examples of what is embedded in the glTF JSON block:- ANSYS_linewidth:
- ANSYS_material_name:
- ANSYS_material_details:
- ANSYS_scene_timevalue:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
@addtogroup ANS_exts Ansys glTF Extensions
@ingroup gltf
@brief Ansys specifc extensions to the glTF specification
## Extensions
__Note: This component is a work in progress and this documentation is incomplete/preliminary.__
The GLTFWriter Library is a C++ library that is capable of writing geometry scenes in glTF
format. The core glTF specification, while complete, does not meet all of the needs
of Ansys applications. There are a collection of formal extensions to the specification
that this library (and other aspects of the Ansys glTF ecosystem) use to place more
specific information into the files.
## GLTFWriter API Interface
These extensions have been designed to be specified using the @ref ANSYS::AVZ::GLTFWriter::Value interface.
Adding a line width specification to a ANSYS::AVZ::GLTFWriter::Mesh object is done like this:
```{.cpp}
auto line_width = GLTFWriter::Value::Create(gltf, "ANSYS_linewidth", 0.5);
mesh->AppendValue(line_width);
| Extension | Datatype | Object(s) | Description |
|---|---|---|---|
| ANSYS_linewidth | float | @ref ANSYS::AVZ::GLTFWriter::Scene, @ref ANSYS::AVZ::GLTFWriter::Mesh | Specifies the width of lines and size of points |
| ANSYS_material_name | string | @ref ANSYS::AVZ::GLTFWriter::Material | The name of the material |
| ANSYS_material_details | string | @ref ANSYS::AVZ::GLTFWriter::Material | JSON description of the material details |
| ANSYS_scene_timevalue | float | @ref ANSYS::AVZ::GLTFWriter::Scene | Time value for the scene |
"extensions": {
"ANSYS_linewidth": {
"linewidth" : 100.0
}
}
"extensions": {
"ANSYS_material_name": {
"name" : "sample_material_name"
}
}
"extensions": {
"ANSYS_material_details": {
"ensight/Metal/Gold": {
"version": "2025 R1",
"material_type": "SUBSURFACETHINGLASS",
"color": [0.981126, 0.793495, 0.343545],
"ambient": [0.981126, 0.793495, 0.343545],
"ka": 0.001373,
"diffuse": [0.981126, 0.793495, 0.343545],
"kd": 0.000000,
"specular": [1.000000, 0.808760, 0.350154],
"ks": 1.000000,
"reflective": [1.000000, 0.808760, 0.350154],
"kr": 0.300000,
"emissive": [1.000000, 1.000000, 1.000000],
"ke": 0.000000,
"shininess": 200.000000,
"smoothness": 0.500000,
"opacity": 1.000000,
"gamma_corrected": false,
"metallic": 1.000000,
"speculartint": 1.000000,
"eta": [0.070000, 0.370000, 1.500000],
"kta": [3.700000, 2.300000, 1.700000]
}
}
}
"extensions": {
"ANSYS_scene_timevalue": {
"timevalue": 0.223
}
}
[public]: https://img.shields.io/badge/-public-brightgreen (public)
[C++]: https://img.shields.io/badge/language-C%2B%2B-blue (C++)
[protected]: https://img.shields.io/badge/-protected-yellow (protected)
[static]: https://img.shields.io/badge/-static-lightgrey (static)
[Python]: https://img.shields.io/badge/language-Python-blue (Python)
[private]: https://img.shields.io/badge/-private-red (private)
[const]: https://img.shields.io/badge/-const-lightblue (const)
[Markdown]: https://img.shields.io/badge/language-Markdown-blue (Markdown)
Was this page helpful?