mcpField
B
bimface-helper-v3-3d

bimface-helper-v3-3d

github.com/bimfaceDevelopment741 installsUpdated 16w ago
Repository

About bimface-helper-v3-3d

A skill for developers building BIMFACE web applications with JSSDK v3. It maps requests to documented modules and requires following their API examples and code checks.

Key features

  1. 01References scene interaction and component operations
  2. 02Covers visual effects and spatial analysis
  3. 03Guidance for annotations, filtering, and bounding boxes
  4. 04Requires mapping requests to documented APIs
  5. 05Includes a code review checklist

Use cases

  1. 01Implement component coloring or isolation from the references
  2. 02Add camera interaction, labels, or measurements
  3. 03Check whether a request fits documented SDK capabilities
  4. 04Review asynchronous calls and rendering updates

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bimface/bimface-helper-skills --skill bimface-helper-v3-3d

After installing, type/bimface-helper-v3-3din Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
anchorEffect.md
annotation.md
autoRotate.md
axisGrid.md
blink.md
boundingBox.md
camera.md
clusterItem.md
color.md
componentVisibility.md
curveEffect.md
customLabel.md
customToolbar.md
deactivate.md
dimension.md
embedDrawing.md
events.md
explosion.md
externalObject.md
filter.md
fireEffect.md
flyLine.md
glowEffect.md
growthAnimation.md
heatmap.md
initialize.md
isolate.md
leadLabel.md
light.md
marker3D.md

Details

From the project README

BIMFACE Web应用开发技能

使用须知

  • 仅支持BIMFACE平台Web应用,使用JSSDK v3版本
  • 严格参照 references/ 目录下对应文档的代码写法,不自行变更接口调用方式
  • 仅实现用户明确要求的功能

接口调用指南

识别同步/异步的方法:BIMFACE JSSDK v3 的同步/异步区分很简单——方法参数中包含 callback/回调函数的即为异步(如 getComponentProperty),无回调的即为同步(如 getBoundingBoxById)。各 reference 文档中有完整示例,调用时参照示例即可。

1. 页面初始化
1.1 需求解析(编码前强制执行)

接收用户需求后,先完成以下步骤再开始编码:

  1. 能力映射:将用户需求的关键词对照 §2 功能模块 找到匹配的 reference 文档
  2. 范围确认:如果需求涉及 3 个以上模块,列出计划调用的模块清单,让用户确认优先级
  3. 不支持告知:如果需求无法匹配到任何现有 reference,立即告知用户"当前 SDK 能力范围不支持",避免沉默生成错误代码
  4. 多模型判断:如果需求涉及多个模型/集成模型,确认是否需要 getModel(modelId) 指定目标模型
2. 功能模块
2.1 场景交互相关
2.2 构件操作相关
2.3 效果呈现相关
2.4 空间分析
  • 空间分析:参考空间分析,包括可视域分析、控高分析、透视分析、天际线分析和射线检测
2.5 注记相关
2.6 其他
  • 构件筛选:参考构件筛选,当接口描述中涉及到根据构件的objectData信息进行筛选时,需要根据筛选条件格式进行传参
  • 包围盒(BoundingBox):参考包围盒,描述如何获取或自行构造包围盒
3. 全局变量命名约定

所有reference文档统一使用以下变量名,不再逐个声明:

变量名类型/说明获取方式
viewer3D3D查看器对象app3D.getViewer()
app3DWebApplication应用对象new Glodon.Bimface.Application.WebApplication3D(config)
model3D3D模型对象viewer3D.getModel()(单模型)或 viewer3D.getModel(modelId)(多模型)
camera3D3D相机对象viewer3D.getCamera()
drawableContainer标签容器对象new Glodon.Bimface.Plugins.Drawable.DrawableContainer(config)

关键约束:model3D 必须在 ViewAdded 事件触发后才能获取;多模型场景下必须用 viewer3D.getModel(modelId) 指定目标模型。

4. 代码自查

开发完成后逐项检查:

  • 功能回溯:将生成的代码与原始需求逐条比对,确认需求中的每个功能点都有对应实现,不存在"需要A却生成了B"或额外生成未要求的功能
  • 变量名是否与命名约定一致(viewer3D / model3D / app3D / camera3D / drawableContainer)
  • 每个 API 调用是否能在对应 reference 中找到一模一样的方法签名(不自行编造方法名、参数名),如果某个功能在对应 reference 文档中找不到明确的 API,请告知用户"当前 SDK 能力范围不支持",不要自行编造方法名或参数
  • 异步操作(getComponentProperty、getFloors、getBoundingBox、loadObject 等)的结果是否在回调函数中处理
  • 状态变更后是否调用 viewer3D.render()
  • 事件处理函数是否为具名函数(确保可注销)
  • 筛选条件格式是否与 构件筛选 一致
  • 颜色构造是否使用了 new Glodon.Web.Graphics.Color() 而非裸颜色字符串或数组
  • 添加外部构件后是否调用了 viewer3D.updateSceneBoundingBox()(避免构件在相机范围外不可见)
  • 代码中是否存在未在 §3 全局变量命名约定 中声明的"野生变量"
4.1 常见错误速查
❌ 错误✅ 正确
model.setColor(...)不同模块方法名不同:构件着色用 overrideComponentsColorById,房间用 setRoomColor,线框用 setWireframeColor
筛选条件 {category: "Wall"}正确字段名为 categoryId(数字字符串)和 family、levelName,格式见 构件筛选
viewer.getModel().setColor(...)应使用 model3D.overrideComponentsColorById(ids, color)
外部构件移动后不更新包围盒先调用 viewer3D.updateSceneBoundingBox() 再 render()
markerContainer.onClick(fn)marker.onClick(fn) onClick 是单个 Marker3D 对象的方法,不是容器的方法

Comments

Markdown supported