SuperAPI AI Directory

bimface-helper-v3-3d

Frontend & websites

View repository

Updated 10-15 20:06

About this skill

BIMFACE Web Application Development Skills

Usage Notes

  • Only BIMFACE platform Web applications are supported, using JSSDK v3.
  • Strictly refer to references/ the code writing style of the corresponding documents in the directory, and do not change the interface calling method on your own.
  • Only implement the functions explicitly requested by the user.

Interface Calling Guide

Identify synchronous/asynchronous methods: The distinction between synchronous and asynchronous in BIMFACE JSSDK v3 is very simple — if the method parameters include a callback/callback function, it is asynchronous (such as getComponentProperty); if there is no callback, it is synchronous (such as getBoundingBoxById). Each reference document has complete examples; just refer to the examples when calling.

1. Page Initialization

1.1 Requirement Analysis (mandatory before coding)

After receiving the user's requirements, complete the following steps before starting to code:

  1. Capability mapping: Match the keywords of the user's requirements against §2 功能模块 to find the matching reference document.
  2. Scope confirmation: If the requirements involve more than 3 modules, list the modules planned to be called and have the user confirm the priority.
  3. Unsupported notification: If the requirements cannot match any existing reference, immediately inform the user that "the current SDK capability scope does not support it" to avoid silently generating incorrect code.
  4. Multi-model determination: If the requirements involve multiple models/integrated models, confirm whether getModel(modelId) is needed to specify the target model.

2. Functional Modules

2.1 Scene Interaction Related

2.2 Component Operation Related

2.3 Effect Presentation Related

2.4 Spatial Analysis

  • Spatial analysis: ReferenceSpatial analysis, including viewshed analysis, height control analysis, perspective analysis, skyline analysis, and ray detection

2.5 Annotation Related

2.6 Other

  • Component filtering: ReferenceComponent filtering, when the interface description involves filtering based on the component's objectData information, parameters need to be passed according to the filtering condition format
  • Bounding Box (BoundingBox): ReferenceBounding Box, describing how to obtain or construct a bounding box yourself

3. Global Variable Naming Conventions

All reference documents uniformly use the following variable names, without declaring them individually:

Variable Name Type/Description How to Obtain
viewer3D 3D viewer object app3D.getViewer()
app3D WebApplication application object new Glodon.Bimface.Application.WebApplication3D(config)
model3D 3D model object viewer3D.getModel()(single model) or viewer3D.getModel(modelId)(multiple models)
camera3D 3D camera object viewer3D.getCamera()
drawableContainer Label container object new Glodon.Bimface.Plugins.Drawable.DrawableContainer(config)

Key Constraints:model3D must be obtained only after the ViewAdded event is triggered; in multi-model scenarios, viewer3D.getModel(modelId) must be used to specify the target model.

4. Code Self-Check

After development is complete, check item by item:

  • Feature Traceability: Compare the generated code with the original requirements one by one, confirming that every feature point in the requirements has a corresponding implementation, and that there is no "A was needed but B was generated" or extra generation of unrequested features
  • Whether variable names are consistent with the naming conventions (viewer3D / model3D / app3D / camera3D / drawableContainer)
  • Whether each API call can find an identical method signature in the corresponding reference (do not fabricate method names or parameter names yourself); if a feature cannot find a clear API in the corresponding reference document, please inform the user that "the current SDK capability scope does not support it", and do not fabricate method names or parameters yourself
  • Whether the results of asynchronous operations (getComponentProperty、getFloors、getBoundingBox、loadObject , etc.) are handled in callback functions
  • Whether viewer3D.render()
  • Whether event handler functions are named functions (ensuring they can be unregistered)
  • Whether the filter condition format is consistent with Component Filtering consistent
  • Whether color construction uses new Glodon.Web.Graphics.Color() rather than bare color strings or arrays
  • Whether viewer3D.updateSceneBoundingBox()is called after adding external components (to avoid components being invisible outside the camera range)
  • Whether there are "wild variables" in the code that are not declared in §3 全局变量命名约定 the "wildcard variables" declared in

4.1 Common Errors Quick Reference

❌ Incorrect ✅ Correct
model.setColor(...) Method names differ across modules: component coloring uses overrideComponentsColorById, rooms use setRoomColor, wireframes use setWireframeColor
Filter condition {category: "Wall"} The correct field names are categoryId(numeric string) and family、levelName, format see Component Filtering
viewer.getModel().setColor(...) should use model3D.overrideComponentsColorById(ids, color)
Bounding box is not updated after external components move First call viewer3D.updateSceneBoundingBox() then render()
markerContainer.onClick(fn) marker.onClick(fn) onClick is a method of a single Marker3D object, not a method of the container