• Stars
    star
    433
  • Rank 100,464 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 13 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is the repository of the v1 and v2 version of BIM Surfer. It is not maintained anymore. Find the most recent version on https://github.com/opensourceBIM/BIMsurfer
Copyright 2018, bimsurfer.org
BIM Surfer is licensed under the MIT License.

Outdated

This repo holds the BIM Surfer v1 and v2. This codebase is not maintained anymore. Find the new BIM Surfer on https://github.com/opensourceBIM/BIMsurfer

Table of Contents

Introduction

BIMSurfer is a WebGL-based 3D viewer for BIMServer that's built on xeogl.

TODO: More info

Usage

BIMSurfer

Creating a BIMSurfer:

var bimSurfer = new BimSurfer({
    domNode: "viewerContainer"
});

Loading a model from BIMServer:

bimSurfer.load({
        bimserver: ADDRESS,
        username: USERNAME,
        password: PASSWORD,
        poid: 131073,
        roid: 65539,
        schema: "ifc2x3tc1" // < TODO: Deduce automatically
    })
        .then(function (model) {
        
                // Model is now loaded and rendering.
                // The following sections show what you can do with BIMSurfer at this point.
                //...
            });

Generate a random test model if you want to test BIMSurfer without loading anything from BIMServer:

bimSurfer.loadRandom();

The following usage examples in this guide will refer to objects from the generated test model.

Objects

Selecting and deselecting objects

Selecting four objects:

bimSurfer.setSelection({ids: ["object3", "object2", "object4", "object6"], selected: true });

then querying which objects are selected:

bimSurfer.getSelection()

The result shows that those four objects are currently selected:

["object3", "object2", "object4", "object6"]

If we then deselect two objects, then query the selection again:

bimSurfer.setSelection({ids: ["object3", "object6"], selected: false });
bimSurfer.getSelection()

The result shows that only two objects are now selected:

["object2", "object4"]  

Subscribing to selection updates:

bimSurfer.on("selection-changed", 
    function() {
         var selected = bimSurfer.getSelection();
         console.log("selection = " + JSON.stringify(selected));
    });

Showing and hiding objects

Hiding three objects by ID:

bimSurfer.setVisibility({ids: ["object3", "object1", "object6"], visible: false });

Setting two objects visible by ID:

bimSurfer.setVisibility({ids: ["object1", "object6"], visible: true });

Hiding all objects of IFC types "IfcSlab" and "IfcWall":

bimSurfer.setVisibility({types: ["IfcSlab", "IfcWall"], visible: false });

Changing color and transparency of objects

Making two objects pink:

bimSurfer.setColor({ids: ["object3", "object6"], color: [1, 0, 1] })

An optional fourth element may be specified in the color to set opacity:

bimSurfer.setColor({ids: ["object3", "object6"], color: [1, 0, 1, 0.5] })

Camera

Controlling the camera

Setting the camera position:

bimSurfer.setCamera({ 
    eye: [-20,0,20],
    target: [0,10,0],
    up: [0,1,0]
});

Then "target" will then be the position we'll orbit about with the mouse or arrow keys (until we double-click an object to select a different orbit position).

Setting the camera projection to orthographic:

bimSurfer.setCamera({ 
    type:"ortho"
});

Setting the view volume size for orthographic, switching to orthographic projection first if necessary:

bimSurfer.setCamera({ 
    type:"ortho", 
    scale: 100
});

This uses the same technique as Blender, where the scale argument relates to the "real world" size of the model, meaning that if you set scale to 100, then your view would at most encompass an element of 100 units size.

Setting the camera projection to perspective:

bimSurfer.setCamera({ 
    type:"persp"
});

Setting the FOV on Y-axis for perspective, switching to perspective projection first if necessary:

bimSurfer.setCamera({ 
    type:"persp", 
    fovy: 65
});

Querying camera state:

var camera = bimSurfer.getCamera();

The returned value would be:

{
    "type": "persp",
    "eye": [-20,0,20],
    "target": [0,10,0],
    "up": [0,1,0],
    "fovy": 65
}

Subscribing to camera updates:

bimSurfer.on("camera-changed", 
    function() {
         var camera = bimSurfer.getCamera();
         console.log(JSON.stringify(camera));
    });

Fitting objects in view

Flying the camera to fit the specified objects in view:

bimSurfer.viewFit({ ids: ["object3", "object1", "object6"], animate: true });

Jumping the camera to fit the specified objects in view:

bimSurfer.viewFit({ids: ["object1", "object6"], animate: false });

Flying to fit all objects in view:

bimSurfer.viewFit({ animate: true });

Jumping to fit all objects in view:

bimSurfer.viewFit({ animate: false });

Resetting

Camera

Resetting the camera to initial position:

bimSurfer.reset({ cameraPosition: true });

Objects

Resetting all objects to initial visibilities:

bimSurfer.reset({ visibility: true });

Resetting two objects to their initial visibilities:

bimSurfer.reset({ ids: ["object3", "object6"], visibility: true });

Resetting all objects to their initial colors:

bimSurfer.reset({ elementColors: true });

Resetting two objects to their initial colors:

bimSurfer.reset({ ids: ["object3", "object6"], elementColors: true });

Deselecting all objects:

bimSurfer.reset({ selectionState: true });

More Repositories

1

BIMserver

The open source BIMserver platform
Java
1,549
star
2

BIMsurfer

The latest version of the BIM Surfer WebGL viewer for IFC
JavaScript
378
star
3

bimvie.ws

Javascript client for Building Information Modelling, using open standards like IFC, BCF and BIMSie. Using Bootstrap, BIM Surfer, etc..
JavaScript
171
star
4

WebGL-threeJS

WebGL viewer for BIMserver.org; based on ThreeJS
JavaScript
77
star
5

voxelization_toolkit

Voxelization Toolkit for (IFC) Building Models
C++
69
star
6

BIMserver-JavaScript-API

BIMserver JavaScript API
JavaScript
55
star
7

IfcOpenShell-BIMserver-plugin

IfcOpenShell BIMserver plugin
Java
52
star
8

BCF-Forum

Server and forum to communicate on BIM issues. BCF 2.0 compatible.
JavaScript
36
star
9

bimql

Building Information Model Query Language (BimQL)
Java
36
star
10

python-mvdxml

A mvdXML checker and w3c SPARQL converter, as an IfcOpenShell submodule or stand-alone.
Python
33
star
11

IfcValidator

Checking IFC models on the quality of the data. Implemented parts of the Dutch "Rijksgebouwendienst BIM norm" as an example.
Java
27
star
12

CesiumLoader

A basic boundingbox loader to load models from BIMserver in CesiumJS
JavaScript
22
star
13

BuildingSMARTLibrary

Java
18
star
14

GltfSerializers

BIMserver that converts a model to binary glTF
Java
17
star
15

COBie-plugins

COBie import/export plugins for the open source BIMserver.org platform
Java
17
star
16

IfcPlugins

BIMserver plugins that provide IFC serialization/deserialization
Java
17
star
17

IFC-files

Post your IFC data under the Creative Commons Attribution-NoDerivatives license
17
star
18

IfcEngine

BIMserver plugin which provider a Render Engine by embedding the RDF Ifc Engine
Java
16
star
19

bimvie.ws-viewer

New viewer for BIMVie.ws, in separate project for review before integration
JavaScript
15
star
20

mvdXMLChecker

Use mvdXML to validate IFC models
Java
15
star
21

BIMbots-FreeCAD

A FreeCAD plugin to communicate with BIMbots services
Python
13
star
22

floorplan-generator

Plug-in for BIMserver to create a 2D HTML floorplan generator.
HTML
13
star
23

BIMBot-RevitPlugin

C#
11
star
24

TestFiles

This project contains test (IFC) files
11
star
25

AECHackathon

Information for people that join a AEC Hackathon
9
star
26

CityGML

BIMserver plugin for CityGML output of models
Java
8
star
27

BIM-Bot-services

List of known BIMSie compliant services
7
star
28

publications-presentations

Publications and presentations related to the open source BIM work
6
star
29

Java3D

Java3D viewer
Java
5
star
30

IfcAnalytics

BIMserver plugin that generates a JSON based summary of the IFC model
Java
4
star
31

OpenIFD

open source concepts server to extend IFC objects with extra attributes
4
star
32

Charting

BIMserver plugin that can create all sorts of charts of your model
Java
4
star
33

voxel_server

Server component for voxelization toolkit
Python
4
star
34

BIMserver-Repository

Public repository for BIMserver services, plugins, extended data schema's and more
4
star
35

BinarySerializers

BIMserver plugins that provide binary serializations of model data
Java
4
star
36

ClashDetectionService

A BIMserver plugin that does basic clash detection
Java
4
star
37

Tools

Java
3
star
38

BOM-extractor

Bill Of Material extractor (implemented as a satellite server)
Java
3
star
39

Console

Webbased tool for interactive BIMserver API access
HTML
3
star
40

BcfReporter

Reports BCF from modelchecking feature in BIMserver
Java
3
star
41

Mergers

BIMserver plugin that provide basic merging
Java
2
star
42

Collada

BIMserver plugin that outputs BIM models as Collada
Java
2
star
43

Authoring-Tool-Plugins-Revit

C#
2
star
44

modelchecking-snippets

Snippets of modelchecking code (mvdXML, java, whatever)
2
star
45

JavaModelChecker

BIMserver plugin that can do model checking based on (runtime configurable) Java code
Java
2
star
46

DemoPlugins

BIMserver plugins for demo purposes
Java
2
star
47

phpClientLib

php client library for BIMserver.org and BIMSie
PHP
2
star
48

IfcAnalyses

Java
1
star
49

NL-MPG-calc

Code compliance checking for Chapter 5 of the Dutch building decree
Java
1
star
50

openbimstandards

just for the wiki / issues
1
star
51

StatsbyggValidator

Validator for Statsbygg rules
Java
1
star
52

FixedFileService

Service that always return a preconfigured file
Java
1
star
53

Bcf

Java
1
star
54

wordpress-bimserver

PHP
1
star
55

IfcObjectTagger

Ifd tagging pluging for BIMserver.org
1
star
56

BimServerJavaClientDemo

Java
1
star
57

BIMBot-SketchupPlugin

Ruby
1
star
58

JavaQueryEngine

BIMserver plugin that can do (old-style) querying based on runtime configurable Java code
Java
1
star