Smoothly fits the vertices of an sfmesh object to a 3D polygon along the Z direction.
Syntax
sfmesh ST_SnapToPolygon(sfmesh sfmesh, geometry geom, f8 zlowd, f8 zupd, f8 buffer, i4 times);Return value
Returns the sfmesh object with its vertices smoothly fit to the specified 3D polygon.
Parameters
| Parameter | Type | Description |
|---|---|---|
| sfmesh | sfmesh | The sfmesh model object. |
| geom | geometry | The 3D polygon to fit vertices to. |
| zlowd | f8 | The lower distance limit in the Z direction. Only vertices within the range defined by zlowd and zupd are fit. |
| zupd | f8 | The upper distance limit in the Z direction. Only vertices within the range defined by zlowd and zupd are fit. |
| buffer | f8 | The buffer distance that defines the smooth transition range around the polygon boundary. |
| times | i4 | The number of smooth fitting iterations. Higher values produce better results. Set this value between 5 and 20. |
Example
SELECT BOX3D(ST_SnapToPolygon(
ST_3DIntersection(ST_3DMakeSphere(1.0, 4), 'BOX3D(-1 -1 0, 1 1 1)'::box3d),
'POLYGON((-5 -0.1 0.5, 5 -0.1 0.5, 5 0.1 0.5, -5 0.1 0.5, -5 -0.1 0.5))', 0.5, 0.5, 0.5, 10));Output:
BOX3D(-1 -1 0,1 1 0.782785594463348)