ST_Simplify reduces the vertex count of a 3D scene to decrease storage size without affecting visual output.
Syntax
scene ST_Simplify(scene sc, cstring rules);Parameters
| Parameter | Type | Description |
|---|---|---|
sc | scene | The scene object to simplify. |
rules | cstring | A JSON string that controls the simplification behavior. See Rules for the full schema. |
Rules
Pass a JSON object to rules to configure how simplification is applied. All fields are optional and fall back to their defaults.
{
"mothed": "percent",
"threshold": 0.5,
"blacklist": ["wall", "glass"],
"boundary": true,
"meshes": [
{"names": ["m0", "m1"], "threshold": 0.5},
{"names": ["m2", "m3"], "threshold": 0.001}
]
}| Field | Type | Default | Description |
|---|---|---|---|
mothed | string | "percent" | The simplification method. Valid values: "percent", "error". |
threshold | number | 0.5 | The simplification threshold. Semantics depend on mothed. See Threshold behavior. |
blacklist | array of strings | — | Mesh names to exclude from simplification. Meshes in this list are left unchanged. |
boundary | boolean | true | Specifies whether to simplify boundary geometry. |
meshes | array of objects | — | Per-group simplification overrides. Each entry specifies a list of mesh names and a threshold that applies only to those meshes. |
meshes[].names | array of strings | — | The mesh names in this group. |
meshes[].threshold | number | — | The simplification threshold for this group, overriding the top-level threshold. |
Threshold behavior
The meaning of threshold changes based on the mothed value:
mothed | threshold range | Meaning | Direction |
|---|---|---|---|
"percent" | (0, 1) | Ratio of triangles retained after simplification to the original count. A value of 1 retains all triangles (no simplification); a value close to 0 produces maximum simplification. | Lower = more simplified |
"error" | (0, +∞) | Maximum allowed distance (in model coordinate units) from a new vertex to its original position. A larger value permits greater deviation and produces more simplification. | Higher = more simplified |
Boundary simplification
If the boundary is simplified, the model may be collapsed or broken. Test with a copy of your model before applying to production data.
Per-mesh group overrides
Use the meshes field to apply different thresholds to specific mesh groups. This lets you simplify high-detail meshes aggressively while preserving detail in others.
For example, set a high threshold (less simplification) for architectural detail meshes and a low threshold (more simplification) for background geometry.
Examples
The following example simplifies a scene using the percent method with a global threshold of 0.1 (retaining 10% of triangles), excludes three meshes from simplification, and applies custom thresholds to two mesh groups.
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;Storage impact
Simplification significantly reduces model storage size without affecting visual output.
| Simplification settings | Storage size |
|---|---|
| 100% (no simplification) | 96 MB |
| 5% geometric + 25% image simplification | 2.9 MB |
100% (no simplification)

5% geometric + 25% image simplification
