# 调用函数 API

此接口用来调用函数。如果函数选择异步执行,那么会返回一个任务id,可进一步通过调用查询函数执行结果API查询函数执行结果。

# 请求

POST https://apigate.glodon.com/meshSimplify/meshSimplify/v1.1
1

# header 参数

参数名 必选 类型 描述
Authorization String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type String application/json

# query参数

参数名 必选 类型 默认值 描述
blocking Boolean false true表示阻塞调用,如果函数能在60秒内执行完毕,则可以直接返回函数结果

# body 参数

参数名 必选 类型 默认值 描述
fileId String 上传文件API中返回的文件id
fileSrc String 格式:objFilePathInZip。 objFilePathInZip即待模型简化的.obj文件在zip文件中的路径。比如ta.zip的直接目录下有ta.obj,则fileSrc的值为ta.obj。
dCompressionRatio double 模型的简化率。范围:小于0,返回失败;大于等于0且小于等于1,输出简化比指定的比例数量;大于等于2,输出模型简化到指定的数量。
isMaterialBaking bool true 是否使用纹理烘培(重新生成纹理图),默认为true;若要调用Simplify接口,需要设为false
simConfig obj
+longNarrowTriFactor double 1e-3 狭长三角形判断因子(小于该因子即为狭长三三角形)范围:(0, 1]
+foldItSelfFactor double 0.5 控制出现Fold Itself 的因子(小于该因子即为出现fold itself现象)范围:(0, 1)
+isUseAreaWeight bool true 是否采用三角形面积作为权重
+relocateMesh bool true 中心化网格坐标
+forceReduction bool false 忽略特殊情况保护(门窗特征)简化至目标数量
+removeIsoTris bool false 是否在预处理阶段聚合点之后删除独立离群的三角面片
+closePointRadius double 1e-12 聚合点距离
+decomposemesh bool false 将所有三角面片拆分
+isUseTexSimply bool false 是否采用带纹理简化,只支持单张纹理贴图的带纹理简化
+texSmooth bool false 是否对原始纹理以及输出纹理进行平滑处理
+globalAreaProtect float 0.2 整体化简面积大于阈值时退出,默认值0.2表示面积变化超过原始输入模型的20%时退出简化
imageNum int 1 生成模型纹理的个数(现在没有生效)
textureSize int 1024 生成的纹理大小(默认值1024)
uvPadding int 1 生成纹理的uv图时纹理岛间距(默认值1
texPadding int 1 生成纹理时纹理岛膨胀像素(默认值1)
# 需要注意
  • 原始路径和输出路径不包含中文
  • 推荐使用默认参数,除非确实需要改变简化策略

# 响应

异步调用(blocking=false)

函数异步执行,会返回一个任务id,用于后续查询函数执行结果。

字段名 必选 类型 描述
activationId String 任务id

阻塞调用(blocking=true)

如果函数在60秒内执行完,那么可以直接返回函数结果;否则返回504,提示超时。

# HTTP 请求示例

curl --location --request POST 'https://apigate.glodon.com/meshSimplify/meshSimplify/v1.1' \
--header 'Authorization: Bearer cn-d1ff5d31-221a-49f2-9474-6a2625ff8cb6' \
--header 'Content-Type: application/json' \
--data-raw '{
    "fileId": "obs:data/01317fe1b09048a496ea63649e21941c.zip",
    "fileSrc": "ta.obj",
    "dCompressionRatio": 0.5,
    "simConfig": {
        "longNarrowTriFactor": 0.001,
        "foldItSelfFactor": 0.5,
        "isUseAreaWeight": true,
        "relocateMesh": true,
        "forceReduction": false,
        "removeIsoTris": false,
        "closePointRadius": 1e-12,
        "decomposemesh": false,
        "isUseTexSimply": false,
        "texSmooth": false,
        "globalAreaProtect": 0.2
    },
    "imageNum": 1,
    "textureSize": 1024,
    "uvPadding": 1,
    "texPadding": 1
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# 成功返回结果

{
    "activationId": "59edac23436a4584adac23436aa5843b"
}
1
2
3
  • 在线客服

  • 意见反馈