This topic describes the ST_Simplify function. This function simplifies a 3D model.
Syntax
scene ST_Simplify(scene sc, cstring rules);Parameters
| Parameter | Description |
|---|---|
| sc | The scene object. |
| rules | The rule that is used to simplify the 3D model. |
Description
This function simplifies the 3D model based on the rule that you specified. The rule is in the JSON format.
{
"mothed": "percent"/"error", default is "percent",
"threshold": default is 0.5,
"blacklist" : ["wall","glass"],
"boundary": default is true, simplify the boundary,
"meshes":[
{"names": ["m0","m1"], "threshold": 0.5},
{"names": ["m2","m3"], "threshold": 0.001}
]
}The following table describes the fields in the JSON value.
| Field | Description |
|---|---|
| mothed | The method that is used to control the simplification. Valid values:
Note percent indicates the percentage of the number of triangular surfaces after the simplification to the number of triangular surfaces in the original model. A smaller value indicates that the model is more simplified. error indicates the distance from the new vertex to the original vertex. A larger value indicates that the model is more simplified. |
| threshold | The threshold of the simplification. For more information about valid values, see the description of the mothed parameter. |
| blacklist | The blacklist of the simplification. The mesh objects in the model are filtered by name. Mesh objects that are in the blacklist are not simplified. |
| boundary | Specifies whether to simplify the boundary. Default value: true. Note If the boundary is simplified, the model may be collapsed or broken. |
| meshes.names | You can group mesh objects in the model by name and simplify the mesh objects by group. You can specify different thresholds for groups. |
| meshes.threshold | The simplification threshold of the group. Note You can group objects in a model by name and simplify the objects by group. For example, you can increase the percentage based on which high-precision models are simplified and decrease the percentage based on which low-precision models are simplified. |
Model simplification does not moderate the display results of models but can significantly reduce the storage that is occupied by the models. The following section provides examples:
- Percentage for simplification: 100%
- Occupied storage: 96 MB
- Result

- Percentage for simplification: 5% geometric simplification and 25% image simplification
- Occupied storage: 2.9 MB
- Result

Examples
SELECT ST_Simplify(data,
'{
"threshold": 0.1,
"mothed": "percent",
"blacklist":["Mesh.012", "Mesh.009", "Mesh.005"],
"meshes": [
{"names":["Mesh.007"], "threshold": 0.01},
{"names":["Mesh.004"], "threshold": 0.3}
]}') from t;
---------------------------
0x.....